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

fix: Generate secret key in initContainer instead of python code #8003

Open
wants to merge 2 commits into
base: develop
Choose a base branch
from
Open
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
15 changes: 15 additions & 0 deletions helm-chart/templates/cvat_backend/server/deployment.yml
Original file line number Diff line number Diff line change
Expand Up @@ -117,6 +117,21 @@ spec:
{{- toYaml . | nindent 10 }}
{{- end }}
{{- end }}
{{- if .Values.cvat.backend.initSecretKey.enabled }}
- name: generate-secret-key
image: busybox
command: ["bin/sh", "-c", "SECRET_KEY=$(tr -dc A-Za-z0-9 </dev/urandom | head -c 50) && echo \"SECRET_KEY = \'$SECRET_KEY\' \" > /home/django/keys/secret_key.py"]
{{- with merge $localValues.resources .Values.cvat.backend.resources }}
resources:
{{- toYaml . | nindent 12 }}
{{- end }}
volumeMounts:
{{- if .Values.cvat.backend.defaultStorage.enabled }}
- mountPath: /home/django/keys
name: cvat-backend-data
subPath: keys
{{- end }}
{{- end }}
{{- with merge $localValues.affinity .Values.cvat.backend.affinity }}
affinity:
{{- toYaml . | nindent 8 }}
Expand Down
2 changes: 2 additions & 0 deletions helm-chart/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -119,6 +119,8 @@ cvat:
imagePullPolicy: Always
permissionFix:
enabled: true
initSecretKey:
enabled: false
service:
annotations:
traefik.ingress.kubernetes.io/service.sticky.cookie: "true"
Expand Down