apiVersion: apps/v1 kind: Deployment metadata: name: {{ include "n8n.fullname" . }}-worker labels: {{- include "n8n.labels" . | nindent 4 }} annotations: checksum/config: {{ include (print $.Template.BasePath "/configmap.yaml") . | sha256sum }} checksum/secret: {{ include (print $.Template.BasePath "/secrets.yaml") . | sha256sum }} spec: {{- if not .Values.worker.autoscaling.enabled }} replicas: {{ .Values.worker.replicaCount }} {{- end }} selector: matchLabels: {{- include "n8n.selectorLabels" . | nindent 6 }} template: metadata: {{- with .Values.worker.podAnnotations }} annotations: {{- toYaml . | nindent 8 }} {{- end }} labels: {{- include "n8n.selectorLabels" . | nindent 8 }} spec: {{- with .Values.worker.image.pullSecrets }} imagePullSecrets: {{- toYaml . | nindent 8 }} {{- end }} securityContext: {{- toYaml .Values.worker.podSecurityContext | nindent 8 }} containers: - name: {{ .Chart.Name }} securityContext: {{- toYaml .Values.worker.securityContext | nindent 12 }} image: "{{ .Values.worker.image.registry }}/{{ .Values.worker.image.repository }}:{{ .Values.worker.image.tag | default .Chart.AppVersion }}" imagePullPolicy: {{ .Values.worker.image.pullPolicy }} command: - n8n - worker envFrom: - configMapRef: name: {{ include "n8n.fullname" . }} {{- if .Values.worker.extraEnvVarsSecret }} - secretRef: name: {{ .Values.worker.extraEnvVarsSecret }} {{- else }} - secretRef: name: {{ include "n8n.fullname" . }} {{- end }} resources: {{- toYaml .Values.worker.resources | nindent 12 }} {{- with .Values.worker.nodeSelector }} nodeSelector: {{- toYaml . | nindent 8 }} {{- end }} {{- with .Values.worker.affinity }} affinity: {{- toYaml . | nindent 8 }} {{- end }} {{- with .Values.worker.tolerations }} tolerations: {{- toYaml . | nindent 8 }} {{- end }}