Secrets vs environment variables


I am running a few number of Django applications and I have their dev environment deployed through Okteto. The secrets of the applications are imported from the environment variables and therefore I store the secrets in Okteto’s Cloud secrets here.
I use the same keys in all applications.
The problem is that Okteto’s secrets are global for all namespaces. Is there a way to create secrets for each project or namespace, the same way to set separate environment variables for each project?

The second question is what is the difference between Okteto’s secrets and environment variables? I could find an answer in the documentation.

Thanks is advance

Currently, this is not supported. The idea behind secrets is that they are common to all namespaces in the user.

One way to achieve namespace-specific values is by using deployment-time variables. Values declared here will take precedence over Okteto Secrets.

Would you mind adding this as a feature request? It would be very helpful if you could add details on your use case; e.g. why do you need different values per namespace?

Okteto Secrets are exposed as environment variables only during the execution of the deploy phase. It’s up to you to decide how/if you want to pass the values to your application for them to be used in runtime (which is a typical use case for environment variables in Docker Compose or Kubernetes manifests).