# Secrets - Kubernetes
# https://kubernetes.io/docs/concepts/configuration/secret/

# We can also control the paths within the volume where Secret keys are projected. 
# You can use .spec.volumes[].secret.items field to change target path of each key:

# Projection of secret keys to specific paths

apiVersion: v1
kind: Pod
metadata:
  name: mypod
spec:
  containers:
  - name: mypod
    image: redis
    volumeMounts:
    - name: foo
      mountPath: "/etc/foo"
      readOnly: true
  volumes:
  - name: foo
    secret:
      secretName: mysecret
      items:
      - key: username
        path: my-group/my-username