Using the Okteto CLI
The Okteto CLI is our open-source tool that helps you launch development containers anywhere you choose to deploy your application code. The core experience of the Okteto CLI consists of the following:
- The Okteto CLI
- A deployment manifest
- A development environment
- A development container
Okteto CLI
The Okteto CLI is the primary way you will interact with your Kubernetes clusters and development environments. There are three ways you can deploy your application code to a development environment using Okteto:
- Deploy your application on an existing cluster you manage
- Use Okteto SaaS, a single-tenant environment fully managed by Okteto
- Install and manage Okteto Self-Hosted yourself for full control and flexibility
In each of these deployment models you'll need to define and specify a deployment manifest for your development environment. We recommend using an Okteto manifest for the best experience using our platform.
Deployment manifests
Using Okteto rquires one of the following deployment manifests so the Okteto CLI knows how to launch a development environment for your application. The Okteto CLI will look for a manifest in the following order:
- Okteto manifest file: if there is an
okteto.yaml
or.okteto/okteto.yaml
file in your folder, Okteto will use this file to deploy your development environment - Docker Compose file: if there is an
okteto-compose.yaml
ordocker-compose.yaml
file, Okteto will use this file to deploy your development environment - Helm Chart: if there is a
chart
,charts
,helm/chart
, orhelm/charts
directory with achart.yaml
file in it, Okteto will detect the chart and runhelm upgrade --install
on it to deploy your development environment - Kubernetes manifests folder: if there is a
manifests
,kubernetes
, ork8s
folder, Okteto will detect it and runkubectl apply
to deploy your development environment - Kubernetes manifests file: if there is a
manifests.yaml
,kubernetes.yaml
, ork8s.yaml
file, Okteto will detect it and runkubectl apply
to deploy your development environment
Creating an Okteto manifest
If you do not yet have an Okteto manifest the Okteto CLI will analyze your existing manifests (Helm, Kubernetes, etc.) and help you write one for your application. It will then use this Okteto manifest instead of your existing deployment manifests to spin up your application's development environment.
If you're using a Docker Compose file, then Okteto CLI can directly launch a development environment for your application without generating an Okteto manifest. However, you can still choose to create the Okteto manifest if you want more control over the configuration of your environment.
You can use the -f
flag on any Okteto CLI command to explicitly define the location of an Okteto manifest.
Development environments
When you deploy an application to Okteto we create a development environment for you using your deployment manifest's instructions. A developer environment consists of the various services and components of your application and are represented within the Okteto UI like so:
Built-in Tools When Deploying To Okteto
When deploying your development environment Okteto executes the sequence of deploy
commands you specify in your Okteto manifest. The commands run in a Debian Linux container with the following tools preinstalled:
bash
cue
curl
envsubst
git
helm
kubectl
kustomize
make
okteto
openssh
wait-for-it
You can also configure your own container image to use your own tools in your deploy
commands. For example, if you need to invoke terraform commands, you could do:
deploy:
image: hashicorp/terraform:1.4
commands:
- terraform apply -auto-approve