Kubernetes Secrets in Pods

Secret inside spec.containers.env:

env:
- name: APP_COLOR
  valueFrom:
    secretKeyRef: 
      name: my-secret # The Secret containing the value you want to assign to APP_COLOR
      key: color  # Specify the key associated with the value
Use spec.containers.envFrom to define all of the Secret's data as container environment variables. The key from the Secret becomes the environment variable name in the Pod:
envFrom:
- secretRef:
    name: mysecret
Add the Secret data as files to the directory specified as spec.containers.volumeMounts.mountPath.
spec.volumes:
volumes:
- name: secret-volume
  secret:
    secretName: ssh-key-secret
spec.containers.volumeMounts:
volumeMounts:
- name: secret-volume
  readOnly: true
  mountPath: /etc/secret