apiVersion: v1
kind: Pod
metadata:
  name: prod-lottery-app
  labels:
    app: lottery-app
    environment: production
    app.kubernetes.io/name: lottery-app
    app.kubernetes.io/version: "1.0.0"
    app.kubernetes.io/component: webapp
spec:
  containers:
  - name: lottery-websvc
    image: nginx:stable
    ports:
    - containerPort: 80
    volumeMounts:
    - name: html-content
      mountPath: /usr/share/nginx/html
  - name: lottery-generator
    image: alpine:latest
    volumeMounts:
    - name: html-content
      mountPath: /html
    command: ["/bin/sh", "-c"]
    args:
      - while true; do
          echo "<html><head><title>Lottery</title></head><body><h1>Tonight's lottery number</h1><p>"`od -vAn -N2 -tu2 < /dev/urandom`"</p></body></html>" > /html/index.html;
          sleep 15;
        done
  volumes:
  - name: html-content
    emptyDir: {}
