Skip to content

Commit

Permalink
fix: Generate secret key in initContainer instead of python code
Browse files Browse the repository at this point in the history
  • Loading branch information
mathijscarlu committed Jun 7, 2024
1 parent b08c1a2 commit eff69e4
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 0 deletions.
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 @@ -116,6 +116,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

0 comments on commit eff69e4

Please sign in to comment.