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

  containers:
  - image: georgebaptista/fortune:env
    name: html-generator
    envFrom:
    - prefix: CONFIG_
      configMapRef:
        name: fortune-config # configmap name
    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

