improwised-charts/charts/n8n-helm/templates/deployment.yaml

87 lines
3.1 KiB
YAML

apiVersion: apps/v1
kind: Deployment
metadata:
name: {{ template "n8n-helm.fullname" . }}-deployment
labels:
{{- include "n8n-helm.common.labels.standard" . | nindent 4 }}
app: {{ template "n8n-helm.fullname" . }}
spec:
replicas: {{ default "1" .Values.replicaCount }}
selector:
matchLabels: {{- include "n8n-helm.common.labels.matchLabels" . | nindent 6 }}
app: {{ template "n8n-helm.fullname" . }}
template:
metadata:
labels:
{{- include "n8n-helm.common.labels.standard" . | nindent 8 }}
app: {{ template "n8n-helm.fullname" . }}
annotations:
{{- if .Values.commonannotations }}
{{- range $key, $value := .Values.commonannotations }}
{{ $key }}: {{ $value | quote }}
{{- end }}
{{- end }}
spec:
{{- if .Values.schedulerName }}
schedulerName: "{{ .Values.schedulerName }}"
{{- end }}
{{- if .Values.nodeSelector }}
nodeSelector: {{- toYaml .Values.nodeSelector | nindent 8 }}
{{- end }}
{{- if .Values.affinity }}
affinity: {{- toYaml .Values.affinity | nindent 8 }}
{{- end }}
{{- if .Values.tolerations }}
tolerations: {{- toYaml .Values.tolerations | nindent 8 }}
{{- end }}
restartPolicy: {{ .Values.image.restartPolicy }}
containers:
- name: {{ template "n8n-helm.fullname" . }}
image: "{{ .Values.image.repository }}:{{ .Values.image.tag | default .Chart.AppVersion }}"
imagePullPolicy: {{ .Values.image.pullPolicy }}
{{- if .Values.resources }}
resources: {{- toYaml .Values.resources | nindent 12 }}
{{- end }}
{{- if or .Values.livenessProbe .Values.readinessProbe }}
ports:
- name: http
containerPort: 5678
{{- end }}
{{- if .Values.livenessProbe }}
livenessProbe: {{- toYaml .Values.livenessProbe | nindent 12 }}
{{- end }}
{{- if .Values.readinessProbe }}
readinessProbe: {{- toYaml .Values.readinessProbe | nindent 12 }}
{{- end }}
command: ["/bin/sh"]
args: ["-c", "sleep 20; n8n start"]
env:
{{- if .Values.auth.enable }}
- name: N8N_BASIC_AUTH_PASSWORD
valueFrom:
secretKeyRef:
name: {{ template "n8n-helm.secretName" . }}
key: n8nAuthPass
{{- end }}
{{- if .Values.postgresql.enabled }}
- name: DB_POSTGRESDB_PASSWORD
valueFrom:
secretKeyRef:
name: {{ template "n8n-helm.secretName" . }}
key: postgresqlDbPass
{{- end }}
envFrom:
- configMapRef:
name: {{ template "n8n-helm.fullname" . }}-config
ports:
- name: {{ template "n8n-helm.fullname" . }}
containerPort: {{ .Values.service.port }}
{{- if .Values.persistence.enabled }}
volumeMounts:
- name: {{ include "n8n-helm.fullname" . }}-data
mountPath: /root/.n8n
volumes:
- name: {{ include "n8n-helm.fullname" . }}-data
persistentVolumeClaim:
claimName: {{ include "n8n-helm.fullname" . }}-data
{{- end }}