okteto.yml is a manifest format for describing development environments. It declares the deployment target, the dev container, the working directory and other information required to activate your development environment with Okteto.
A list of annotations that will be injected into your development environment.
Sets the command of your development environment. By default, it creates an
The name of the container in your deployment you want to transform into a development environment. By default, it takes the first one.
A list of environment variables that will be injected into your development environment. If a variable already exists on your deployment, it will be overridden with the value specified on the manifest.
Environment variables with only a key, or with a value that starts with a
$ sign are resolved to their values on the machine okteto is running on, which can be helpful for secret or machine-specific values.
A list of secrets that will be injected into your development environment. The format of a secret is
LOCAL_PATH must exist,
REMOTE_PATH must be an absolute path, and
MODE is the remote file permissions in Base-8 (optional: defaults to
A list of ports to forward from your development environment. The list should follow the
localPort:remotePort notation and each element should be unique.
You can also access other services running in your namespace by using the notation
Once your development environment is up and running, you will be able to access the port directly by using
Common uses of port forwarding are:
- Access a service via
localhostinstead of via an ingress.
- Remote debugging.
- Connect to a hot reloader via a websocket.
If Okteto can’t forward a port (typically because they are already taken), an error will be logged in the console.
The labels of the kubernetes deployment you want to transform into a development environment. They must identify a single kubernetes deployment.
Sets the container image of your development environment. Defaults to the image specified in your deployment.
More information on how to create your own development environment here
You can use an environment variable to replace the image, or any part of it:
The image pull policy of your development ennvionemnt (default:
Sets the mount path of your local folder in your development environment (default:
.stignorefile to avoid synchronizing build artifacts, dependencies or git metadata. More information here
The name of your development environment. If
labels is not defined, it is also the name of the kubernetes deployment you want to transform into a development environment.
The namespace of the deployment you want to transform into a development environment. By default, it takes the current kube config namespace.
Allows you to configure the okteto persistent volume:
enabled: enable/disable the use of persistent volumes (default:
storageClass: the storage class of the volume (default: the
size: the size of the okteto persistent volume (default:
trueif you use services.
Allows you to override the resources configuration of your development environment. It follows the same syntax used in Kubernetes. By default,
limits are unset.
Enables the remote mode for your development environment.
When remote mode is activated, the following happens:
.ssh/configfile with the following values:
Once the development environment is up and running, you can SSH into it with the command below:
ssh -P 2222 localhost
You can also ssh using the host entry added to your local SSH config:
Setting this value in the manifest is equivalent to starting your development environment with the
okteto up --remote=2222command.
A list of ports to reverse forward from your development environment to your local machine. The list should follow the
remotePort:localPort notation and each element should be unique.
Once your development environment is up and running, any requests to
0.0.0.0:remotePort in the remote development environment will be directed to
Common uses of reverse forwarding are:
- Remote debugging.
- Send events or logs to your local machine.
Enabling this feature will automatically enable remote mode as well if it’s not already enabled. If your manifest doesn’t include the
remote key, a random port will be selected.
If Okteto can’t reverse forward a port (typically because they are already taken), an error will be logged in the console.
Allows you to override the pod security context of your development environment.
Okteto supports overriding the
capabilities values. They are not set by default, and they follow the same syntax used in Kubernetes.
If you are using a non-root container, and the runAsUser and runAsGroup values are not specified in your Kubernetes manifest, you need to set these values in your Okteto manifest. Remember to use the numeric ID in all cases, not the human readable name.
A list of other containers (other than the main one) that you want to put in developer mode. The difference with the main container and the ones defined in this section is that the main container is transformed into an interactive session, where you can, for example, execute a shell. The containers defined in this section run in detached mode, but they can also mount your local folder in a particular path.
For example, to put a Django application in developer mode you could use the following manifest:
and both deployments,
worker will mount your local folder into the path
The supported keys for containers defined in this section are:
They work the same as for the main container, except for the
name keys. For
command defaults to the command specified in your deployment, instead of
name are mutually exclusive (for the main container,
name is mandatory).
Sets a relative subpath of your local folder to mount in your development environment, instead of mounting the root of your local folder. It is only supported for
A list of paths in your development environment that you want to associate to persistent volumes. This is useful to persist information between
okteto up executions, like downloaded libreries or cache information. For example, to speed your go builds up, you could define:
You can also mount a relative subpath of your local folder:
Sets the working directory of your development environment.
mountpath is not specified,
workdir also specifies the mount path of your local folder in your development environment.
.stignorefile to avoid synchronizing build artifacts, dependencies or git metadata. More information here.