apiVersion: v1
kind: Pod
metadata:
  name: secret-pod
spec:
  restartPolicy: Always
  containers:
    - name: debug-container
      image: jhansen/k8s-debugger:latest
      imagePullPolicy: Always
      command: [ "/bin/bash", "-c", "sleep 9000"]
      env:
        - name: SECRET_USERNAME
          valueFrom:
            secretKeyRef:
              name: test-secret
              key: username
        - name: SECRET_PASSWORD
          valueFrom:
            secretKeyRef:
              name: test-secret
              key: password
      volumeMounts:
        - name: test-secret-volume
          readOnly: true
          mountPath: /secrets/test-secret
  volumes:
    - name: test-secret-volume
      secret:
        secretName: test-secret
