apiVersion: v1
kind: Pod
metadata:
  name: secret-test-pod
spec:
  containers:
    - name: secret-container
      image: k8s.gcr.io/busybox
      command: ['/bin/sh', '-c', 'ls /etc/appconfig; cat /etc/appconfig/private-key']
      volumeMounts:
        - name: secret-volume
          mountPath: /etc/appconfig
  volumes:
    - name: secret-volume
      secret:
        # Provide the name of the secret containing the files you want
        # to add to the container
        secretName: test-key-secret

# ssh-keygen -f ~/test-rsa -t rsa -b 4096 -C "test@example.com"  # Generate public/private keys in ~/test-rsa
#
# Create secret from files:
# kubectl -n configmap-test create secret generic test-key-secret --from-file=private-key=/Users/samirgadkari/test-rsa
#
# kubectl -n configmap-test describe secret test-key-secret
# kubectl -n configmap-test create -f mount-secret-as-volume.yaml
# kubectl -n configmap-test logs -f secret-test-pod
# kubectl -n configmap-test delete pod secret-test-pod



