diff --git a/changelog.d/20240518_021532_jacky.lam_helm_defaultstorage.md b/changelog.d/20240518_021532_jacky.lam_helm_defaultstorage.md new file mode 100644 index 000000000000..8af7d1f9ea78 --- /dev/null +++ b/changelog.d/20240518_021532_jacky.lam_helm_defaultstorage.md @@ -0,0 +1,4 @@ +### Fixed + +- Helm chart: Add volumeMounts only if defaultStorage is enabled + () diff --git a/helm-chart/templates/cvat_backend/server/deployment.yml b/helm-chart/templates/cvat_backend/server/deployment.yml index b94c6de19f88..307cfa96f63d 100644 --- a/helm-chart/templates/cvat_backend/server/deployment.yml +++ b/helm-chart/templates/cvat_backend/server/deployment.yml @@ -80,6 +80,7 @@ spec: {{- toYaml (omit $localValues.livenessProbe "enabled") | nindent 12 }} {{- end }} volumeMounts: + {{- if .Values.cvat.backend.defaultStorage.enabled }} {{- if not .Values.cvat.backend.disableDistinctCachePerService }} - mountPath: /home/django/data/cache name: cvat-backend-per-service-cache @@ -96,6 +97,7 @@ spec: - mountPath: /home/django/models name: cvat-backend-data subPath: models + {{- end }} {{- with concat .Values.cvat.backend.additionalVolumeMounts $localValues.additionalVolumeMounts }} {{- toYaml . | nindent 10 }} {{- end }} diff --git a/helm-chart/templates/cvat_backend/utils/deployment.yml b/helm-chart/templates/cvat_backend/utils/deployment.yml index 434366fecebe..105ef0c36a7d 100644 --- a/helm-chart/templates/cvat_backend/utils/deployment.yml +++ b/helm-chart/templates/cvat_backend/utils/deployment.yml @@ -64,6 +64,7 @@ spec: {{- $probeConfig := dict "args" $probeArgs "livenessProbe" $.Values.cvat.backend.worker.livenessProbe -}} {{ include "cvat.backend.worker.livenessProbe" $probeConfig | indent 10 }} volumeMounts: + {{- if .Values.cvat.backend.defaultStorage.enabled }} {{- if not .Values.cvat.backend.disableDistinctCachePerService }} - mountPath: /home/django/data/cache name: cvat-backend-per-service-cache @@ -80,6 +81,7 @@ spec: - mountPath: /home/django/models name: cvat-backend-data subPath: models + {{- end }} {{- with concat .Values.cvat.backend.additionalVolumeMounts $localValues.additionalVolumeMounts }} {{- toYaml . | nindent 10 }} {{- end }} diff --git a/helm-chart/templates/cvat_backend/worker_annotation/deployment.yml b/helm-chart/templates/cvat_backend/worker_annotation/deployment.yml index 2ccfdfcbb5d7..0cb6ac76bd58 100644 --- a/helm-chart/templates/cvat_backend/worker_annotation/deployment.yml +++ b/helm-chart/templates/cvat_backend/worker_annotation/deployment.yml @@ -64,6 +64,7 @@ spec: {{- $probeConfig := dict "args" $probeArgs "livenessProbe" $.Values.cvat.backend.worker.livenessProbe -}} {{ include "cvat.backend.worker.livenessProbe" $probeConfig | indent 10 }} volumeMounts: + {{- if .Values.cvat.backend.defaultStorage.enabled }} {{- if not .Values.cvat.backend.disableDistinctCachePerService }} - mountPath: /home/django/data/cache name: cvat-backend-per-service-cache @@ -83,6 +84,7 @@ spec: - mountPath: /home/django/tmp_storage name: cvat-backend-data subPath: tmp_storage + {{- end }} {{- with concat .Values.cvat.backend.additionalVolumeMounts $localValues.additionalVolumeMounts }} {{- toYaml . | nindent 10 }} {{- end }} diff --git a/helm-chart/templates/cvat_backend/worker_export/deployment.yml b/helm-chart/templates/cvat_backend/worker_export/deployment.yml index 06211e7b2bf3..7994514e88ac 100644 --- a/helm-chart/templates/cvat_backend/worker_export/deployment.yml +++ b/helm-chart/templates/cvat_backend/worker_export/deployment.yml @@ -65,6 +65,7 @@ spec: {{- $probeConfig := dict "args" $probeArgs "livenessProbe" $.Values.cvat.backend.worker.livenessProbe -}} {{ include "cvat.backend.worker.livenessProbe" $probeConfig | indent 10 }} volumeMounts: + {{- if .Values.cvat.backend.defaultStorage.enabled }} {{- if not .Values.cvat.backend.disableDistinctCachePerService }} - mountPath: /home/django/data/cache name: cvat-backend-per-service-cache @@ -84,6 +85,7 @@ spec: - mountPath: /home/django/tmp_storage name: cvat-backend-data subPath: tmp_storage + {{- end }} {{- with concat .Values.cvat.backend.additionalVolumeMounts $localValues.additionalVolumeMounts }} {{- toYaml . | nindent 10 }} {{- end }} diff --git a/helm-chart/templates/cvat_backend/worker_import/deployment.yml b/helm-chart/templates/cvat_backend/worker_import/deployment.yml index 6172e11ff0af..8b7653e5c638 100644 --- a/helm-chart/templates/cvat_backend/worker_import/deployment.yml +++ b/helm-chart/templates/cvat_backend/worker_import/deployment.yml @@ -64,6 +64,7 @@ spec: {{- $probeConfig := dict "args" $probeArgs "livenessProbe" $.Values.cvat.backend.worker.livenessProbe -}} {{ include "cvat.backend.worker.livenessProbe" $probeConfig | indent 10 }} volumeMounts: + {{- if .Values.cvat.backend.defaultStorage.enabled }} {{- if not .Values.cvat.backend.disableDistinctCachePerService }} - mountPath: /home/django/data/cache name: cvat-backend-per-service-cache @@ -83,6 +84,7 @@ spec: - mountPath: /home/django/tmp_storage name: cvat-backend-data subPath: tmp_storage + {{- end }} {{- with concat .Values.cvat.backend.additionalVolumeMounts $localValues.additionalVolumeMounts }} {{- toYaml . | nindent 10 }} {{- end }} diff --git a/helm-chart/values.yaml b/helm-chart/values.yaml index 59c517bda563..35d9df59b53c 100644 --- a/helm-chart/values.yaml +++ b/helm-chart/values.yaml @@ -314,10 +314,12 @@ cvat: periodSeconds: 10 initialDelaySeconds: 30 defaultStorage: + # Note: if you disable defaultStorage, you will need to mount `/home/django/*` + # volumes manually under additionalVolumes and additionalVolumeMounts enabled: true -# storageClassName: default -# accessModes: -# - ReadWriteOnce + # storageClassName: default + # accessModes: + # - ReadWriteOnce size: 100Gi postgresql: