apiVersion: v1
kind: Pod
metadata:
  name: nginx-configmap
  labels:
    app: nginx
    rel: stable
spec:
  volumes:
      - name: app-config-vol
        configMap:
          name: app-settings # here's our reference
  containers:
    - name: my-nginx
      image: nginx:alpine
      ports:
        - containerPort: 80
      env:
        - name: ENEMIES # env variable
          valueFrom:
            configMapKeyRef:
              name: app-settings # here's our reference
              key: enemies
      envFrom: # all env variables
        - configMapRef:
            name: app-settings # here's our reference
      volumeMounts: # env variables as files
        - name: app-config-vol # referencing volume above
          mountPath: /etc/config # path to store config files to be accessed
