<aside> ⚠️ The data stored in the Secret, when the container (pod) is created, is used to set the environment variables. If the Secret gets updated later, the pod will continue to use the old value. We need to re-create the pods by performing a rollout (k rollout restart deployment <deployment-name>) on the deployment to make the new pods use the new data.

</aside>

Secret definition file

Same as ConfigMap except the kind and the base64 encoded values.

apiVersion: v1
kind: Secret
metadata:
	name: app-secret
data:
	USERNAME: adfcfe==
	PASSWORD: asdgfgv==

<aside> 💡 To view the secrets along with their encoded values, run k get secret <secret-name> -o yaml

</aside>

Using Secrets in Pods