kind: Deployment
apiVersion: apps/v1
metadata:
  name: {{ .Values.deploymentName }}
  labels:
    app: {{ .Values.deploymentName }}
spec:
  replicas: 1
  revisionHistoryLimit: 2
  selector:
    matchLabels:
      app:  {{ .Values.deploymentName }}
  strategy:
    type: {{ .Values.updateStrategy.type }}
  template:
    metadata:
      labels:
        app: {{ .Values.deploymentName }}
    spec:
      containers:
      - name: {{ .Values.deploymentName }}
        image: "{{ .Values.image.repository }}:{{ .Values.image.tag }}"
        imagePullPolicy: IfNotPresent
        env:
        - name: DEPLOYMENT_NAME
          value: {{ .Values.deploymentName }}
        envFrom:
        - configMapRef:
            name: {{ .Values.configMap.name }}
      {{- if .Values.tolerations }}
      {{- with .Values.tolerations }}
      tolerations:
        {{- toYaml . | nindent 8 }}
      {{- end }}
      {{- end }}
      {{- if .Values.nodeSelector }}
      nodeSelector:
        {{ toYaml .Values.nodeSelector }}
      {{- end }}
      serviceAccountName: {{ .Values.serviceAccount.name }}
      priorityClassName: {{ .Values.priorityClassName }}
