Skip to content

Latest commit

 

History

History
38 lines (30 loc) · 587 Bytes

secrets.md

File metadata and controls

38 lines (30 loc) · 587 Bytes

Secrets

Create a secret with password:

apiVersion: v1
kind: Secret
metadata:
  name: mysecret
stringData:
  myKey: mypassword

Create pod and pass credentials from env variable:

apiVersion: v1
kind: Pod
metadata:
  name: my-secret-pod
spec:
  containers:
  - name: myapp-container
    image: busybox
    command: ['sh', '-c', "echo Kubernetes is cool! && sleep 3600"]
    env:
    - name: MY_PASSWORD
      valueFrom:
        secretKeyRef:
          name: mysecret
          key: myKey