apiVersion: apps/v1 kind: Deployment metadata: name: {{ include "label-studio.fullname" . }} labels: {{- include "label-studio.labels" . | nindent 4 }} spec: {{- if not .Values.autoscaling.enabled }} replicas: {{ .Values.replicaCount }} {{- end }} selector: matchLabels: {{- include "label-studio.selectorLabels" . | nindent 6 }} template: metadata: {{- with .Values.podAnnotations }} annotations: {{- toYaml . | nindent 8 }} {{- end }} labels: {{- include "label-studio.labels" . | nindent 8 }} {{- with .Values.podLabels }} {{- toYaml . | nindent 8 }} {{- end }} spec: {{- with .Values.imagePullSecrets }} imagePullSecrets: {{- toYaml . | nindent 8 }} {{- end }} serviceAccountName: {{ include "label-studio.serviceAccountName" . }} {{- with .Values.podSecurityContext }} securityContext: {{- toYaml . | nindent 8 }} {{- end }} containers: - name: {{ .Chart.Name }} {{- with .Values.securityContext }} securityContext: {{- toYaml . | nindent 12 }} {{- end }} image: "{{ .Values.image.repository }}:{{ .Values.image.tag | default .Chart.AppVersion }}" imagePullPolicy: {{ .Values.image.pullPolicy }} ports: - name: http containerPort: {{ .Values.service.targetPort | default 8080 }} protocol: TCP env: {{- range $key, $value := .Values.env }} - name: {{ $key }} value: {{ $value | quote }} {{- end }} {{- if .Values.global.pgConfig.host }} - name: POSTGRE_HOST value: {{ .Values.global.pgConfig.host | quote }} - name: POSTGRE_PORT value: {{ .Values.global.pgConfig.port | quote }} - name: POSTGRE_NAME value: {{ .Values.global.pgConfig.dbName | quote }} - name: POSTGRE_USER value: {{ .Values.global.pgConfig.userName | quote }} {{- if .Values.global.pgConfig.password.secretName }} - name: POSTGRE_PASSWORD valueFrom: secretKeyRef: name: {{ .Values.global.pgConfig.password.secretName }} key: {{ .Values.global.pgConfig.password.secretKey }} {{- end }} {{- end }} {{- if .Values.global.redisConfig.host }} - name: REDIS_LOCATION value: {{ .Values.global.redisConfig.host | quote }} {{- if .Values.global.redisConfig.password.secretName }} - name: REDIS_PASSWORD valueFrom: secretKeyRef: name: {{ .Values.global.redisConfig.password.secretName }} key: {{ .Values.global.redisConfig.password.secretKey }} {{- end }} {{- end }} {{- range $key, $value := .Values.global.extraEnvironmentVars }} - name: {{ $key }} value: {{ $value | quote }} {{- end }} {{- range $key, $value := .Values.global.extraEnvironmentSecrets }} - name: {{ $key }} valueFrom: secretKeyRef: name: {{ $value.secretName }} key: {{ $value.secretKey }} {{- end }} {{- with .Values.livenessProbe }} livenessProbe: {{- toYaml . | nindent 12 }} {{- end }} {{- with .Values.readinessProbe }} readinessProbe: {{- toYaml . | nindent 12 }} {{- end }} {{- with .Values.resources }} resources: {{- toYaml . | nindent 12 }} {{- end }} {{- with .Values.volumeMounts }} volumeMounts: {{- toYaml . | nindent 12 }} {{- end }} {{- with .Values.volumes }} volumes: {{- toYaml . | nindent 8 }} {{- end }} {{- with .Values.nodeSelector }} nodeSelector: {{- toYaml . | nindent 8 }} {{- end }} {{- with .Values.affinity }} affinity: {{- toYaml . | nindent 8 }} {{- end }} {{- with .Values.tolerations }} tolerations: {{- toYaml . | nindent 8 }} {{- end }}