apiVersion: apps/v1
kind: Deployment
metadata:
  name: {{ "{{ include \"" }}{{ project_name }}{{ ".fullname\" . }}" }}
  labels:
    {{ "{{- include \"" }}{{ project_name }}{{ ".labels\" . | nindent 4 }}" }}
spec:
  replicas: {{ "{{ .Values.replicaCount }}" }}
  selector:
    matchLabels:
      {{ "{{- include \"" }}{{ project_name }}{{ ".selectorLabels\" . | nindent 6 }}" }}
  template:
    metadata:
      labels:
        {{ "{{- include \"" }}{{ project_name }}{{ ".selectorLabels\" . | nindent 8 }}" }}
    spec:
      containers:
        - name: {{ "{{ .Chart.Name }}" }}
          image: "{{ "{{ .Values.image.repository }}:{{ .Values.image.tag }}" }}"
          imagePullPolicy: {{ "{{ .Values.image.pullPolicy }}" }}
          ports:
            - name: http
              containerPort: {{ "{{ .Values.service.port }}" }}
              protocol: TCP
          livenessProbe:
            httpGet:
              path: /healthz
              port: http
          readinessProbe:
            httpGet:
              path: /healthz
              port: http
          resources:
            {{ "{{- toYaml .Values.resources | nindent 12 }}" }}
          envFrom:
            - configMapRef:
                name: {{ "{{ include \"" }}{{ project_name }}{{ ".fullname\" . }}" }}-config
            - secretRef:
                name: {{ "{{ include \"" }}{{ project_name }}{{ ".fullname\" . }}" }}-secret
