apiVersion: v1
kind: Pod
metadata:
  name: fortune-pod
  labels:
   name: fortune-pod
spec:
  containers:
  - image: centos:7
    name: html-generator
    stdin: true
    tty: true 
    command: ["/bin/bash", "-c"]
    args: 
      - yum install epel-release -y;
        yum install fortune-mod -y;
        while true; do fortune > /html/index.html; sleep 5; done;
    volumeMounts:
    - name: html-volume
      mountPath: /html
  - image: nginx
    name: nginx
    volumeMounts:
    - name: html-volume
      mountPath: /usr/share/nginx/html
      readOnly: true
    ports:
    - containerPort: 80
      name: http
      protocol: TCP
  volumes:
  - name: html-volume
    emptyDir: {}

