brand-master/brand-master-chart/templates/backend-deployment.yaml
dvirlabs 417b2ef877
Some checks failed
ci/woodpecker/push/woodpecker Pipeline failed
feat: Add admin user, PIN-based password reset, and profile management
- Auto-create admin user on startup with configurable credentials
- Force password change on first admin login
- PIN-based password reset via email (6-digit code)
- Remove demo account notice from login page
- Add complete profile edit with email, phone, address fields
- Add password change functionality in profile
- Add database migration for new user fields
- Update Helm values with admin and email config
2026-05-07 08:09:30 +03:00

107 lines
3.6 KiB
YAML

apiVersion: apps/v1
kind: Deployment
metadata:
name: {{ include "brand-master.fullname" . }}-backend
labels:
{{- include "brand-master.labels" . | nindent 4 }}
app.kubernetes.io/component: backend
spec:
replicas: {{ .Values.backend.replicaCount }}
selector:
matchLabels:
{{- include "brand-master.selectorLabels" . | nindent 6 }}
app.kubernetes.io/component: backend
template:
metadata:
{{- with .Values.podAnnotations }}
annotations:
{{- toYaml . | nindent 8 }}
{{- end }}
labels:
{{- include "brand-master.selectorLabels" . | nindent 8 }}
app.kubernetes.io/component: backend
spec:
{{- with .Values.global.imagePullSecrets }}
imagePullSecrets:
{{- toYaml . | nindent 8 }}
{{- end }}
serviceAccountName: {{ include "brand-master.serviceAccountName" . }}
securityContext:
{{- toYaml .Values.podSecurityContext | nindent 8 }}
initContainers:
- name: wait-for-postgres
image: harbor.dvirlabs.com/base-images/busybox:1.35
command: ['sh', '-c', 'until nc -z {{ include "brand-master.fullname" . }}-db-headless {{ .Values.postgres.port | default 5432 }}; do echo waiting for postgres; sleep 2; done;']
containers:
- name: backend
securityContext:
{{- toYaml .Values.securityContext | nindent 12 }}
image: "{{ .Values.backend.image.repository }}:{{ .Values.backend.image.tag | default .Chart.AppVersion }}"
imagePullPolicy: {{ .Values.backend.image.pullPolicy }}
ports:
- name: http
containerPort: {{ .Values.backend.service.targetPort }}
protocol: TCP
env:
- name: DATABASE_URL
valueFrom:
secretKeyRef:
name: {{ include "brand-master.fullname" . }}-secrets
key: database-url
- name: JWT_SECRET_KEY
valueFrom:
secretKeyRef:
name: {{ include "brand-master.fullname" . }}-secrets
key: jwt-secret-key
- name: JWT_ALGORITHM
valueFrom:
secretKeyRef:
name: {{ include "brand-master.fullname" . }}-secrets
key: jwt-algorithm
- name: ACCESS_TOKEN_EXPIRE_MINUTES
valueFrom:
secretKeyRef:
name: {{ include "brand-master.fullname" . }}-secrets
key: jwt-expire-minutes
{{- range $key, $value := .Values.backend.env }}
- name: {{ $key }}
value: {{ $value | quote }}
{{- end }}
volumeMounts:
{{- if .Values.backend.persistence.enabled }}
- name: uploads
mountPath: {{ .Values.backend.persistence.mountPath }}
{{- end }}
livenessProbe:
httpGet:
path: /
port: http
initialDelaySeconds: 30
periodSeconds: 10
readinessProbe:
httpGet:
path: /
port: http
initialDelaySeconds: 10
periodSeconds: 5
resources:
{{- toYaml .Values.backend.resources | nindent 12 }}
volumes:
{{- if .Values.backend.persistence.enabled }}
- name: uploads
persistentVolumeClaim:
claimName: {{ include "brand-master.fullname" . }}-uploads-pvc
{{- end }}
{{- with .Values.nodeSelector }}
nodeSelector:
{{- toYaml . | nindent 8 }}
{{- end }}
{{- with .Values.affinity }}
affinity:
{{- toYaml . | nindent 8 }}
{{- end }}
{{- with .Values.tolerations }}
tolerations:
{{- toYaml . | nindent 8 }}
{{- end }}