apiVersion: apps/v1
kind: Deployment
metadata:
  name: nginx
  labels:
    app: nginx
spec:
  selector:
    matchLabels:
      app: nginx
  strategy:
    type: RollingUpdate
    rollingUpdate:
      maxUnavailable: 0
      maxSurge: 1
  template:
    metadata:
      labels:
        app: nginx
    spec:
      containers:
      - name: nginx
        image: nginx:1.21.3-alpine
        ports:
        - containerPort: 80
        volumeMounts:
        - mountPath: /etc/nginx
          readOnly: true
          name: nginx-config
        livenessProbe:
          httpGet:
            port: 80
            path: /healthz
          initialDelaySeconds: 10
          periodSeconds: 5
        readinessProbe:
          httpGet:
            port: 80
            path: /healthz
          initialDelaySeconds: 10
          periodSeconds: 5
      volumes:
      - name: nginx-config
        configMap:
          name: nginx-config
