apiVersion: apps/v1 kind: Deployment metadata: name: {{ include "squidex.fullname" . }}-worker labels: {{- include "squidex.labels" . | indent 4 }} app.kubernetes.io/role: worker spec: replicas: 1 revisionHistoryLimit: {{ .Values.deployment.revisionHistoryLimit }} strategy: rollingUpdate: maxSurge: 0 maxUnavailable: 1 type: RollingUpdate selector: matchLabels: {{- include "squidex.selectors" . | indent 6 }} app.kubernetes.io/role: worker template: metadata: labels: {{- include "squidex.selectors" . | indent 8 }} app.kubernetes.io/role: worker {{- if .Values.deployment.annotations }} annotations: {{- toYaml .Values.deployment.annotations | nindent 8 }} {{- end }} spec: {{- with .Values.imagePullSecrets }} imagePullSecrets: {{- toYaml . | nindent 8 }} {{- end }} {{- if .Values.runAsNonRoot }} securityContext: {{- toYaml .Values.podSecurityContext | nindent 8 }} {{- end }} restartPolicy: {{ .Values.deployment.restartPolicy }} containers: - name: {{ .Chart.Name }} image: "{{ .Values.image.repository }}:{{ default .Chart.AppVersion .Values.image.tag }}" imagePullPolicy: {{ .Values.image.pullPolicy }} {{- if .Values.runAsNonRoot }} securityContext: {{- toYaml .Values.containerSecurityContext | nindent 12 }} {{- end }} {{- if .Values.deployment.command }} command: {{- toYaml .Values.deployment.command | nindent 12 }} {{- end }} {{- if .Values.deployment.args }} args: {{- toYaml .Values.deployment.args | nindent 12 }} {{- end }} ports: - name: http containerPort: 8080 protocol: TCP livenessProbe: httpGet: path: /healthz port: http initialDelaySeconds: 300 readinessProbe: httpGet: path: /readiness port: http resources: {{- toYaml .Values.resources | nindent 12 }} env: {{- range $key, $val := .Values.env }} {{- if (eq $key "URLS__BASEURL") }} - name: {{ $key | quote }} value: {{ required (printf "The value .Values.env.%s is required" $key) $val | quote }} {{- else }} - name: {{ $key | quote }} value: {{ $val | quote }} {{- end }} {{- end }} - name: CLUSTERING__WORKER value: "true" {{- if (.Values.mongodb.enabled) }} {{- $mongoDefaultConnectionString := printf "mongodb://%s" (include "squidex.mongoDefaultHostname" .) }} {{- if (not .Values.env.EVENTSTORE__MONGODB__CONFIGURATION) }} - name: "EVENTSTORE__MONGODB__CONFIGURATION" value: {{ $mongoDefaultConnectionString | quote }} {{- end }} {{- if (not .Values.env.STORE__MONGODB__CONFIGURATION) }} - name: "STORE__MONGODB__CONFIGURATION" value: {{ $mongoDefaultConnectionString | quote }} {{- end }} {{- if (not .Values.env.ASSETSTORE__MONGODB__CONFIGURATION) }} - name: "ASSETSTORE__MONGODB__CONFIGURATION" value: {{ $mongoDefaultConnectionString | quote }} {{- end }} {{- end }} {{- if .Values.extraConfigMaps | or .Values.extraSecrets }} envFrom: {{- range $configMap := .Values.extraConfigMaps }} - configMapRef: name: {{ $configMap }} {{- end }} {{- range $secret := .Values.extraSecrets }} - secretRef: name: {{ $secret }} {{- end }} {{- end }} {{- if .Values.extraVolumeMounts }} volumeMounts: {{- toYaml .Values.extraVolumeMounts | nindent 12 }} {{- end }} {{- if .Values.extraVolumes }} volumes: {{- toYaml .Values.extraVolumes | nindent 8 }} {{- end }} nodeSelector: {{- toYaml .Values.nodeSelector | nindent 8 }} affinity: {{- toYaml .Values.affinity | nindent 8 }} tolerations: {{- toYaml .Values.tolerations | nindent 8 }} {{- if (.Values.deployment.serviceAccountName) }} serviceAccountName: {{ .Values.deployment.serviceAccountName}} {{- end }}