apiVersion: v1
kind: Pod
metadata:
  name: fortune
  namespace: chp06-set621
  labels:
    app: fortune
    env: development
spec:
  # single emptyDir volume mounted in the two containers
  volumes:
  # must match spec.containers[].volumeMounts.name
  - name: html
    # create volume on disk of the worker node hosting the pod
    emptyDir: {}
  containers:
  # first container
  - image: georgebaptista/fortune
    name: html-generator
    # html volume mounted at /var/htdocs in the container
    volumeMounts:
    - name: html
      mountPath: /var/htdocs
  # second container
  - image: nginx:alpine
    name: web-server
    volumeMounts:
    - name: html
      mountPath: /usr/share/nginx/html
      readOnly: true
    ports:
    - containerPort: 80
      protocol: TCP
