apiVersion: apps/v1
kind: Deployment
metadata:
  name: nginx-fortune-dep
spec:
  selector:
    matchLabels:
      app: nginx-fortune
  template:
    metadata:
      labels:
        app: nginx-fortune
    spec:
        containers:
        - name: fortune-html-producer
          image: sorididim11/fortune:1.0
          imagePullPolicy: Always
          env:
            - name: INTERVAL
              value: "5"            # 숫자는 따옴표로 해야함
          command: ["/bin/fortune.sh"]
          args: ["2"]
          volumeMounts:
            - name: html
              mountPath: /var/htdocs
        - name: nginx-html-comsumer
          image: nginx
          volumeMounts:
            - name: html
              mountPath: /usr/share/nginx/html
              readOnly: true
          ports:
            - containerPort: 80
              protocol: TCP
        volumes:
          - name: html
            emptyDir: {}