diff --git a/.github/workflows/helm.yml b/.github/workflows/helm.yml index 0fae48884c28..ffbde729a86e 100644 --- a/.github/workflows/helm.yml +++ b/.github/workflows/helm.yml @@ -44,11 +44,11 @@ jobs: - name: Deploy to minikube run: | - printf " service:\n externalIPs:\n - $(minikube ip)\n" >> tests/values.test.yaml + printf " service:\n externalIPs:\n - $(minikube ip)\n" >> helm-chart/test.values.yaml cd helm-chart helm dependency update cd .. - helm upgrade -n default release-${{ github.run_id }}-${{ github.run_attempt }} -i --create-namespace helm-chart -f helm-chart/values.yaml -f tests/values.test.yaml + helm upgrade -n default release-${{ github.run_id }}-${{ github.run_attempt }} -i --create-namespace helm-chart -f helm-chart/values.yaml -f helm-chart/cvat.values.yaml -f helm-chart/test.values.yaml - name: Update test config run: | diff --git a/CHANGELOG.md b/CHANGELOG.md index dd363d96d59a..aab4a5be9e00 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -14,13 +14,13 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 () ### Changed -- TDB +- \[Helm\] Added configurable default storage option to chart () ### Deprecated - TDB ### Removed -- TDB +- \[Helm\] Removed hardcoded mandatory traefik ingress usage() ### Fixed - Calculating number of objects on annotation view when frames are deleted @@ -37,6 +37,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 - Server-side validation for attribute specifications () - \[API\] File downloading failures for filenames with special characters l() +- \[Helm\] fixed issue with multiple caches in same RWX volume, which prevents db migration to start () ### Security - TDB diff --git a/helm-chart/Chart.yaml b/helm-chart/Chart.yaml index 1522abc478fd..b162ea56d9fe 100644 --- a/helm-chart/Chart.yaml +++ b/helm-chart/Chart.yaml @@ -58,4 +58,4 @@ dependencies: - name: traefik version: 10.24.0 repository: https://helm.traefik.io/traefik - condition: ingress.enabled + condition: traefik.enabled diff --git a/helm-chart/cvat.values.yaml b/helm-chart/cvat.values.yaml new file mode 100644 index 000000000000..9765325f3cc1 --- /dev/null +++ b/helm-chart/cvat.values.yaml @@ -0,0 +1,53 @@ +analytics: + enabled: true + +ingress: + enabled: true + annotations: + traefik.ingress.kubernetes.io/router.entrypoints: web + kubernetes.io/ingress.class: traefik + hosts: + - host: cvat.local + paths: + - path: /api + pathType: "Prefix" + service: + name: backend-service + port: 8080 + - path: /admin + pathType: "Prefix" + service: + name: backend-service + port: 8080 + - path: /static + pathType: "Prefix" + service: + name: backend-service + port: 8080 + - path: /django-rq + pathType: "Prefix" + service: + name: backend-service + port: 8080 + - path: /git + pathType: "Prefix" + service: + name: backend-service + port: 8080 + - path: /opencv + pathType: "Prefix" + service: + name: backend-service + port: 8080 + - path: /profiler + pathType: "Prefix" + service: + name: backend-service + port: 8080 + - path : / + pathType: "Prefix" + service: + name: frontend-service + port: 80 +traefik: + enabled: true diff --git a/helm-chart/templates/cvat_backend/server/deployment.yml b/helm-chart/templates/cvat_backend/server/deployment.yml index 1d5c25f88982..4c75648d1779 100644 --- a/helm-chart/templates/cvat_backend/server/deployment.yml +++ b/helm-chart/templates/cvat_backend/server/deployment.yml @@ -114,6 +114,10 @@ spec: ports: - containerPort: 8080 volumeMounts: + {{- if not .Values.cvat.backend.disableDistinctCachePerService }} + - mountPath: /home/django/data/cache + name: cvat-server-backend-cache + {{- end }} - mountPath: /home/django/data name: cvat-backend-data subPath: data @@ -140,6 +144,10 @@ spec: {{- end }} volumeMounts: {{- if .Values.cvat.backend.defaultStorage.enabled }} + {{- if not .Values.cvat.backend.disableDistinctCachePerService }} + - mountPath: /home/django/data/cache + name: cvat-server-backend-cache + {{- end }} - mountPath: /home/django/data name: cvat-backend-data subPath: data @@ -170,6 +178,10 @@ spec: - name: cvat-backend-data persistentVolumeClaim: claimName: "{{ .Release.Name }}-backend-data" + {{- if not .Values.cvat.backend.disableDistinctCachePerService }} + - name: cvat-server-backend-cache + emptyDir: {} + {{- end }} {{- end }} {{- with .Values.cvat.backend.server.additionalVolumes }} {{- toYaml . | nindent 8 }} diff --git a/helm-chart/templates/cvat_backend/storage.yml b/helm-chart/templates/cvat_backend/storage.yml index f30b768ca39b..b21e61df4b6d 100644 --- a/helm-chart/templates/cvat_backend/storage.yml +++ b/helm-chart/templates/cvat_backend/storage.yml @@ -10,8 +10,15 @@ metadata: tier: backend spec: accessModes: - - ReadWriteOnce + {{- if .Values.cvat.backend.defaultStorage.accessModes }} + {{ .Values.cvat.backend.defaultStorage.accessModes | toYaml | nindent 4 }} + {{- else }} + - ReadWriteMany + {{- end }} + {{- if .Values.cvat.backend.defaultStorage.storageClassName }} + storageClassName: {{ .Values.cvat.backend.defaultStorage.storageClassName }} + {{- end }} resources: requests: storage: {{ .Values.cvat.backend.defaultStorage.size }} -{{- end}} +{{- end }} diff --git a/helm-chart/templates/cvat_backend/utils/deployment.yml b/helm-chart/templates/cvat_backend/utils/deployment.yml index e57b056c31ba..12c5dcf0c5be 100644 --- a/helm-chart/templates/cvat_backend/utils/deployment.yml +++ b/helm-chart/templates/cvat_backend/utils/deployment.yml @@ -108,6 +108,10 @@ spec: ports: - containerPort: 8080 volumeMounts: + {{- if not .Values.cvat.backend.disableDistinctCachePerService }} + - mountPath: /home/django/data/cache + name: cvat-utils-backend-cache + {{- end }} - mountPath: /home/django/data name: cvat-backend-data subPath: data @@ -134,6 +138,10 @@ spec: {{- end }} volumeMounts: {{- if .Values.cvat.backend.defaultStorage.enabled }} + {{- if not .Values.cvat.backend.disableDistinctCachePerService }} + - mountPath: /home/django/data/cache + name: cvat-utils-backend-cache + {{- end }} - mountPath: /home/django/data name: cvat-backend-data subPath: data @@ -164,6 +172,11 @@ spec: - name: cvat-backend-data persistentVolumeClaim: claimName: "{{ .Release.Name }}-backend-data" + + {{- if not .Values.cvat.backend.disableDistinctCachePerService }} + - name: cvat-utils-backend-cache + emptyDir: {} + {{- end }} {{- end }} {{- with .Values.cvat.backend.utils.additionalVolumes }} {{- toYaml . | nindent 8 }} diff --git a/helm-chart/templates/cvat_backend/worker_annotation/deployment.yml b/helm-chart/templates/cvat_backend/worker_annotation/deployment.yml index 031a06a4610e..7432ff136d88 100644 --- a/helm-chart/templates/cvat_backend/worker_annotation/deployment.yml +++ b/helm-chart/templates/cvat_backend/worker_annotation/deployment.yml @@ -106,6 +106,10 @@ spec: {{- toYaml . | nindent 10 }} {{- end }} volumeMounts: + {{- if not .Values.cvat.backend.disableDistinctCachePerService }} + - mountPath: /home/django/data/cache + name: cvat-worker-annotation-backend-cache + {{- end }} - mountPath: /home/django/data name: cvat-backend-data subPath: data @@ -135,6 +139,10 @@ spec: {{- end }} volumeMounts: {{- if .Values.cvat.backend.defaultStorage.enabled }} + {{- if not .Values.cvat.backend.disableDistinctCachePerService }} + - mountPath: /home/django/data/cache + name: cvat-worker-annotation-backend-cache + {{- end }} - mountPath: /home/django/data name: cvat-backend-data subPath: data @@ -165,6 +173,8 @@ spec: - name: cvat-backend-data persistentVolumeClaim: claimName: "{{ .Release.Name }}-backend-data" + - name: cvat-worker-annotation-backend-cache + emptyDir: {} {{- end }} {{- with .Values.cvat.backend.worker.annotation.additionalVolumes }} {{- toYaml . | nindent 8 }} diff --git a/helm-chart/templates/cvat_backend/worker_export/deployment.yml b/helm-chart/templates/cvat_backend/worker_export/deployment.yml index 2011a3e79d44..4fd70182528a 100644 --- a/helm-chart/templates/cvat_backend/worker_export/deployment.yml +++ b/helm-chart/templates/cvat_backend/worker_export/deployment.yml @@ -106,6 +106,10 @@ spec: {{- toYaml . | nindent 10 }} {{- end }} volumeMounts: + {{- if not .Values.cvat.backend.disableDistinctCachePerService }} + - mountPath: /home/django/data/cache + name: cvat-worker-export-backend-cache + {{- end }} - mountPath: /home/django/data name: cvat-backend-data subPath: data @@ -135,6 +139,10 @@ spec: {{- end }} volumeMounts: {{- if .Values.cvat.backend.defaultStorage.enabled }} + {{- if not .Values.cvat.backend.disableDistinctCachePerService }} + - mountPath: /home/django/data/cache + name: cvat-worker-export-backend-cache + {{- end }} - mountPath: /home/django/data name: cvat-backend-data subPath: data @@ -165,6 +173,11 @@ spec: - name: cvat-backend-data persistentVolumeClaim: claimName: "{{ .Release.Name }}-backend-data" + + {{- if not .Values.cvat.backend.disableDistinctCachePerService }} + - name: cvat-worker-export-backend-cache + emptyDir: {} + {{- end }} {{- end }} {{- with .Values.cvat.backend.worker.export.additionalVolumes }} {{- toYaml . | nindent 8 }} diff --git a/helm-chart/templates/cvat_backend/worker_import/deployment.yml b/helm-chart/templates/cvat_backend/worker_import/deployment.yml index beb55325eef4..11d80051d7da 100644 --- a/helm-chart/templates/cvat_backend/worker_import/deployment.yml +++ b/helm-chart/templates/cvat_backend/worker_import/deployment.yml @@ -106,6 +106,10 @@ spec: {{- toYaml . | nindent 10 }} {{- end }} volumeMounts: + {{- if not .Values.cvat.backend.disableDistinctCachePerService }} + - mountPath: /home/django/data/cache + name: cvat-worker-import-backend-cache + {{- end }} - mountPath: /home/django/data name: cvat-backend-data subPath: data @@ -135,6 +139,10 @@ spec: {{- end }} volumeMounts: {{- if .Values.cvat.backend.defaultStorage.enabled }} + {{- if not .Values.cvat.backend.disableDistinctCachePerService }} + - mountPath: /home/django/data/cache + name: cvat-worker-import-backend-cache + {{- end }} - mountPath: /home/django/data name: cvat-backend-data subPath: data @@ -165,6 +173,8 @@ spec: - name: cvat-backend-data persistentVolumeClaim: claimName: "{{ .Release.Name }}-backend-data" + - name: cvat-worker-import-backend-cache + emptyDir: {} {{- end }} {{- with .Values.cvat.backend.worker.import.additionalVolumes }} {{- toYaml . | nindent 8 }} diff --git a/helm-chart/templates/cvat_backend/worker_qualityreports/deployment.yml b/helm-chart/templates/cvat_backend/worker_qualityreports/deployment.yml index 490e8f8930a5..b7d05254d57c 100644 --- a/helm-chart/templates/cvat_backend/worker_qualityreports/deployment.yml +++ b/helm-chart/templates/cvat_backend/worker_qualityreports/deployment.yml @@ -25,13 +25,13 @@ spec: {{- with .Values.cvat.backend.worker.qualityreports.labels }} {{- toYaml . | nindent 6 }} {{- end }} - app: cvat-app-worker-qualityreports + app: cvat-app tier: backend component: worker-qualityreports template: metadata: labels: - app: cvat-app-worker-qualityreports + app: cvat-app tier: backend component: worker-qualityreports {{- include "cvat.labels" . | nindent 8 }} diff --git a/tests/values.test.yaml b/helm-chart/test.values.yaml similarity index 87% rename from tests/values.test.yaml rename to helm-chart/test.values.yaml index 58c5b66ccf79..8e85e3944166 100644 --- a/tests/values.test.yaml +++ b/helm-chart/test.values.yaml @@ -1,5 +1,9 @@ cvat: backend: + defaultStorage: + accessModes: + - ReadWriteOnce + disableDistinctCachePerService: true server: additionalVolumeMounts: - mountPath: /home/django/share diff --git a/helm-chart/values.yaml b/helm-chart/values.yaml index 96dd75210839..44c0d2366182 100644 --- a/helm-chart/values.yaml +++ b/helm-chart/values.yaml @@ -101,7 +101,11 @@ cvat: name: http defaultStorage: enabled: true +# storageClassName: default +# accessModes: +# - ReadWriteMany size: 20Gi + disableDistinctCachePerService: false frontend: replicas: 1 image: cvat/ui @@ -211,8 +215,9 @@ postgresql: postgres_password: cvat_postgresql_postgres replication_password: cvat_postgresql_replica + +# See https://github.com/bitnami/charts/blob/master/bitnami/redis/ for more info redis: - #See https://github.com/bitnami/charts/blob/master/bitnami/redis/ for more info enabled: true external: host: 127.0.0.1 @@ -329,59 +334,63 @@ grafana: enabled: false ingress: - enabled: true - annotations: - traefik.ingress.kubernetes.io/router.entrypoints: web - kubernetes.io/ingress.class: traefik - hosts: - - host: cvat.local - paths: - - path: /api - pathType: "Prefix" - service: - name: backend-service - port: 8080 - - path: /admin - pathType: "Prefix" - service: - name: backend-service - port: 8080 - - path: /static - pathType: "Prefix" - service: - name: backend-service - port: 8080 - - path: /django-rq - pathType: "Prefix" - service: - name: backend-service - port: 8080 - - path: /git - pathType: "Prefix" - service: - name: backend-service - port: 8080 - - path: /opencv - pathType: "Prefix" - service: - name: backend-service - port: 8080 - - path: /profiler - pathType: "Prefix" - service: - name: backend-service - port: 8080 - - path : / - pathType: "Prefix" - service: - name: frontend-service - port: 80 - # tls: - # - hosts: - # - - # secretName: ingress-tls-cvat + enabled: false + +# In case you need an ingress, write them manually in your my.values.eml, see example below: +# enabled: true +# annotations: +# traefik.ingress.kubernetes.io/router.entrypoints: web +# kubernetes.io/ingress.class: traefik +# hosts: +# - host: cvat.local +# paths: +# - path: /api +# pathType: "Prefix" +# service: +# name: backend-service +# port: 8080 +# - path: /admin +# pathType: "Prefix" +# service: +# name: backend-service +# port: 8080 +# - path: /static +# pathType: "Prefix" +# service: +# name: backend-service +# port: 8080 +# - path: /django-rq +# pathType: "Prefix" +# service: +# name: backend-service +# port: 8080 +# - path: /git +# pathType: "Prefix" +# service: +# name: backend-service +# port: 8080 +# - path: /opencv +# pathType: "Prefix" +# service: +# name: backend-service +# port: 8080 +# - path: /profiler +# pathType: "Prefix" +# service: +# name: backend-service +# port: 8080 +# - path : / +# pathType: "Prefix" +# service: +# name: frontend-service +# port: 80 +# tls: +# - hosts: +# - +# secretName: ingress-tls-cvat traefik: + enabled: false service: externalIPs: # - "192.168.49.2"