{{- if gt (int .Values.server.workers) 0 }} apiVersion: apps/v1 kind: Deployment metadata: name: {{ template "trino.worker" . }} labels: app: {{ template "trino.name" . }} chart: {{ template "trino.chart" . }} release: {{ .Release.Name }} heritage: {{ .Release.Service }} component: worker spec: replicas: {{ .Values.server.workers }} selector: matchLabels: app: {{ template "trino.name" . }} release: {{ .Release.Name }} component: worker template: metadata: labels: app: {{ template "trino.name" . }} release: {{ .Release.Name }} component: worker spec: serviceAccountName: {{ include "trino.serviceAccountName" . }} volumes: - name: config-volume configMap: name: {{ template "trino.worker" . }} - name: catalog-volume configMap: name: {{ template "trino.catalog" . }} - name: schemas-volume configMap: name: schemas-volume-worker {{- if .Values.initContainers.worker }} initContainers: {{- tpl (toYaml .Values.initContainers.worker) . | nindent 6 }} {{- end }} imagePullSecrets: {{- toYaml .Values.imagePullSecrets | nindent 8 }} terminationGracePeriodSeconds: {{ .Values.terminationGracePeriodSeconds }} containers: - name: {{ .Chart.Name }}-worker image: "{{ .Values.image.repository }}:{{ .Values.image.tag | default .Chart.AppVersion }}" imagePullPolicy: {{ .Values.image.pullPolicy }} env: {{- toYaml .Values.env | nindent 12 }} volumeMounts: - mountPath: {{ .Values.server.config.path }} name: config-volume - mountPath: {{ .Values.server.config.path }}/catalog name: catalog-volume - mountPath: {{ .Values.kafka.mountPath }} name: schemas-volume ports: - name: http containerPort: {{ .Values.service.port }} protocol: TCP livenessProbe: httpGet: path: /v1/info port: http initialDelaySeconds: {{ .Values.worker.livenessProbe.initialDelaySeconds | default 20 }} periodSeconds: {{ .Values.worker.livenessProbe.periodSeconds | default 10 }} timeoutSeconds: {{ .Values.worker.livenessProbe.timeoutSeconds | default 5 }} failureThreshold: {{ .Values.worker.livenessProbe.failureThreshold | default 6 }} successThreshold: {{ .Values.worker.livenessProbe.successThreshold | default 1 }} readinessProbe: httpGet: path: /v1/info port: http initialDelaySeconds: {{ .Values.worker.readinessProbe.initialDelaySeconds | default 20 }} periodSeconds: {{ .Values.worker.readinessProbe.periodSeconds | default 10 }} timeoutSeconds: {{ .Values.worker.readinessProbe.timeoutSeconds | default 5 }} failureThreshold: {{ .Values.worker.readinessProbe.failureThreshold | default 6 }} successThreshold: {{ .Values.worker.readinessProbe.successThreshold | default 1 }} resources: {{- toYaml .Values.worker.resources | nindent 12 }} {{- with .Values.nodeSelector }} nodeSelector: {{- toYaml . | nindent 8 }} {{- end }} {{- with .Values.affinityWorker }} affinity: {{- toYaml . | nindent 8 }} {{- end }} {{- with .Values.tolerationsWorker }} tolerations: {{- toYaml . | nindent 8 }} {{- end }} {{- end }}