apiVersion: apps/v1
kind: Deployment
metadata:
  labels:
    app: qrcode-web
  name: {{ .Values.web.name }}-deployment
  namespace: dz-qrcode-web
spec:
  progressDeadlineSeconds: 600
  replicas: 1
  revisionHistoryLimit: 10
  selector:
    matchLabels:
      app: {{ .Values.web.name }}-deployment
  template:
    metadata:
      labels:
        app: {{ .Values.web.name }}-deployment
    spec:
      containers:
        - image: "{{ .Values.registry }}/{{ .Values.web.name }}:{{ .Values.web.version }}"
          imagePullPolicy: IfNotPresent
          name: {{ .Values.web.name }}-deployment
          ports:
            - containerPort: 80
              name: web
              protocol: TCP
          resources:
            limits:
              cpu: "4"
              memory: 8Gi
            requests:
              cpu: "1"
              memory: 512Mi
          volumeMounts:
            - mountPath: /etc/nginx/conf.d
              name: nginx-conf
      dnsPolicy: ClusterFirst
      nodeSelector:
        dz-app: qrcode
      restartPolicy: Always
      volumes:
        - configMap:
            defaultMode: 420
            name: web-config-map
          name: nginx-conf