Skip to content

Okteto development workflow

The Okteto development workflow provides a streamlined method for developing applications directly on a Kubernetes cluster. By mirroring the local development environment within the cluster, it allows developers to write, test, and debug code using familiar local tools while maintaining the consistency of the remote infrastructure^[400-devops__01-Concepts-of-Software-Development__okteto.md].

Initial Setup

Before starting the workflow, the Okteto CLI must be installed and configured to communicate with the desired Kubernetes cluster^[400-devops__01-Concepts-of-Software-Development__okteto.md].

Installation and Authentication

The Okteto CLI can be installed using package managers like Scoop^[400-devops__01-Concepts-of-Software-Development__okteto.md]. Once installed, users must authenticate and set the remote context. Authentication typically involves using a GitHub account or an API token^[400-devops__01-Concepts-of-Software-Development__okteto.md].

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

Namespace Configuration

Developers can manage and list namespaces using the CLI^[400-devops__01-Concepts-of-Software-Development__okteto.md]. Selecting the correct namespace is crucial for isolating development environments.

okteto ns list

Development Process

The core workflow relies on the okteto.yml manifest file^[400-devops__01-Concepts-of-Software-Development__okteto.md]. This manifest defines the development container, build instructions, and deployment specifications.

1. Initialization

The okteto init command can automatically generate the okteto.yml manifest file required for the project^[400-devops__01-Concepts-of-Software-Development__okteto.md].

2. Deployment and Activation

The workflow is typically divided into two main stages^[400-devops__01-Concepts-of-Software-Development__okteto.md]:

  1. Deploy the Application: This step builds and pushes the necessary container images and deploys the application dependencies to the cluster^[400-devops__01-Concepts-of-Software-Development__okteto.md].
    okteto deploy
    
  2. Activate the Dev Container: The okteto up command launches the development container, synchronizing local code changes to the remote environment instantly^[400-devops__01-Concepts-of-Software-Development__okteto.md].

3. Workflow Tools

Okteto provides commands to manage the lifecycle of the development environment^[400-devops__01-Concepts-of-Software-Development__okteto.md]:

  • okteto build: Builds and pushes images defined in the manifest.
  • okteto up: Launches the development environment and starts file synchronization.
  • okteto down: Deactivates the development container.
  • okteto destroy: Removes resources created by the deploy command.

Sources

  • 400-devops__01-Concepts-of-Software-Development__okteto.md