From d470ba2d496040dc308a20e09a7a76665264a707 Mon Sep 17 00:00:00 2001 From: Roman Donchenko Date: Mon, 13 Nov 2023 13:43:15 +0200 Subject: [PATCH] helm-chart: add a way to easily set parameters for all backend pods Since backend pods are all fairly similar, it stands to reason that users would want to apply similar configuration to them. Add some `cvat.backend.*` parameters that are applied to all backend deployments/jobs. --- .../20231116_140728_roman_backend_settings.md | 4 +++ .../cvat_backend/initializer/job.yml | 20 +++++++------- .../cvat_backend/server/deployment.yml | 26 +++++++++---------- .../cvat_backend/utils/deployment.yml | 26 +++++++++---------- .../worker_analyticsreports/deployment.yml | 22 ++++++++-------- .../worker_annotation/deployment.yml | 26 +++++++++---------- .../cvat_backend/worker_export/deployment.yml | 26 +++++++++---------- .../cvat_backend/worker_import/deployment.yml | 26 +++++++++---------- .../worker_qualityreports/deployment.yml | 22 ++++++++-------- .../worker_webhooks/deployment.yml | 22 ++++++++-------- helm-chart/values.yaml | 9 +++++++ 11 files changed, 121 insertions(+), 108 deletions(-) create mode 100644 changelog.d/20231116_140728_roman_backend_settings.md diff --git a/changelog.d/20231116_140728_roman_backend_settings.md b/changelog.d/20231116_140728_roman_backend_settings.md new file mode 100644 index 000000000000..e63ca44cf1e8 --- /dev/null +++ b/changelog.d/20231116_140728_roman_backend_settings.md @@ -0,0 +1,4 @@ +### Added + +- \[Helm\] Values that apply to all backend deployments/jobs + () diff --git a/helm-chart/templates/cvat_backend/initializer/job.yml b/helm-chart/templates/cvat_backend/initializer/job.yml index 2a10070db92a..2ec6c723d206 100644 --- a/helm-chart/templates/cvat_backend/initializer/job.yml +++ b/helm-chart/templates/cvat_backend/initializer/job.yml @@ -14,10 +14,10 @@ metadata: tier: backend component: initializer {{- include "cvat.labels" . | nindent 4 }} - {{- with $localValues.labels }} + {{- with merge $localValues.labels .Values.cvat.backend.labels }} {{- toYaml . | nindent 4 }} {{- end }} - {{- with $localValues.annotations }} + {{- with merge $localValues.annotations .Values.cvat.backend.annotations }} annotations: {{- toYaml . | nindent 4 }} {{- end }} @@ -29,10 +29,10 @@ spec: tier: backend component: initializer {{- include "cvat.labels" . | nindent 8 }} - {{- with $localValues.labels }} + {{- with merge $localValues.labels .Values.cvat.backend.labels }} {{- toYaml . | nindent 8 }} {{- end }} - {{- with $localValues.annotations }} + {{- with merge $localValues.annotations .Values.cvat.backend.annotations }} annotations: {{- toYaml . | nindent 8 }} {{- end }} @@ -41,30 +41,30 @@ spec: - name: cvat-backend image: {{ .Values.cvat.backend.image }}:{{ .Values.cvat.backend.tag }} imagePullPolicy: {{ .Values.cvat.backend.imagePullPolicy }} - {{- with $localValues.resources }} + {{- with merge $localValues.resources .Values.cvat.backend.resources }} resources: {{- toYaml . | nindent 12 }} {{- end }} args: ["init"] env: {{ include "cvat.sharedBackendEnv" . | indent 10 }} - {{- with $localValues.additionalEnv }} + {{- with concat .Values.cvat.backend.additionalEnv $localValues.additionalEnv }} {{- toYaml . | nindent 10 }} {{- end }} - {{- with $localValues.additionalVolumeMounts }} + {{- with concat .Values.cvat.backend.additionalVolumeMounts $localValues.additionalVolumeMounts }} volumeMounts: {{- toYaml . | nindent 10 }} {{- end }} restartPolicy: OnFailure - {{- with $localValues.affinity }} + {{- with merge $localValues.affinity .Values.cvat.backend.affinity }} affinity: {{- toYaml . | nindent 8 }} {{- end }} - {{- with $localValues.tolerations }} + {{- with concat .Values.cvat.backend.tolerations $localValues.tolerations }} tolerations: {{- toYaml . | nindent 8 }} {{- end }} - {{- with $localValues.additionalVolumes }} + {{- with concat .Values.cvat.backend.additionalVolumes $localValues.additionalVolumes }} volumes: {{- toYaml . | nindent 8 }} {{- end }} diff --git a/helm-chart/templates/cvat_backend/server/deployment.yml b/helm-chart/templates/cvat_backend/server/deployment.yml index cd69e4697526..397b7b7c59f1 100644 --- a/helm-chart/templates/cvat_backend/server/deployment.yml +++ b/helm-chart/templates/cvat_backend/server/deployment.yml @@ -10,10 +10,10 @@ metadata: tier: backend component: server {{- include "cvat.labels" . | nindent 4 }} - {{- with $localValues.labels }} + {{- with merge $localValues.labels .Values.cvat.backend.labels }} {{- toYaml . | nindent 4 }} {{- end }} - {{- with $localValues.annotations }} + {{- with merge $localValues.annotations .Values.cvat.backend.annotations }} annotations: {{- toYaml . | nindent 4 }} {{- end }} @@ -24,7 +24,7 @@ spec: selector: matchLabels: {{- include "cvat.labels" . | nindent 6 }} - {{- with $localValues.labels }} + {{- with merge $localValues.labels .Values.cvat.backend.labels }} {{- toYaml . | nindent 6 }} {{- end }} app: cvat-app @@ -37,10 +37,10 @@ spec: tier: backend component: server {{- include "cvat.labels" . | nindent 8 }} - {{- with $localValues.labels }} + {{- with merge $localValues.labels .Values.cvat.backend.labels }} {{- toYaml . | nindent 8 }} {{- end }} - {{- with $localValues.annotations }} + {{- with merge $localValues.annotations .Values.cvat.backend.annotations }} annotations: {{- toYaml . | nindent 8 }} {{- end }} @@ -49,7 +49,7 @@ spec: - name: cvat-backend image: {{ .Values.cvat.backend.image }}:{{ .Values.cvat.backend.tag }} imagePullPolicy: {{ .Values.cvat.backend.imagePullPolicy }} - {{- with $localValues.resources }} + {{- with merge $localValues.resources .Values.cvat.backend.resources }} resources: {{- toYaml . | nindent 12 }} {{- end }} @@ -62,7 +62,7 @@ spec: - name: IAM_OPA_BUNDLE value: "1" {{ include "cvat.sharedBackendEnv" . | indent 10 }} - {{- with $localValues.additionalEnv }} + {{- with concat .Values.cvat.backend.additionalEnv $localValues.additionalEnv }} {{- toYaml . | nindent 10 }} {{- end }} ports: @@ -84,7 +84,7 @@ spec: - mountPath: /home/django/models name: cvat-backend-data subPath: models - {{- with $localValues.additionalVolumeMounts }} + {{- with concat .Values.cvat.backend.additionalVolumeMounts $localValues.additionalVolumeMounts }} {{- toYaml . | nindent 10 }} {{- end }} initContainers: @@ -92,7 +92,7 @@ spec: - name: user-data-permission-fix image: busybox command: ["/bin/chmod", "-R", "777", "/home/django"] - {{- with $localValues.resources }} + {{- with merge $localValues.resources .Values.cvat.backend.resources }} resources: {{- toYaml . | nindent 12 }} {{- end }} @@ -115,15 +115,15 @@ spec: name: cvat-backend-data subPath: models {{- end }} - {{- with $localValues.additionalVolumeMounts }} + {{- with concat .Values.cvat.backend.additionalVolumeMounts $localValues.additionalVolumeMounts }} {{- toYaml . | nindent 10 }} {{- end }} {{- end }} - {{- with $localValues.affinity }} + {{- with merge $localValues.affinity .Values.cvat.backend.affinity }} affinity: {{- toYaml . | nindent 8 }} {{- end }} - {{- with $localValues.tolerations }} + {{- with concat .Values.cvat.backend.tolerations $localValues.tolerations }} tolerations: {{- toYaml . | nindent 8 }} {{- end }} @@ -137,7 +137,7 @@ spec: emptyDir: {} {{- end }} {{- end }} - {{- with $localValues.additionalVolumes }} + {{- with concat .Values.cvat.backend.additionalVolumes $localValues.additionalVolumes }} {{- toYaml . | nindent 8 }} {{- end }} {{- with .Values.imagePullSecrets }} diff --git a/helm-chart/templates/cvat_backend/utils/deployment.yml b/helm-chart/templates/cvat_backend/utils/deployment.yml index 5a6962ded297..26ea0ee8936e 100644 --- a/helm-chart/templates/cvat_backend/utils/deployment.yml +++ b/helm-chart/templates/cvat_backend/utils/deployment.yml @@ -10,10 +10,10 @@ metadata: tier: backend component: utils {{- include "cvat.labels" . | nindent 4 }} - {{- with $localValues.labels }} + {{- with merge $localValues.labels .Values.cvat.backend.labels }} {{- toYaml . | nindent 4 }} {{- end }} - {{- with $localValues.annotations }} + {{- with merge $localValues.annotations .Values.cvat.backend.annotations }} annotations: {{- toYaml . | nindent 4 }} {{- end }} @@ -24,7 +24,7 @@ spec: selector: matchLabels: {{- include "cvat.labels" . | nindent 6 }} - {{- with $localValues.labels }} + {{- with merge $localValues.labels .Values.cvat.backend.labels }} {{- toYaml . | nindent 6 }} {{- end }} app: cvat-app @@ -37,10 +37,10 @@ spec: tier: backend component: utils {{- include "cvat.labels" . | nindent 8 }} - {{- with $localValues.labels }} + {{- with merge $localValues.labels .Values.cvat.backend.labels }} {{- toYaml . | nindent 8 }} {{- end }} - {{- with $localValues.annotations }} + {{- with merge $localValues.annotations .Values.cvat.backend.annotations }} annotations: {{- toYaml . | nindent 8 }} {{- end }} @@ -49,14 +49,14 @@ spec: - name: cvat-backend image: {{ .Values.cvat.backend.image }}:{{ .Values.cvat.backend.tag }} imagePullPolicy: {{ .Values.cvat.backend.imagePullPolicy }} - {{- with $localValues.resources }} + {{- with merge $localValues.resources .Values.cvat.backend.resources }} resources: {{- toYaml . | nindent 12 }} {{- end }} args: ["run", "utils"] env: {{ include "cvat.sharedBackendEnv" . | indent 10 }} - {{- with $localValues.additionalEnv }} + {{- with concat .Values.cvat.backend.additionalEnv $localValues.additionalEnv }} {{- toYaml . | nindent 10 }} {{- end }} ports: @@ -78,7 +78,7 @@ spec: - mountPath: /home/django/models name: cvat-backend-data subPath: models - {{- with $localValues.additionalVolumeMounts }} + {{- with concat .Values.cvat.backend.additionalVolumeMounts $localValues.additionalVolumeMounts }} {{- toYaml . | nindent 10 }} {{- end }} initContainers: @@ -86,7 +86,7 @@ spec: - name: user-data-permission-fix image: busybox command: ["/bin/chmod", "-R", "777", "/home/django"] - {{- with $localValues.resources }} + {{- with merge $localValues.resources .Values.cvat.backend.resources }} resources: {{- toYaml . | nindent 12 }} {{- end }} @@ -109,15 +109,15 @@ spec: name: cvat-backend-data subPath: models {{- end }} - {{- with $localValues.additionalVolumeMounts }} + {{- with concat .Values.cvat.backend.additionalVolumeMounts $localValues.additionalVolumeMounts }} {{- toYaml . | nindent 10 }} {{- end }} {{- end }} - {{- with $localValues.affinity }} + {{- with merge $localValues.affinity .Values.cvat.backend.affinity }} affinity: {{- toYaml . | nindent 8 }} {{- end }} - {{- with $localValues.tolerations }} + {{- with concat .Values.cvat.backend.tolerations $localValues.tolerations }} tolerations: {{- toYaml . | nindent 8 }} {{- end }} @@ -131,7 +131,7 @@ spec: emptyDir: {} {{- end }} {{- end }} - {{- with $localValues.additionalVolumes }} + {{- with concat .Values.cvat.backend.additionalVolumes $localValues.additionalVolumes }} {{- toYaml . | nindent 8 }} {{- end }} {{- with .Values.imagePullSecrets }} diff --git a/helm-chart/templates/cvat_backend/worker_analyticsreports/deployment.yml b/helm-chart/templates/cvat_backend/worker_analyticsreports/deployment.yml index ebb2e576de99..37b18d3cafed 100644 --- a/helm-chart/templates/cvat_backend/worker_analyticsreports/deployment.yml +++ b/helm-chart/templates/cvat_backend/worker_analyticsreports/deployment.yml @@ -10,10 +10,10 @@ metadata: tier: backend component: worker-analyticsreports {{- include "cvat.labels" . | nindent 4 }} - {{- with $localValues.labels }} + {{- with merge $localValues.labels .Values.cvat.backend.labels }} {{- toYaml . | nindent 4 }} {{- end }} - {{- with $localValues.annotations }} + {{- with merge $localValues.annotations .Values.cvat.backend.annotations }} annotations: {{- toYaml . | nindent 4 }} {{- end }} @@ -24,7 +24,7 @@ spec: selector: matchLabels: {{- include "cvat.labels" . | nindent 6 }} - {{- with $localValues.labels }} + {{- with merge $localValues.labels .Values.cvat.backend.labels }} {{- toYaml . | nindent 6 }} {{- end }} app: cvat-app @@ -37,10 +37,10 @@ spec: tier: backend component: worker-analyticsreports {{- include "cvat.labels" . | nindent 8 }} - {{- with $localValues.labels }} + {{- with merge $localValues.labels .Values.cvat.backend.labels }} {{- toYaml . | nindent 8 }} {{- end }} - {{- with $localValues.annotations }} + {{- with merge $localValues.annotations .Values.cvat.backend.annotations }} annotations: {{- toYaml . | nindent 8 }} {{- end }} @@ -49,29 +49,29 @@ spec: - name: cvat-backend image: {{ .Values.cvat.backend.image }}:{{ .Values.cvat.backend.tag }} imagePullPolicy: {{ .Values.cvat.backend.imagePullPolicy }} - {{- with $localValues.resources }} + {{- with merge $localValues.resources .Values.cvat.backend.resources }} resources: {{- toYaml . | nindent 12 }} {{- end }} args: ["run", "worker.analytics_reports"] env: {{ include "cvat.sharedBackendEnv" . | indent 10 }} - {{- with $localValues.additionalEnv }} + {{- with concat .Values.cvat.backend.additionalEnv $localValues.additionalEnv }} {{- toYaml . | nindent 10 }} {{- end }} - {{- with $localValues.additionalVolumeMounts }} + {{- with concat .Values.cvat.backend.additionalVolumeMounts $localValues.additionalVolumeMounts }} volumeMounts: {{- toYaml . | nindent 10 }} {{- end }} - {{- with $localValues.affinity }} + {{- with merge $localValues.affinity .Values.cvat.backend.affinity }} affinity: {{- toYaml . | nindent 8 }} {{- end }} - {{- with $localValues.tolerations }} + {{- with concat .Values.cvat.backend.tolerations $localValues.tolerations }} tolerations: {{- toYaml . | nindent 8 }} {{- end }} - {{- with $localValues.additionalVolumes }} + {{- with concat .Values.cvat.backend.additionalVolumes $localValues.additionalVolumes }} volumes: {{- toYaml . | nindent 8 }} {{- end }} diff --git a/helm-chart/templates/cvat_backend/worker_annotation/deployment.yml b/helm-chart/templates/cvat_backend/worker_annotation/deployment.yml index 44edfb337059..4e681c0043f9 100644 --- a/helm-chart/templates/cvat_backend/worker_annotation/deployment.yml +++ b/helm-chart/templates/cvat_backend/worker_annotation/deployment.yml @@ -10,10 +10,10 @@ metadata: tier: backend component: worker-annotation {{- include "cvat.labels" . | nindent 4 }} - {{- with $localValues.labels }} + {{- with merge $localValues.labels .Values.cvat.backend.labels }} {{- toYaml . | nindent 4 }} {{- end }} - {{- with $localValues.annotations }} + {{- with merge $localValues.annotations .Values.cvat.backend.annotations }} annotations: {{- toYaml . | nindent 4 }} {{- end }} @@ -24,7 +24,7 @@ spec: selector: matchLabels: {{- include "cvat.labels" . | nindent 6 }} - {{- with $localValues.labels }} + {{- with merge $localValues.labels .Values.cvat.backend.labels }} {{- toYaml . | nindent 6 }} {{- end }} app: cvat-app @@ -37,10 +37,10 @@ spec: tier: backend component: worker-annotation {{- include "cvat.labels" . | nindent 8 }} - {{- with $localValues.labels }} + {{- with merge $localValues.labels .Values.cvat.backend.labels }} {{- toYaml . | nindent 8 }} {{- end }} - {{- with $localValues.annotations }} + {{- with merge $localValues.annotations .Values.cvat.backend.annotations }} annotations: {{- toYaml . | nindent 8 }} {{- end }} @@ -49,14 +49,14 @@ spec: - name: cvat-backend image: {{ .Values.cvat.backend.image }}:{{ .Values.cvat.backend.tag }} imagePullPolicy: {{ .Values.cvat.backend.imagePullPolicy }} - {{- with $localValues.resources }} + {{- with merge $localValues.resources .Values.cvat.backend.resources }} resources: {{- toYaml . | nindent 12 }} {{- end }} args: ["run", "worker.annotation"] env: {{ include "cvat.sharedBackendEnv" . | indent 10 }} - {{- with $localValues.additionalEnv }} + {{- with concat .Values.cvat.backend.additionalEnv $localValues.additionalEnv }} {{- toYaml . | nindent 10 }} {{- end }} volumeMounts: @@ -79,7 +79,7 @@ spec: - mountPath: /home/django/tmp_storage name: cvat-backend-data subPath: tmp_storage - {{- with $localValues.additionalVolumeMounts }} + {{- with concat .Values.cvat.backend.additionalVolumeMounts $localValues.additionalVolumeMounts }} {{- toYaml . | nindent 10 }} {{- end }} initContainers: @@ -87,7 +87,7 @@ spec: - name: user-data-permission-fix image: busybox command: ["/bin/chmod", "-R", "777", "/home/django"] - {{- with $localValues.resources }} + {{- with merge $localValues.resources .Values.cvat.backend.resources }} resources: {{- toYaml . | nindent 12 }} {{- end }} @@ -110,15 +110,15 @@ spec: name: cvat-backend-data subPath: models {{- end }} - {{- with $localValues.additionalVolumeMounts }} + {{- with concat .Values.cvat.backend.additionalVolumeMounts $localValues.additionalVolumeMounts }} {{- toYaml . | nindent 10 }} {{- end }} {{- end }} - {{- with $localValues.affinity }} + {{- with merge $localValues.affinity .Values.cvat.backend.affinity }} affinity: {{- toYaml . | nindent 8 }} {{- end }} - {{- with $localValues.tolerations }} + {{- with concat .Values.cvat.backend.tolerations $localValues.tolerations }} tolerations: {{- toYaml . | nindent 8 }} {{- end }} @@ -132,7 +132,7 @@ spec: emptyDir: {} {{- end }} {{- end }} - {{- with $localValues.additionalVolumes }} + {{- with concat .Values.cvat.backend.additionalVolumes $localValues.additionalVolumes }} {{- toYaml . | nindent 8 }} {{- end }} {{- with .Values.imagePullSecrets }} diff --git a/helm-chart/templates/cvat_backend/worker_export/deployment.yml b/helm-chart/templates/cvat_backend/worker_export/deployment.yml index 73c64fc5fb8a..a4e0b895c2dc 100644 --- a/helm-chart/templates/cvat_backend/worker_export/deployment.yml +++ b/helm-chart/templates/cvat_backend/worker_export/deployment.yml @@ -10,10 +10,10 @@ metadata: tier: backend component: worker-export {{- include "cvat.labels" . | nindent 4 }} - {{- with $localValues.labels }} + {{- with merge $localValues.labels .Values.cvat.backend.labels }} {{- toYaml . | nindent 4 }} {{- end }} - {{- with $localValues.annotations }} + {{- with merge $localValues.annotations .Values.cvat.backend.annotations }} annotations: {{- toYaml . | nindent 4 }} {{- end }} @@ -24,7 +24,7 @@ spec: selector: matchLabels: {{- include "cvat.labels" . | nindent 6 }} - {{- with $localValues.labels }} + {{- with merge $localValues.labels .Values.cvat.backend.labels }} {{- toYaml . | nindent 6 }} {{- end }} app: cvat-app @@ -37,10 +37,10 @@ spec: tier: backend component: worker-export {{- include "cvat.labels" . | nindent 8 }} - {{- with $localValues.labels }} + {{- with merge $localValues.labels .Values.cvat.backend.labels }} {{- toYaml . | nindent 8 }} {{- end }} - {{- with $localValues.annotations }} + {{- with merge $localValues.annotations .Values.cvat.backend.annotations }} annotations: {{- toYaml . | nindent 8 }} {{- end }} @@ -49,14 +49,14 @@ spec: - name: cvat-backend image: {{ .Values.cvat.backend.image }}:{{ .Values.cvat.backend.tag }} imagePullPolicy: {{ .Values.cvat.backend.imagePullPolicy }} - {{- with $localValues.resources }} + {{- with merge $localValues.resources .Values.cvat.backend.resources }} resources: {{- toYaml . | nindent 12 }} {{- end }} args: ["run", "worker.export"] env: {{ include "cvat.sharedBackendEnv" . | indent 10 }} - {{- with $localValues.additionalEnv }} + {{- with concat .Values.cvat.backend.additionalEnv $localValues.additionalEnv }} {{- toYaml . | nindent 10 }} {{- end }} volumeMounts: @@ -79,7 +79,7 @@ spec: - mountPath: /home/django/tmp_storage name: cvat-backend-data subPath: tmp_storage - {{- with $localValues.additionalVolumeMounts }} + {{- with concat .Values.cvat.backend.additionalVolumeMounts $localValues.additionalVolumeMounts }} {{- toYaml . | nindent 10 }} {{- end }} initContainers: @@ -87,7 +87,7 @@ spec: - name: user-data-permission-fix image: busybox command: ["/bin/chmod", "-R", "777", "/home/django"] - {{- with $localValues.resources }} + {{- with merge $localValues.resources .Values.cvat.backend.resources }} resources: {{- toYaml . | nindent 12 }} {{- end }} @@ -110,15 +110,15 @@ spec: name: cvat-backend-data subPath: models {{- end }} - {{- with $localValues.additionalVolumeMounts }} + {{- with concat .Values.cvat.backend.additionalVolumeMounts $localValues.additionalVolumeMounts }} {{- toYaml . | nindent 10 }} {{- end }} {{- end }} - {{- with $localValues.affinity }} + {{- with merge $localValues.affinity .Values.cvat.backend.affinity }} affinity: {{- toYaml . | nindent 8 }} {{- end }} - {{- with $localValues.tolerations }} + {{- with concat .Values.cvat.backend.tolerations $localValues.tolerations }} tolerations: {{- toYaml . | nindent 8 }} {{- end }} @@ -132,7 +132,7 @@ spec: emptyDir: {} {{- end }} {{- end }} - {{- with $localValues.additionalVolumes }} + {{- with concat .Values.cvat.backend.additionalVolumes $localValues.additionalVolumes }} {{- toYaml . | nindent 8 }} {{- end }} {{- with .Values.imagePullSecrets }} diff --git a/helm-chart/templates/cvat_backend/worker_import/deployment.yml b/helm-chart/templates/cvat_backend/worker_import/deployment.yml index 807cbb8728cb..3b751303cc52 100644 --- a/helm-chart/templates/cvat_backend/worker_import/deployment.yml +++ b/helm-chart/templates/cvat_backend/worker_import/deployment.yml @@ -10,10 +10,10 @@ metadata: tier: backend component: worker-import {{- include "cvat.labels" . | nindent 4 }} - {{- with $localValues.labels }} + {{- with merge $localValues.labels .Values.cvat.backend.labels }} {{- toYaml . | nindent 4 }} {{- end }} - {{- with $localValues.annotations }} + {{- with merge $localValues.annotations .Values.cvat.backend.annotations }} annotations: {{- toYaml . | nindent 4 }} {{- end }} @@ -24,7 +24,7 @@ spec: selector: matchLabels: {{- include "cvat.labels" . | nindent 6 }} - {{- with $localValues.labels }} + {{- with merge $localValues.labels .Values.cvat.backend.labels }} {{- toYaml . | nindent 6 }} {{- end }} app: cvat-app @@ -37,10 +37,10 @@ spec: tier: backend component: worker-import {{- include "cvat.labels" . | nindent 8 }} - {{- with $localValues.labels }} + {{- with merge $localValues.labels .Values.cvat.backend.labels }} {{- toYaml . | nindent 8 }} {{- end }} - {{- with $localValues.annotations }} + {{- with merge $localValues.annotations .Values.cvat.backend.annotations }} annotations: {{- toYaml . | nindent 8 }} {{- end }} @@ -49,14 +49,14 @@ spec: - name: cvat-backend image: {{ .Values.cvat.backend.image }}:{{ .Values.cvat.backend.tag }} imagePullPolicy: {{ .Values.cvat.backend.imagePullPolicy }} - {{- with $localValues.resources }} + {{- with merge $localValues.resources .Values.cvat.backend.resources }} resources: {{- toYaml . | nindent 12 }} {{- end }} args: ["run", "worker.import"] env: {{ include "cvat.sharedBackendEnv" . | indent 10 }} - {{- with $localValues.additionalEnv }} + {{- with concat .Values.cvat.backend.additionalEnv $localValues.additionalEnv }} {{- toYaml . | nindent 10 }} {{- end }} volumeMounts: @@ -79,7 +79,7 @@ spec: - mountPath: /home/django/tmp_storage name: cvat-backend-data subPath: tmp_storage - {{- with $localValues.additionalVolumeMounts }} + {{- with concat .Values.cvat.backend.additionalVolumeMounts $localValues.additionalVolumeMounts }} {{- toYaml . | nindent 10 }} {{- end }} initContainers: @@ -87,7 +87,7 @@ spec: - name: user-data-permission-fix image: busybox command: ["/bin/chmod", "-R", "777", "/home/django"] - {{- with $localValues.resources }} + {{- with merge $localValues.resources .Values.cvat.backend.resources }} resources: {{- toYaml . | nindent 12 }} {{- end }} @@ -110,15 +110,15 @@ spec: name: cvat-backend-data subPath: models {{- end }} - {{- with $localValues.additionalVolumeMounts }} + {{- with concat .Values.cvat.backend.additionalVolumeMounts $localValues.additionalVolumeMounts }} {{- toYaml . | nindent 10 }} {{- end }} {{- end }} - {{- with $localValues.affinity }} + {{- with merge $localValues.affinity .Values.cvat.backend.affinity }} affinity: {{- toYaml . | nindent 8 }} {{- end }} - {{- with $localValues.tolerations }} + {{- with concat .Values.cvat.backend.tolerations $localValues.tolerations }} tolerations: {{- toYaml . | nindent 8 }} {{- end }} @@ -132,7 +132,7 @@ spec: emptyDir: {} {{- end }} {{- end }} - {{- with $localValues.additionalVolumes }} + {{- with concat .Values.cvat.backend.additionalVolumes $localValues.additionalVolumes }} {{- toYaml . | nindent 8 }} {{- end }} {{- with .Values.imagePullSecrets }} diff --git a/helm-chart/templates/cvat_backend/worker_qualityreports/deployment.yml b/helm-chart/templates/cvat_backend/worker_qualityreports/deployment.yml index 7f1ee38a638a..7dabcf62b5f3 100644 --- a/helm-chart/templates/cvat_backend/worker_qualityreports/deployment.yml +++ b/helm-chart/templates/cvat_backend/worker_qualityreports/deployment.yml @@ -10,10 +10,10 @@ metadata: tier: backend component: worker-qualityreports {{- include "cvat.labels" . | nindent 4 }} - {{- with $localValues.labels }} + {{- with merge $localValues.labels .Values.cvat.backend.labels }} {{- toYaml . | nindent 4 }} {{- end }} - {{- with $localValues.annotations }} + {{- with merge $localValues.annotations .Values.cvat.backend.annotations }} annotations: {{- toYaml . | nindent 4 }} {{- end }} @@ -24,7 +24,7 @@ spec: selector: matchLabels: {{- include "cvat.labels" . | nindent 6 }} - {{- with $localValues.labels }} + {{- with merge $localValues.labels .Values.cvat.backend.labels }} {{- toYaml . | nindent 6 }} {{- end }} app: cvat-app @@ -37,10 +37,10 @@ spec: tier: backend component: worker-qualityreports {{- include "cvat.labels" . | nindent 8 }} - {{- with $localValues.labels }} + {{- with merge $localValues.labels .Values.cvat.backend.labels }} {{- toYaml . | nindent 8 }} {{- end }} - {{- with $localValues.annotations }} + {{- with merge $localValues.annotations .Values.cvat.backend.annotations }} annotations: {{- toYaml . | nindent 8 }} {{- end }} @@ -49,29 +49,29 @@ spec: - name: cvat-backend image: {{ .Values.cvat.backend.image }}:{{ .Values.cvat.backend.tag }} imagePullPolicy: {{ .Values.cvat.backend.imagePullPolicy }} - {{- with $localValues.resources }} + {{- with merge $localValues.resources .Values.cvat.backend.resources }} resources: {{- toYaml . | nindent 12 }} {{- end }} args: ["run", "worker.quality_reports"] env: {{ include "cvat.sharedBackendEnv" . | indent 10 }} - {{- with $localValues.additionalEnv }} + {{- with concat .Values.cvat.backend.additionalEnv $localValues.additionalEnv }} {{- toYaml . | nindent 10 }} {{- end }} - {{- with $localValues.additionalVolumeMounts }} + {{- with concat .Values.cvat.backend.additionalVolumeMounts $localValues.additionalVolumeMounts }} volumeMounts: {{- toYaml . | nindent 10 }} {{- end }} - {{- with $localValues.affinity }} + {{- with merge $localValues.affinity .Values.cvat.backend.affinity }} affinity: {{- toYaml . | nindent 8 }} {{- end }} - {{- with $localValues.tolerations }} + {{- with concat .Values.cvat.backend.tolerations $localValues.tolerations }} tolerations: {{- toYaml . | nindent 8 }} {{- end }} - {{- with $localValues.additionalVolumes }} + {{- with concat .Values.cvat.backend.additionalVolumes $localValues.additionalVolumes }} volumes: {{- toYaml . | nindent 8 }} {{- end }} diff --git a/helm-chart/templates/cvat_backend/worker_webhooks/deployment.yml b/helm-chart/templates/cvat_backend/worker_webhooks/deployment.yml index a0bbf2cf5644..e88153a1386c 100644 --- a/helm-chart/templates/cvat_backend/worker_webhooks/deployment.yml +++ b/helm-chart/templates/cvat_backend/worker_webhooks/deployment.yml @@ -10,10 +10,10 @@ metadata: tier: backend component: worker-webhooks {{- include "cvat.labels" . | nindent 4 }} - {{- with $localValues.labels }} + {{- with merge $localValues.labels .Values.cvat.backend.labels }} {{- toYaml . | nindent 4 }} {{- end }} - {{- with $localValues.annotations }} + {{- with merge $localValues.annotations .Values.cvat.backend.annotations }} annotations: {{- toYaml . | nindent 4 }} {{- end }} @@ -24,7 +24,7 @@ spec: selector: matchLabels: {{- include "cvat.labels" . | nindent 6 }} - {{- with $localValues.labels }} + {{- with merge $localValues.labels .Values.cvat.backend.labels }} {{- toYaml . | nindent 6 }} {{- end }} app: cvat-app @@ -37,10 +37,10 @@ spec: tier: backend component: worker-webhooks {{- include "cvat.labels" . | nindent 8 }} - {{- with $localValues.labels }} + {{- with merge $localValues.labels .Values.cvat.backend.labels }} {{- toYaml . | nindent 8 }} {{- end }} - {{- with $localValues.annotations }} + {{- with merge $localValues.annotations .Values.cvat.backend.annotations }} annotations: {{- toYaml . | nindent 8 }} {{- end }} @@ -49,29 +49,29 @@ spec: - name: cvat-backend image: {{ .Values.cvat.backend.image }}:{{ .Values.cvat.backend.tag }} imagePullPolicy: {{ .Values.cvat.backend.imagePullPolicy }} - {{- with $localValues.resources }} + {{- with merge $localValues.resources .Values.cvat.backend.resources }} resources: {{- toYaml . | nindent 12 }} {{- end }} args: ["run", "worker.webhooks"] env: {{ include "cvat.sharedBackendEnv" . | indent 10 }} - {{- with $localValues.additionalEnv }} + {{- with concat .Values.cvat.backend.additionalEnv $localValues.additionalEnv }} {{- toYaml . | nindent 10 }} {{- end }} - {{- with $localValues.additionalVolumeMounts }} + {{- with concat .Values.cvat.backend.additionalVolumeMounts $localValues.additionalVolumeMounts }} volumeMounts: {{- toYaml . | nindent 10 }} {{- end }} - {{- with $localValues.affinity }} + {{- with merge $localValues.affinity .Values.cvat.backend.affinity }} affinity: {{- toYaml . | nindent 8 }} {{- end }} - {{- with $localValues.tolerations }} + {{- with concat .Values.cvat.backend.tolerations $localValues.tolerations }} tolerations: {{- toYaml . | nindent 8 }} {{- end }} - {{- with $localValues.additionalVolumes }} + {{- with concat .Values.cvat.backend.additionalVolumes $localValues.additionalVolumes }} volumes: {{- toYaml . | nindent 8 }} {{- end }} diff --git a/helm-chart/values.yaml b/helm-chart/values.yaml index c0d35955ef0f..a692824a5ca6 100644 --- a/helm-chart/values.yaml +++ b/helm-chart/values.yaml @@ -9,6 +9,15 @@ fullnameOverride: "" cvat: backend: + labels: {} + annotations: {} + resources: {} + affinity: {} + tolerations: [] + additionalEnv: [] + additionalVolumes: [] + additionalVolumeMounts: [] + initializer: labels: {} annotations: {}