{{- range .Values.htj.module }}
apiVersion: apps/v1
kind: Deployment
metadata:
  labels:
    app: {{ .name }}-deployment
  name: {{ .name }}-deployment
  namespace: {{ $.Release.Namespace }}
spec:
  replicas: 1
  selector:
    matchLabels:
      app: {{ .name }}-deployment
  strategy:
    rollingUpdate:
      maxSurge: 25%
      maxUnavailable: 25%
    type: RollingUpdate
  template:
    metadata:
      labels:
        app: {{ .name }}-deployment
    spec:
      containers:
        - env:
            - name: PARAMS
              value: {{ $.Values.PARAMS }}
          image: "{{- $.Values.registry}}/{{ .name }}:{{ .version }}"
          imagePullPolicy: IfNotPresent
          name: {{ .name }}
          resources:
            limits:
              cpu: "4"
              memory: 8Gi
            requests:
              cpu: "2"
              memory: 4Gi
      dnsPolicy: ClusterFirst
      nodeSelector:
        dz-app: qrcode
      restartPolicy: Always
      schedulerName: default-scheduler
---
{{- end }}