This repository has been archived by the owner on Nov 14, 2023. It is now read-only.
forked from cvat-ai/cvat
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
helm-chart: make sure database migrations are only run by one process (…
…cvat-ai#6780) To do that, remove the running of migrations from the server pod(s), and add a Kubernetes job to do it instead. This will prevent Django from corrupting the database when two or more instances are started up at the same time.
- Loading branch information
1 parent
b5665cf
commit 6c9ee2f
Showing
5 changed files
with
86 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,72 @@ | ||
apiVersion: batch/v1 | ||
kind: Job | ||
metadata: | ||
# Jobs are mostly immutable, so Helm can't update them when the user upgrades | ||
# a release. Work around this by including the revision in the job name, so that | ||
# every upgrade creates a new job. | ||
# See also <https://github.com/helm/helm/issues/7082>. | ||
name: {{ .Release.Name }}-backend-initializer-r{{ .Release.Revision }} | ||
namespace: {{ .Release.Namespace }} | ||
labels: | ||
app: cvat-app | ||
tier: backend | ||
component: initializer | ||
{{- include "cvat.labels" . | nindent 4 }} | ||
{{- with .Values.cvat.backend.initializer.labels }} | ||
{{- toYaml . | nindent 4 }} | ||
{{- end }} | ||
{{- with .Values.cvat.backend.initializer.annotations }} | ||
annotations: | ||
{{- toYaml . | nindent 4 }} | ||
{{- end }} | ||
spec: | ||
template: | ||
metadata: | ||
labels: | ||
app: cvat-app | ||
tier: backend | ||
component: initializer | ||
{{- include "cvat.labels" . | nindent 8 }} | ||
{{- with .Values.cvat.backend.initializer.labels }} | ||
{{- toYaml . | nindent 8 }} | ||
{{- end }} | ||
{{- with .Values.cvat.backend.initializer.annotations }} | ||
annotations: | ||
{{- toYaml . | nindent 8 }} | ||
{{- end }} | ||
spec: | ||
containers: | ||
- name: cvat-app-backend-initializer-container | ||
image: {{ .Values.cvat.backend.image }}:{{ .Values.cvat.backend.tag }} | ||
imagePullPolicy: {{ .Values.cvat.backend.imagePullPolicy }} | ||
{{- with .Values.cvat.backend.initializer.resources }} | ||
resources: | ||
{{- toYaml . | nindent 12 }} | ||
{{- end }} | ||
args: ["init"] | ||
env: | ||
{{ include "cvat.sharedBackendEnv" . | indent 10 }} | ||
{{- with .Values.cvat.backend.initializer.additionalEnv }} | ||
{{- toYaml . | nindent 10 }} | ||
{{- end }} | ||
{{- with .Values.cvat.backend.initializer.additionalVolumeMounts }} | ||
volumeMounts: | ||
{{- toYaml . | nindent 10 }} | ||
{{- end }} | ||
restartPolicy: OnFailure | ||
{{- with .Values.cvat.backend.initializer.affinity }} | ||
affinity: | ||
{{- toYaml . | nindent 8 }} | ||
{{- end }} | ||
{{- with .Values.cvat.backend.initializer.tolerations }} | ||
tolerations: | ||
{{- toYaml . | nindent 8 }} | ||
{{- end }} | ||
{{- with .Values.cvat.backend.initializer.additionalVolumes }} | ||
volumes: | ||
{{- toYaml . | nindent 8 }} | ||
{{- end }} | ||
{{- with .Values.imagePullSecrets }} | ||
imagePullSecrets: | ||
{{- toYaml . | nindent 8 }} | ||
{{- end }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters