asd
This commit is contained in:
@@ -15,7 +15,7 @@ type: application
|
|||||||
# This is the chart version. This version number should be incremented each time you make changes
|
# This is the chart version. This version number should be incremented each time you make changes
|
||||||
# to the chart and its templates, including the app version.
|
# to the chart and its templates, including the app version.
|
||||||
# Versions are expected to follow Semantic Versioning (https://semver.org/)
|
# Versions are expected to follow Semantic Versioning (https://semver.org/)
|
||||||
version: 1.1
|
version: 1.2
|
||||||
|
|
||||||
# This is the version number of the application being deployed. This version number should be
|
# This is the version number of the application being deployed. This version number should be
|
||||||
# incremented each time you make changes to the application. Versions are not expected to
|
# incremented each time you make changes to the application. Versions are not expected to
|
||||||
|
|||||||
Binary file not shown.
BIN
label-studio/label-studio-1.2.tgz
Normal file
BIN
label-studio/label-studio-1.2.tgz
Normal file
Binary file not shown.
@@ -1,78 +1,371 @@
|
|||||||
apiVersion: apps/v1
|
apiVersion: apps/v1
|
||||||
kind: Deployment
|
kind: Deployment
|
||||||
metadata:
|
metadata:
|
||||||
name: {{ include "label-studio.fullname" . }}
|
name: {{ include "ls-app.fullname" . }}
|
||||||
|
{{- with .Values.app.deploymentAnnotations }}
|
||||||
|
annotations:
|
||||||
|
{{- toYaml . | nindent 4 }}
|
||||||
|
{{- end }}
|
||||||
labels:
|
labels:
|
||||||
{{- include "label-studio.labels" . | nindent 4 }}
|
{{- include "ls-app.labels" . | nindent 4 }}
|
||||||
|
{{- if .Values.app.labels }}
|
||||||
|
{{- toYaml .Values.app.labels | nindent 4 }}
|
||||||
|
{{- end }}
|
||||||
spec:
|
spec:
|
||||||
{{- if not .Values.autoscaling.enabled }}
|
{{- if ne .Values.app.replicas nil }}
|
||||||
replicas: {{ .Values.replicaCount }}
|
replicas: {{ .Values.app.replicas }}
|
||||||
{{- end }}
|
{{- end }}
|
||||||
selector:
|
selector:
|
||||||
matchLabels:
|
matchLabels:
|
||||||
{{- include "label-studio.selectorLabels" . | nindent 6 }}
|
{{- include "ls-app.selectorLabels" . | nindent 6 }}
|
||||||
|
{{- with .Values.app.deploymentStrategy }}
|
||||||
|
strategy:
|
||||||
|
{{- toYaml . | trim | nindent 4 }}
|
||||||
|
{{- end }}
|
||||||
template:
|
template:
|
||||||
metadata:
|
metadata:
|
||||||
{{- with .Values.podAnnotations }}
|
{{- with .Values.app.annotations }}
|
||||||
annotations:
|
annotations:
|
||||||
{{- toYaml . | nindent 8 }}
|
{{- toYaml . | nindent 12 }}
|
||||||
{{- end }}
|
{{- end }}
|
||||||
labels:
|
labels:
|
||||||
{{- include "label-studio.labels" . | nindent 8 }}
|
{{- include "ls-app.selectorLabels" . | nindent 8 }}
|
||||||
{{- with .Values.podLabels }}
|
{{- if .Values.app.podLabels }}
|
||||||
{{- toYaml . | nindent 8 }}
|
{{- toYaml .Values.app.podLabels | nindent 8 }}
|
||||||
{{- end }}
|
{{- end }}
|
||||||
spec:
|
spec:
|
||||||
{{- with .Values.imagePullSecrets }}
|
{{- with .Values.global.imagePullSecrets }}
|
||||||
imagePullSecrets:
|
imagePullSecrets:
|
||||||
{{- toYaml . | nindent 8 }}
|
{{- toYaml . | nindent 8 }}
|
||||||
{{- end }}
|
{{- end }}
|
||||||
serviceAccountName: {{ include "label-studio.serviceAccountName" . }}
|
serviceAccountName: {{ include "ls-app.serviceAccountName" . }}
|
||||||
{{- with .Values.podSecurityContext }}
|
{{- if .Values.app.podSecurityContext.enabled }}
|
||||||
securityContext:
|
securityContext: {{- omit .Values.app.podSecurityContext "enabled" | toYaml | nindent 8 }}
|
||||||
{{- toYaml . | nindent 8 }}
|
|
||||||
{{- end }}
|
{{- end }}
|
||||||
containers:
|
automountServiceAccountToken: {{ .Values.app.automountServiceAccountToken }}
|
||||||
- name: {{ .Chart.Name }}
|
initContainers:
|
||||||
{{- with .Values.securityContext }}
|
{{- if .Values.app.initContainers }}
|
||||||
securityContext:
|
{{- range .Values.app.initContainers }}
|
||||||
{{- toYaml . | nindent 12 }}
|
- name: {{ .name }}
|
||||||
|
image: {{ or .image (printf "%s/%s:%s" ($.Values.global.image.registry | default "docker.io") $.Values.global.image.repository $.Values.global.image.tag) ($.Chart.AppVersion) }}
|
||||||
|
args: {{- range .args }}
|
||||||
|
- {{ . }}
|
||||||
{{- end }}
|
{{- end }}
|
||||||
image: "{{ .Values.image.repository }}:{{ .Values.image.tag | default .Chart.AppVersion }}"
|
imagePullPolicy: {{ or .pullPolicy $.Values.global.image.pullPolicy }}
|
||||||
imagePullPolicy: {{ .Values.image.pullPolicy }}
|
{{- if .restartPolicy }}
|
||||||
ports:
|
restartPolicy: {{ .restartPolicy }}
|
||||||
- name: http
|
|
||||||
containerPort: {{ .Values.service.port }}
|
|
||||||
protocol: TCP
|
|
||||||
{{- with .Values.livenessProbe }}
|
|
||||||
livenessProbe:
|
|
||||||
{{- toYaml . | nindent 12 }}
|
|
||||||
{{- end }}
|
{{- end }}
|
||||||
{{- with .Values.readinessProbe }}
|
{{- if $.Values.app.containerSecurityContext.enabled }}
|
||||||
readinessProbe:
|
securityContext: {{- omit $.Values.app.containerSecurityContext "enabled" | toYaml | nindent 12 }}
|
||||||
{{- toYaml . | nindent 12 }}
|
|
||||||
{{- end }}
|
{{- end }}
|
||||||
{{- with .Values.resources }}
|
env:
|
||||||
resources:
|
{{- include "ls.common.envs" $ | nindent 12 }}
|
||||||
{{- toYaml . | nindent 12 }}
|
- name: INIT_CONTAINER
|
||||||
{{- end }}
|
value: "true"
|
||||||
{{- with .Values.volumeMounts }}
|
|
||||||
volumeMounts:
|
volumeMounts:
|
||||||
{{- toYaml . | nindent 12 }}
|
- name: data
|
||||||
|
mountPath: /label-studio/data
|
||||||
|
- mountPath: /opt/heartex/instance-data/etc
|
||||||
|
name: opt-heartex-init
|
||||||
|
- mountPath: /tmp
|
||||||
|
name: tmp-dir-init
|
||||||
|
{{- if $.Values.global.pgConfig.ssl.pgSslSecretName }}
|
||||||
|
- name: pg-ssl-certs
|
||||||
|
mountPath: /opt/heartex/secrets/pg_certs
|
||||||
{{- end }}
|
{{- end }}
|
||||||
{{- with .Values.volumes }}
|
{{- if $.Values.global.redisConfig.ssl.redisSslSecretName }}
|
||||||
volumes:
|
- name: redis-ssl-certs
|
||||||
{{- toYaml . | nindent 8 }}
|
mountPath: /opt/heartex/secrets/redis_certs
|
||||||
{{- end }}
|
{{- end }}
|
||||||
{{- with .Values.nodeSelector }}
|
{{- if .extraVolumeMounts }}
|
||||||
|
{{ toYaml .extraVolumeMounts | nindent 12 }}
|
||||||
|
{{- end }}
|
||||||
|
{{- end }}
|
||||||
|
{{- end }}
|
||||||
|
{{- if not .Values.migrationJob.enabled }}
|
||||||
|
- name: db-migrations
|
||||||
|
image: "{{ .Values.global.image.registry | default "docker.io" }}/{{ .Values.global.image.repository }}:{{ .Values.global.image.tag | default .Chart.AppVersion }}"
|
||||||
|
args: [ "label-studio-migrate" ]
|
||||||
|
imagePullPolicy: {{ .Values.global.image.pullPolicy }}
|
||||||
|
{{- if .Values.app.containerSecurityContext.enabled }}
|
||||||
|
securityContext: {{- omit .Values.app.containerSecurityContext "enabled" | toYaml | nindent 12 }}
|
||||||
|
{{- end }}
|
||||||
|
resources:
|
||||||
|
{{- toYaml .Values.app.initContainer.resources | nindent 12 }}
|
||||||
|
env:
|
||||||
|
{{- include "ls.common.envs" . | nindent 12 }}
|
||||||
|
- name: INIT_CONTAINER
|
||||||
|
value: "true"
|
||||||
|
volumeMounts:
|
||||||
|
- name: data
|
||||||
|
mountPath: /label-studio/data
|
||||||
|
- mountPath: /opt/heartex/instance-data/etc
|
||||||
|
name: opt-heartex-init
|
||||||
|
- mountPath: /tmp
|
||||||
|
name: tmp-dir-init
|
||||||
|
{{- if .Values.global.pgConfig.ssl.pgSslSecretName }}
|
||||||
|
- name: pg-ssl-certs
|
||||||
|
mountPath: /opt/heartex/secrets/pg_certs
|
||||||
|
{{- end }}
|
||||||
|
{{- if .Values.global.redisConfig.ssl.redisSslSecretName }}
|
||||||
|
- name: redis-ssl-certs
|
||||||
|
mountPath: /opt/heartex/secrets/redis_certs
|
||||||
|
{{- end }}
|
||||||
|
{{- if .Values.app.extraVolumeMounts }}
|
||||||
|
{{ toYaml .Values.app.extraVolumeMounts | nindent 12 }}
|
||||||
|
{{- end }}
|
||||||
|
{{- end }}
|
||||||
|
{{- if .Values.app.postMigrationInitContainers }}
|
||||||
|
{{- range .Values.app.postMigrationInitContainers }}
|
||||||
|
- name: {{ .name }}
|
||||||
|
image: {{ or .image (printf "%s/%s:%s" ($.Values.global.image.registry | default "docker.io") $.Values.global.image.repository $.Values.global.image.tag) ($.Chart.AppVersion) }}
|
||||||
|
args: {{- range .args }}
|
||||||
|
- {{ . }}
|
||||||
|
{{- end }}
|
||||||
|
imagePullPolicy: {{ or .pullPolicy $.Values.global.image.pullPolicy }}
|
||||||
|
{{- if .restartPolicy }}
|
||||||
|
restartPolicy: {{ .restartPolicy }}
|
||||||
|
{{- end }}
|
||||||
|
{{- if $.Values.app.containerSecurityContext.enabled }}
|
||||||
|
securityContext: {{- omit $.Values.app.containerSecurityContext "enabled" | toYaml | nindent 12 }}
|
||||||
|
{{- end }}
|
||||||
|
env:
|
||||||
|
{{- include "ls.common.envs" $ | nindent 12 }}
|
||||||
|
- name: INIT_CONTAINER
|
||||||
|
value: "true"
|
||||||
|
volumeMounts:
|
||||||
|
- name: data
|
||||||
|
mountPath: /label-studio/data
|
||||||
|
- mountPath: /opt/heartex/instance-data/etc
|
||||||
|
name: opt-heartex-init
|
||||||
|
- mountPath: /tmp
|
||||||
|
name: tmp-dir-init
|
||||||
|
{{- if $.Values.global.pgConfig.ssl.pgSslSecretName }}
|
||||||
|
- name: pg-ssl-certs
|
||||||
|
mountPath: /opt/heartex/secrets/pg_certs
|
||||||
|
{{- end }}
|
||||||
|
{{- if $.Values.global.redisConfig.ssl.redisSslSecretName }}
|
||||||
|
- name: redis-ssl-certs
|
||||||
|
mountPath: /opt/heartex/secrets/redis_certs
|
||||||
|
{{- end }}
|
||||||
|
{{- if .extraVolumeMounts }}
|
||||||
|
{{ toYaml .extraVolumeMounts | nindent 12 }}
|
||||||
|
{{- end }}
|
||||||
|
{{- end }}
|
||||||
|
{{- end }}
|
||||||
|
terminationGracePeriodSeconds: {{ .Values.app.terminationGracePeriodSeconds }}
|
||||||
|
containers:
|
||||||
|
- name: app
|
||||||
|
image: "{{ .Values.global.image.registry | default "docker.io" }}/{{ .Values.global.image.repository }}:{{ .Values.global.image.tag | default .Chart.AppVersion }}"
|
||||||
|
imagePullPolicy: {{ .Values.global.image.pullPolicy }}
|
||||||
|
{{- if .Values.app.containerSecurityContext.enabled }}
|
||||||
|
securityContext: {{- omit .Values.app.containerSecurityContext "enabled" | toYaml | nindent 12 }}
|
||||||
|
{{- end }}
|
||||||
|
args: {{- range .Values.app.args }}
|
||||||
|
- {{ . }}
|
||||||
|
{{- end }}
|
||||||
|
env:
|
||||||
|
- name: SKIP_DB_MIGRATIONS
|
||||||
|
value: "true"
|
||||||
|
{{- include "ls.common.envs" . | nindent 12 }}
|
||||||
|
{{- if .Values.app.extraEnvironmentVars -}}
|
||||||
|
{{- range $key, $value := .Values.app.extraEnvironmentVars }}
|
||||||
|
- name: {{ printf "%s" $key | replace "." "_" | upper | quote }}
|
||||||
|
value: {{ $value | quote }}
|
||||||
|
{{- end }}
|
||||||
|
{{- end }}
|
||||||
|
{{- if .Values.app.extraEnvironmentSecrets -}}
|
||||||
|
{{- range $key, $value := .Values.app.extraEnvironmentSecrets }}
|
||||||
|
- name: {{ printf "%s" $key | replace "." "_" | upper | quote }}
|
||||||
|
valueFrom:
|
||||||
|
secretKeyRef:
|
||||||
|
name: {{ $value.secretName }}
|
||||||
|
key: {{ $value.secretKey }}
|
||||||
|
{{- end }}
|
||||||
|
{{- end }}
|
||||||
|
{{- if or $.Values.app.cmdWrapper $.Values.global.cmdWrapper }}
|
||||||
|
- name: CMD_WRAPPER
|
||||||
|
value: {{ coalesce $.Values.app.cmdWrapper $.Values.global.cmdWrapper }}
|
||||||
|
{{- end }}
|
||||||
|
{{- if .Values.app.readinessProbe.enabled }}
|
||||||
|
readinessProbe: {{- include "tplvalues.render" (dict "value" (omit .Values.app.readinessProbe "enabled") "context" $) | nindent 12 }}
|
||||||
|
{{- end }}
|
||||||
|
{{- if .Values.app.livenessProbe.enabled }}
|
||||||
|
livenessProbe: {{- include "tplvalues.render" (dict "value" (omit .Values.app.livenessProbe "enabled") "context" $) | nindent 12 }}
|
||||||
|
{{- end }}
|
||||||
|
lifecycle:
|
||||||
|
preStop:
|
||||||
|
exec:
|
||||||
|
command: [ '/bin/sh', '-c', 'sleep {{ .Values.app.preStopDelaySeconds }}' ]
|
||||||
|
resources:
|
||||||
|
{{- toYaml .Values.app.resources | nindent 12 }}
|
||||||
|
volumeMounts:
|
||||||
|
- name: data
|
||||||
|
mountPath: /label-studio/data
|
||||||
|
{{- if and .Values.global.persistence.enabled (eq .Values.global.persistence.type "gcs") }}
|
||||||
|
{{- if or .Values.global.persistence.config.gcs.applicationCredentialsJSON (and .Values.global.persistence.config.gcs.applicationCredentialsJSONExistingSecret .Values.global.persistence.config.gcs.applicationCredentialsJSONExistingSecretKey) }}
|
||||||
|
- name: gcs-storage-credentials
|
||||||
|
mountPath: /opt/heartex/secrets/gcs
|
||||||
|
readOnly: true
|
||||||
|
{{- end }}
|
||||||
|
{{- end }}
|
||||||
|
{{- if .Values.global.pgConfig.ssl.pgSslSecretName }}
|
||||||
|
- name: pg-ssl-certs
|
||||||
|
mountPath: /opt/heartex/secrets/pg_certs
|
||||||
|
{{- end }}
|
||||||
|
{{- if .Values.global.redisConfig.ssl.redisSslSecretName }}
|
||||||
|
- name: redis-ssl-certs
|
||||||
|
mountPath: /opt/heartex/secrets/redis_certs
|
||||||
|
{{- end }}
|
||||||
|
{{- if .Values.app.extraVolumeMounts }}
|
||||||
|
{{ toYaml .Values.app.extraVolumeMounts | nindent 12 }}
|
||||||
|
{{- end }}
|
||||||
|
- mountPath: /opt/heartex/instance-data/etc
|
||||||
|
name: opt-heartex-app
|
||||||
|
- mountPath: /tmp
|
||||||
|
name: tmp-dir-app
|
||||||
|
{{- if .Values.metrics.enabled }}
|
||||||
|
ports:
|
||||||
|
- name: "djangometrics"
|
||||||
|
containerPort: 8000
|
||||||
|
{{- end }}
|
||||||
|
- name: nginx
|
||||||
|
image: "{{ .Values.global.image.registry | default "docker.io" }}/{{ .Values.global.image.repository }}:{{ .Values.global.image.tag | default .Chart.AppVersion }}"
|
||||||
|
imagePullPolicy: {{ .Values.global.image.pullPolicy }}
|
||||||
|
{{- if .Values.app.containerSecurityContext.enabled }}
|
||||||
|
securityContext: {{- omit .Values.app.containerSecurityContext "enabled" | toYaml | nindent 12 }}
|
||||||
|
{{- end }}
|
||||||
|
args: {{- range .Values.app.nginx.args }}
|
||||||
|
- {{ . }}
|
||||||
|
{{- end }}
|
||||||
|
env:
|
||||||
|
- name: APP_HOST
|
||||||
|
value: localhost
|
||||||
|
{{- include "ls.common.envs" . | nindent 12}}
|
||||||
|
{{- if .Values.app.nginx.extraEnvironmentVars -}}
|
||||||
|
{{- range $key, $value := .Values.app.nginx.extraEnvironmentVars }}
|
||||||
|
- name: {{ printf "%s" $key | replace "." "_" | upper | quote }}
|
||||||
|
value: {{ $value | quote }}
|
||||||
|
{{- end }}
|
||||||
|
{{- end }}
|
||||||
|
{{- if .Values.app.nginx.extraEnvironmentSecrets -}}
|
||||||
|
{{- range $key, $value := .Values.app.nginx.extraEnvironmentSecrets }}
|
||||||
|
- name: {{ printf "%s" $key | replace "." "_" | upper | quote }}
|
||||||
|
valueFrom:
|
||||||
|
secretKeyRef:
|
||||||
|
name: {{ $value.secretName }}
|
||||||
|
key: {{ $value.secretKey }}
|
||||||
|
{{- end }}
|
||||||
|
{{- end }}
|
||||||
|
ports:
|
||||||
|
- name: {{ .Values.app.service.portName }}
|
||||||
|
containerPort: 8085
|
||||||
|
protocol: TCP
|
||||||
|
lifecycle:
|
||||||
|
preStop:
|
||||||
|
exec:
|
||||||
|
command: [ '/bin/sh', '-c', 'sleep {{ .Values.app.preStopDelaySeconds }}' ]
|
||||||
|
{{- if .Values.app.nginx.readinessProbe.enabled }}
|
||||||
|
readinessProbe: {{- include "tplvalues.render" (dict "value" (omit .Values.app.nginx.readinessProbe "enabled") "context" $) | nindent 12 }}
|
||||||
|
{{- end }}
|
||||||
|
{{- if .Values.app.nginx.livenessProbe.enabled }}
|
||||||
|
livenessProbe: {{- include "tplvalues.render" (dict "value" (omit .Values.app.nginx.livenessProbe "enabled") "context" $) | nindent 12 }}
|
||||||
|
{{- end }}
|
||||||
|
resources:
|
||||||
|
{{- toYaml .Values.app.nginx.resources | nindent 12 }}
|
||||||
|
volumeMounts:
|
||||||
|
- name: data
|
||||||
|
mountPath: /label-studio/data
|
||||||
|
{{- if .Values.app.extraVolumeMounts }}
|
||||||
|
{{ toYaml .Values.app.extraVolumeMounts | nindent 12 }}
|
||||||
|
{{- end }}
|
||||||
|
- mountPath: /opt/heartex/instance-data/etc
|
||||||
|
name: opt-heartex-nginx
|
||||||
|
- mountPath: /tmp
|
||||||
|
name: tmp-dir-nginx
|
||||||
|
{{- if and .Values.metrics.enabled .Values.metrics.uwsgiExporter.enabled }}
|
||||||
|
- name: uwsgi-exporter
|
||||||
|
image: "{{ .Values.metrics.uwsgiExporter.image.repository }}:{{ .Values.metrics.uwsgiExporter.image.tag | default "latest" }}"
|
||||||
|
imagePullPolicy: {{ .Values.metrics.uwsgiExporter.image.pullPolicy }}
|
||||||
|
{{- if .Values.metrics.uwsgiExporter.containerSecurityContext.enabled }}
|
||||||
|
securityContext: {{- omit .Values.metrics.uwsgiExporter.containerSecurityContext "enabled" | toYaml | nindent 12 }}
|
||||||
|
{{- end }}
|
||||||
|
args:
|
||||||
|
- "--stats.uri=http://localhost:1717"
|
||||||
|
{{- if .Values.metrics.uwsgiExporter.resources }}
|
||||||
|
resources: {{- toYaml .Values.metrics.uwsgiExporter.resources | nindent 12 }}
|
||||||
|
{{- end }}
|
||||||
|
{{- if .Values.metrics.uwsgiExporter.readinessProbe.enabled }}
|
||||||
|
readinessProbe: {{- include "tplvalues.render" (dict "value" (omit .Values.metrics.uwsgiExporter.readinessProbe "enabled") "context" $) | nindent 12 }}
|
||||||
|
{{- end }}
|
||||||
|
{{- if .Values.metrics.uwsgiExporter.livenessProbe.enabled }}
|
||||||
|
livenessProbe: {{- include "tplvalues.render" (dict "value" (omit .Values.metrics.uwsgiExporter.livenessProbe "enabled") "context" $) | nindent 12 }}
|
||||||
|
{{- end }}
|
||||||
|
ports:
|
||||||
|
- name: "uwsgimetrics"
|
||||||
|
containerPort: 9117
|
||||||
|
{{- end }}
|
||||||
|
{{- with .Values.app.nodeSelector }}
|
||||||
nodeSelector:
|
nodeSelector:
|
||||||
{{- toYaml . | nindent 8 }}
|
{{- toYaml . | nindent 8 }}
|
||||||
{{- end }}
|
{{- end }}
|
||||||
{{- with .Values.affinity }}
|
{{- if .Values.app.topologySpreadConstraints }}
|
||||||
|
topologySpreadConstraints: {{- include "tplvalues.render" (dict "value" .Values.app.topologySpreadConstraints "context" $) | nindent 8 }}
|
||||||
|
{{- end }}
|
||||||
|
dnsPolicy: {{ .Values.app.dnsPolicy }}
|
||||||
|
enableServiceLinks: {{ .Values.app.enableServiceLinks }}
|
||||||
|
shareProcessNamespace: {{ .Values.app.shareProcessNamespace }}
|
||||||
|
{{- with .Values.app.affinity }}
|
||||||
affinity:
|
affinity:
|
||||||
{{- toYaml . | nindent 8 }}
|
{{- toYaml . | nindent 8 }}
|
||||||
{{- end }}
|
{{- end }}
|
||||||
{{- with .Values.tolerations }}
|
{{- with .Values.app.tolerations }}
|
||||||
tolerations:
|
tolerations:
|
||||||
{{- toYaml . | nindent 8 }}
|
{{- toYaml . | nindent 8 }}
|
||||||
{{- end }}
|
{{- end }}
|
||||||
|
volumes:
|
||||||
|
- name: data
|
||||||
|
{{- if and .Values.global.persistence.enabled (eq .Values.global.persistence.type "volume") }}
|
||||||
|
persistentVolumeClaim:
|
||||||
|
claimName: {{ include "ls-pvc.claimName" . }}
|
||||||
|
{{- else }}
|
||||||
|
emptyDir: {}
|
||||||
|
{{- end }}
|
||||||
|
{{- if and .Values.global.persistence.enabled (eq .Values.global.persistence.type "gcs") }}
|
||||||
|
{{- if or .Values.global.persistence.config.gcs.applicationCredentialsJSON (and .Values.global.persistence.config.gcs.applicationCredentialsJSONExistingSecret .Values.global.persistence.config.gcs.applicationCredentialsJSONExistingSecretKey) }}
|
||||||
|
- name: gcs-storage-credentials
|
||||||
|
secret:
|
||||||
|
{{- if and .Values.global.persistence.config.gcs.applicationCredentialsJSONExistingSecret .Values.global.persistence.config.gcs.applicationCredentialsJSONExistingSecretKey }}
|
||||||
|
secretName: {{ .Values.global.persistence.config.gcs.applicationCredentialsJSONExistingSecret }}
|
||||||
|
{{- else }}
|
||||||
|
secretName: {{ include "ls-secrets.fullname" . }}
|
||||||
|
{{- end }}
|
||||||
|
{{- end }}
|
||||||
|
{{- end }}
|
||||||
|
{{- if .Values.global.pgConfig.ssl.pgSslSecretName }}
|
||||||
|
- name: pg-ssl-certs
|
||||||
|
secret:
|
||||||
|
secretName: {{ include "tplvalues.render" ( dict "value" .Values.global.pgConfig.ssl.pgSslSecretName "context" $) }}
|
||||||
|
defaultMode: 0640
|
||||||
|
{{- end }}
|
||||||
|
{{- if .Values.global.redisConfig.ssl.redisSslSecretName }}
|
||||||
|
- name: redis-ssl-certs
|
||||||
|
secret:
|
||||||
|
secretName: {{ include "tplvalues.render" ( dict "value" .Values.global.redisConfig.ssl.redisSslSecretName "context" $) }}
|
||||||
|
defaultMode: 0640
|
||||||
|
{{- end }}
|
||||||
|
{{- if .Values.app.extraVolumes -}}
|
||||||
|
{{- toYaml .Values.app.extraVolumes | nindent 8 }}
|
||||||
|
{{- end }}
|
||||||
|
- name: opt-heartex-app
|
||||||
|
emptyDir: { }
|
||||||
|
- name: opt-heartex-nginx
|
||||||
|
emptyDir: { }
|
||||||
|
- name: opt-heartex-init
|
||||||
|
emptyDir: { }
|
||||||
|
- name: tmp-dir-app
|
||||||
|
emptyDir: { }
|
||||||
|
- name: tmp-dir-nginx
|
||||||
|
emptyDir: { }
|
||||||
|
- name: tmp-dir-init
|
||||||
|
emptyDir: { }
|
||||||
|
|||||||
@@ -1,21 +1,34 @@
|
|||||||
{{- if .Values.ingress.enabled -}}
|
{{- if .Values.app.ingress.enabled -}}
|
||||||
|
{{- $fullName := include "ls-app.fullname" . -}}
|
||||||
|
{{- $svcPort := .Values.app.service.port -}}
|
||||||
|
{{- if and .Values.app.ingress.className (not (semverCompare ">=1.18-0" .Capabilities.KubeVersion.GitVersion)) }}
|
||||||
|
{{- if not (hasKey .Values.app.ingress.annotations "kubernetes.io/ingress.class") }}
|
||||||
|
{{- $_ := set .Values.app.ingress.annotations "kubernetes.io/ingress.class" .Values.app.ingress.className}}
|
||||||
|
{{- end }}
|
||||||
|
{{- end }}
|
||||||
|
{{- if semverCompare ">=1.19-0" .Capabilities.KubeVersion.GitVersion -}}
|
||||||
apiVersion: networking.k8s.io/v1
|
apiVersion: networking.k8s.io/v1
|
||||||
|
{{- else if semverCompare ">=1.14-0" .Capabilities.KubeVersion.GitVersion -}}
|
||||||
|
apiVersion: networking.k8s.io/v1beta1
|
||||||
|
{{- else -}}
|
||||||
|
apiVersion: extensions/v1beta1
|
||||||
|
{{- end }}
|
||||||
kind: Ingress
|
kind: Ingress
|
||||||
metadata:
|
metadata:
|
||||||
name: {{ include "label-studio.fullname" . }}
|
name: {{ $fullName }}
|
||||||
labels:
|
labels:
|
||||||
{{- include "label-studio.labels" . | nindent 4 }}
|
{{- include "ls-app.labels" . | nindent 4 }}
|
||||||
{{- with .Values.ingress.annotations }}
|
{{- with .Values.app.ingress.annotations }}
|
||||||
annotations:
|
annotations:
|
||||||
{{- toYaml . | nindent 4 }}
|
{{- toYaml . | nindent 4 }}
|
||||||
{{- end }}
|
{{- end }}
|
||||||
spec:
|
spec:
|
||||||
{{- with .Values.ingress.className }}
|
{{- if and .Values.app.ingress.className (semverCompare ">=1.18-0" .Capabilities.KubeVersion.GitVersion) }}
|
||||||
ingressClassName: {{ . }}
|
ingressClassName: {{ .Values.app.ingress.className | quote }}
|
||||||
{{- end }}
|
{{- end }}
|
||||||
{{- if .Values.ingress.tls }}
|
{{- if .Values.app.ingress.tls }}
|
||||||
tls:
|
tls:
|
||||||
{{- range .Values.ingress.tls }}
|
{{- range .Values.app.ingress.tls }}
|
||||||
- hosts:
|
- hosts:
|
||||||
{{- range .hosts }}
|
{{- range .hosts }}
|
||||||
- {{ . | quote }}
|
- {{ . | quote }}
|
||||||
@@ -24,20 +37,29 @@ spec:
|
|||||||
{{- end }}
|
{{- end }}
|
||||||
{{- end }}
|
{{- end }}
|
||||||
rules:
|
rules:
|
||||||
{{- range .Values.ingress.hosts }}
|
- host: {{ .Values.app.ingress.host | quote }}
|
||||||
- host: {{ .host | quote }}
|
|
||||||
http:
|
http:
|
||||||
paths:
|
paths:
|
||||||
{{- range .paths }}
|
{{- if .Values.app.ingress.extraPaths }}
|
||||||
- path: {{ .path }}
|
{{- toYaml .Values.app.ingress.extraPaths | nindent 10 }}
|
||||||
{{- with .pathType }}
|
|
||||||
pathType: {{ . }}
|
|
||||||
{{- end }}
|
{{- end }}
|
||||||
|
- path: {{ default "/" .Values.app.ingress.path }}
|
||||||
|
pathType: {{ .Values.app.ingress.pathType }}
|
||||||
backend:
|
backend:
|
||||||
service:
|
service:
|
||||||
name: {{ include "label-studio.fullname" $ }}
|
name: {{ $fullName }}
|
||||||
port:
|
port:
|
||||||
number: {{ $.Values.service.port }}
|
number: {{ $svcPort }}
|
||||||
{{- end }}
|
{{- range .Values.app.ingress.extraHosts }}
|
||||||
|
- host: {{ .name }}
|
||||||
|
http:
|
||||||
|
paths:
|
||||||
|
- path: {{ default "/" .path }}
|
||||||
|
pathType: {{ default "ImplementationSpecific" .pathType }}
|
||||||
|
backend:
|
||||||
|
service:
|
||||||
|
name: {{ $fullName }}
|
||||||
|
port:
|
||||||
|
number: {{ $svcPort }}
|
||||||
{{- end }}
|
{{- end }}
|
||||||
{{- end }}
|
{{- end }}
|
||||||
|
|||||||
36
label-studio/templates/pvc.yaml
Normal file
36
label-studio/templates/pvc.yaml
Normal file
@@ -0,0 +1,36 @@
|
|||||||
|
{{- if .Values.global.persistence.enabled }}
|
||||||
|
{{- if and (eq .Values.global.persistence.type "volume") (not .Values.global.persistence.config.volume.existingClaim) }}
|
||||||
|
kind: PersistentVolumeClaim
|
||||||
|
apiVersion: v1
|
||||||
|
metadata:
|
||||||
|
name: {{ include "ls-pvc.fullname" . }}
|
||||||
|
{{- if eq .Values.global.persistence.config.volume.resourcePolicy "keep" }}
|
||||||
|
annotations:
|
||||||
|
helm.sh/resource-policy: keep
|
||||||
|
{{- end }}
|
||||||
|
namespace: {{ .Release.Namespace }}
|
||||||
|
labels:
|
||||||
|
{{- include "ls-pvc.labels" . | nindent 4 }}
|
||||||
|
{{- if .Values.global.persistence.config.volume.annotations }}
|
||||||
|
annotations:
|
||||||
|
{{- if .Values.global.persistence.config.volume.annotations }}
|
||||||
|
{{- include "tplvalues.render" ( dict "value" .Values.global.persistence.config.volume.annotations "context" $ ) | nindent 4 }}
|
||||||
|
{{- end }}
|
||||||
|
{{- end }}
|
||||||
|
spec:
|
||||||
|
accessModes:
|
||||||
|
{{- range .Values.global.persistence.config.volume.accessModes }}
|
||||||
|
- {{ . | quote }}
|
||||||
|
{{- end }}
|
||||||
|
resources:
|
||||||
|
requests:
|
||||||
|
storage: {{ .Values.global.persistence.config.volume.size | quote }}
|
||||||
|
{{- if .Values.global.persistence.config.volume.storageClass -}}
|
||||||
|
{{- if (eq "-" .Values.global.persistence.config.volume.storageClass) -}}
|
||||||
|
storageClassName: ""
|
||||||
|
{{- else }}
|
||||||
|
storageClassName: {{ .Values.global.persistence.config.volume.storageClass }}
|
||||||
|
{{- end -}}
|
||||||
|
{{- end -}}
|
||||||
|
{{- end }}
|
||||||
|
{{- end }}
|
||||||
@@ -1,15 +1,36 @@
|
|||||||
apiVersion: v1
|
apiVersion: v1
|
||||||
kind: Service
|
kind: Service
|
||||||
metadata:
|
metadata:
|
||||||
name: {{ include "label-studio.fullname" . }}
|
name: {{ include "ls-app.fullname" . }}
|
||||||
labels:
|
labels:
|
||||||
{{- include "label-studio.labels" . | nindent 4 }}
|
{{- include "ls-app.labels" . | nindent 4 }}
|
||||||
|
{{- with .Values.app.service.annotations }}
|
||||||
|
annotations:
|
||||||
|
{{- toYaml . | nindent 4 }}
|
||||||
|
{{- end }}
|
||||||
spec:
|
spec:
|
||||||
type: {{ .Values.service.type }}
|
type: {{ .Values.app.service.type }}
|
||||||
ports:
|
ports:
|
||||||
- port: {{ .Values.service.port }}
|
- port: {{ .Values.app.service.port }}
|
||||||
targetPort: http
|
targetPort: {{ .Values.app.service.targetPort }}
|
||||||
protocol: TCP
|
protocol: TCP
|
||||||
name: http
|
name: {{ .Values.app.service.portName }}
|
||||||
|
{{- if and .Values.metrics.enabled .Values.metrics.uwsgiExporter.enabled }}
|
||||||
|
- port: 9117
|
||||||
|
targetPort: "uwsgimetrics"
|
||||||
|
protocol: "TCP"
|
||||||
|
name: "uwsgimetrics"
|
||||||
|
{{- end }}
|
||||||
|
{{- if and .Values.metrics.enabled }}
|
||||||
|
- port: 8000
|
||||||
|
targetPort: "djangometrics"
|
||||||
|
protocol: "TCP"
|
||||||
|
name: "djangometrics"
|
||||||
|
{{- end }}
|
||||||
selector:
|
selector:
|
||||||
{{- include "label-studio.selectorLabels" . | nindent 4 }}
|
{{- include "ls-app.selectorLabels" . | nindent 4 }}
|
||||||
|
sessionAffinity: {{ .Values.app.service.sessionAffinity }}
|
||||||
|
{{- if .Values.app.service.sessionAffinityConfig }}
|
||||||
|
sessionAffinityConfig:
|
||||||
|
{{- toYaml .Values.app.service.sessionAffinityConfig | nindent 4 }}
|
||||||
|
{{- end }}
|
||||||
Reference in New Issue
Block a user