apiVersion: v1
kind: Pod
metadata:
  name: fortune-kubek
spec:
  containers:
  - image: jagin/fortune
    env:
    - name: INTERVAL
      valueFrom: 
        configMapKeyRef:
          name: fortune-config
          key: sleep-interval
    - name: FORTUNE_LENGTH
      valueFrom: 
        configMapKeyRef:
          name: fortune-config
          key: fortune-length
    args: ["-n", "$(FORTUNE_LENGTH)", "-o"]        
    name: fortune
    volumeMounts:
    - name: public
      mountPath: /var/fortune
  - image: jagin/kubek
    name: kubek
    volumeMounts:
    - name: public
      mountPath: /app/public
      readOnly: true
    ports:
    - containerPort: 8000
  volumes:
  - name: public
    emptyDir: {}

