Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

helm-chart: add a way to easily set parameters for all backend pods #7148

Merged
merged 1 commit into from
Nov 16, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions changelog.d/20231116_140728_roman_backend_settings.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
### Added

- \[Helm\] Values that apply to all backend deployments/jobs
(<https://github.com/opencv/cvat/pull/7148>)
20 changes: 10 additions & 10 deletions helm-chart/templates/cvat_backend/initializer/job.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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 }}
Expand All @@ -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 }}
Expand All @@ -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 }}
Expand Down
26 changes: 13 additions & 13 deletions helm-chart/templates/cvat_backend/server/deployment.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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 }}
Expand All @@ -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
Expand All @@ -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 }}
Expand All @@ -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 }}
Expand All @@ -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:
Expand All @@ -84,15 +84,15 @@ 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:
{{- if .Values.cvat.backend.permissionFix.enabled }}
- 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 }}
Expand All @@ -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 }}
Expand All @@ -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 }}
Expand Down
26 changes: 13 additions & 13 deletions helm-chart/templates/cvat_backend/utils/deployment.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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 }}
Expand All @@ -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
Expand All @@ -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 }}
Expand All @@ -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:
Expand All @@ -78,15 +78,15 @@ 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:
{{- if .Values.cvat.backend.permissionFix.enabled }}
- 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 }}
Expand All @@ -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 }}
Expand All @@ -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 }}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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 }}
Expand All @@ -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
Expand All @@ -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 }}
Expand All @@ -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 }}
Expand Down
Loading
Loading