Skip to content

Okteto context and namespace management

Okteto context and namespace management are the primary mechanisms for defining the Kubernetes cluster target and organizing the development environment within Okteto.^[400-devops-01-concepts-of-software-development-okteto.md]

Context Management

A context in Okteto represents the target Kubernetes cluster or endpoint where the development environment runs.^[400-devops-01-concepts-of-software-development-okteto.md]

To configure the CLI to use a specific context, such as the Okteto Cloud, users can execute the following command, optionally including a personal access token:^[400-devops-01-concepts-of-software-development-okteto.md]

okteto context use https://cloud.okteto.com --token $YOUR_TOKEN

To view available or active contexts, the list command can be used:^[400-devops-01-concepts-of-software-development-okteto.md]

okteto context list

Namespace Management

Namespaces function as logical partitions or isolated environments within the selected cluster context (e.g., for separating prod from dev).^[400-devops-01-concepts-of-software-development-okteto.md]

Listing Namespaces

Users can inspect the namespaces available in the current context using the okteto namespace (or okteto ns) command:^[400-devops-01-concepts-of-software-development-okteto.md]

okteto ns list

The output typically displays the namespace name and its status (e.g., Active).^[400-devops-01-concepts-of-software-development-okteto.md]

Deleting Namespaces

To remove a namespace, the delete command is used:^[400-devops-01-concepts-of-software-development-okteto.md]

okteto ns delete <namespace-name>

Sources

  • 400-devops-01-concepts-of-software-development-okteto.md