apiVersion: v1
kind: Pod
metadata:
  name: fortune-env-from-configmap
  namespace: chp07-set745
spec:
  volumes:
  - name: html # match spec.containers[].volumeMounts.name
    emptyDir: {}

  containers:
  - image: georgebaptista/fortune:env
    name: html-generator
    env:
    - name: INTERVAL
      valueFrom:
        configMapKeyRef:
          name: fortune-config
          key: sleep-interval
    args: ["$(INTERVAL)"]
 
    volumeMounts:
    - name: html
      mountPath: /var/htdocs
  - image: nginx:alpine
    name: web-server
    volumeMounts:
    - name: html
      mountPath: /usr/share/nginx/html
      readOnly: true
    ports:
    - containerPort: 80
      protocol: TCP

