Secrets can be accessed from your clusters by two mechanisms: through a mounted volume or through set environment variables. Exposing secrets to your cluster workloads occurs at deployment time by declaring either volumes or environment variables that reference your secrets.
This is an updated version of our basic deployment YAML file that now includes a configuration definition for a mounted volume referencing our creds secret:
---apiVersion: "extensions/v1beta1"kind: "Deployment"metadata: name: "nginx-1" namespace: "default" labels: app: "nginx-1"spec: replicas: 3 selector: matchLabels: app: "nginx-1" template: metadata: labels: app: "nginx-1" spec: containers: - name: "nginx" image: "nginx:latest" env: - name: creds-username ...