apiVersion: apps/v1
kind: Deployment
metadata:
  name: nginx
spec:
  replicas: 3
  selector:
    matchLabels:
      app: nginx
  template:
    metadata:
      labels:
        app: nginx
    spec:
      containers:
        - name: nginx
          image: hwchiu/cicd-app:latest
          ports:
            - containerPort: 80
          imagePullPolicy: Always
          livenessProbe:
            httpGet:
              path: /
              port: 80
            initialDelaySeconds: 3
            periodSeconds: 3
          env:
            - name: PREFIX
              value: ch1
          volumeMounts:
            - name: index2-html
              mountPath: /var/www/html/test/
      volumes:
        - name: index2-html
          configMap:
            name: index2
