We can write a secret as an environment variable in the container.
For example:

We have Deployment as mongodb.yml

env:
 - name: SECRET_VALUE_ENV_VAR 
   valueFrom:
         secretKeyRef: 
                name: myusername
                key: password

The secret will be injected in the container using Environment Variable.

Need Help With Cloud Development?

Work with our skilled Cloud developers to accelerate your project and boost its performance.

Hire Cloud Developers

Support On Demand!

Related Q&A