Okteto Manifest properties `context` and `namespace` are deprecated. What do I do?

When running the Okteto CLI I get the following warning:

Setting 'context' and 'namespace' in the okteto manifest or docker compose is deprecated. We recommend using the env var 'OKTETO_CONTEXT' and 'OKTETO_NAMESPACE' instead.

I have the property context and namespace defined in my Okteto Manifest.

What is the recommended method instead?

In this case, the recommended way is to define the Okteto Context inside a .env file. The file should be located in the same folder than your Okteto Manifest. An example of .env file could be:


Okteto Context and Namespace can also be set via standard environment variables or using the --context and --namespace Okteto CLI flags.

For more information about this, check out the docs: Environment Variables | Okteto Documentation