{{- if .Values.gitHook.enabled -}} apiVersion: apps/v1 kind: Deployment metadata: name: {{ include "c-----code.fullname" . }}-git-hook namespace: {{ include "c-----code.namespace" . }} labels: app.kubernetes.io/name: {{ include "c-----code.fullname" . }}-git-hook app.kubernetes.io/instance: {{ .Release.Name }} app.kubernetes.io/version: {{ .Chart.AppVersion }} spec: replicas: {{ .Values.gitHook.replicaCount | default 2 }} selector: matchLabels: app.kubernetes.io/name: {{ include "c-----code.fullname" . }}-git-hook app.kubernetes.io/instance: {{ .Release.Name }} template: metadata: labels: app.kubernetes.io/name: {{ include "c-----code.fullname" . }}-git-hook app.kubernetes.io/instance: {{ .Release.Name }} spec: containers: - name: git-hook image: "{{ .Values.image.registry }}/{{ .Values.gitHook.image.repository }}:{{ .Values.gitHook.image.tag }}" imagePullPolicy: {{ .Values.gitHook.image.pullPolicy | default .Values.image.pullPolicy }} env: - name: APP_DATABASE_URL valueFrom: secretKeyRef: name: {{ .Values.database.existingSecret | default (printf "%s-secrets" (include "c-----code.fullname" .)) }} key: {{ .Values.database.secretKeys.url }} optional: true - name: APP_REDIS_URL valueFrom: secretKeyRef: name: {{ .Values.redis.existingSecret | default (printf "%s-secrets" (include "c-----code.fullname" .)) }} key: {{ .Values.redis.secretKeys.url }} optional: true {{- if .Values.nats.enabled }} - name: HOOK_POOL_REDIS_LIST_PREFIX value: "{hook}" - name: HOOK_POOL_REDIS_LOG_CHANNEL value: "hook:logs" {{- end }} {{- range .Values.gitHook.env }} - name: {{ .name }} value: {{ .value | quote }} {{- end }} resources: {{- toYaml .Values.gitHook.resources | nindent 10 }} {{- with .Values.gitHook.nodeSelector }} nodeSelector: {{- toYaml . | nindent 8 }} {{- end }} {{- with .Values.gitHook.affinity }} affinity: {{- toYaml . | nindent 8 }} {{- end }} {{- with .Values.gitHook.tolerations }} tolerations: {{- toYaml . | nindent 8 }} {{- end }} {{- end }}