---
apiVersion: apps/v1
kind: Deployment
metadata:
  name: volumedemo2
  namespace: workshop-ns
spec:
  selector:
    matchLabels:
      app: volumedemo2
      tier: backend
      track: stable
  replicas: 1
  template:
    metadata:
      labels:
        app: volumedemo2
        tier: backend
        track: stable
    spec:
      containers:
        - name: verbose-demo-app
          image: castocolina/demo-app-logs
          imagePullPolicy: Always
          resources: {}
          env:
          - name: LOGS_FOLDER
            value: /var/log
          - name: FILE_NAME
            value: output.log
          - name: FILE_MAX_SIZE_BYTES
            value: "2048"
          - name: MAX_FILES
            value: "1000"
          - name: TAILABLE
            value: "true"
          volumeMounts:
            - name: varlog-pvc
              mountPath: /var/log
        - name: nginx
          image: nginx
          resources: {}
          ports:
            - containerPort: 80
          volumeMounts:
            - name: varlog-pvc
              mountPath: /var/log/program
              readOnly: true
            - name: nginx-conf
              subPath: nginx-logs.conf
              mountPath: /etc/nginx/conf.d/default.conf
      volumes:
        - name: varlog
          emptyDir: {}
        - name: varlog-pvc
          persistentVolumeClaim:
            claimName: volume2-pvc-storage
        - name: node-app
          configMap:
            name: node-app-from-files
        - name: nginx-conf
          configMap:
            name: nginx-config
            items:
              - key: nginx-logs.conf
                path: nginx-logs.conf
...
