Kyoo/chart/templates/auth/deployment.yaml
2025-11-09 20:13:20 +01:00

120 lines
4.8 KiB
YAML

apiVersion: apps/v1
kind: Deployment
metadata:
{{- with (mergeOverwrite (deepCopy .Values.global.deploymentAnnotations) .Values.auth.deploymentAnnotations) }}
annotations:
{{- range $key, $value := . }}
{{ $key }}: {{ $value | quote }}
{{- end }}
{{- end }}
name: {{ include "kyoo.auth.fullname" . }}
namespace: {{ .Release.Namespace }}
labels:
{{- include "kyoo.labels" (dict "context" . "component" .Values.auth.name "name" .Values.auth.name) | nindent 4 }}
spec:
replicas: {{ .Values.auth.replicaCount }}
{{- with .Values.auth.updateStrategy }}
strategy:
{{- toYaml . | nindent 4 }}
{{- end }}
selector:
matchLabels:
{{- include "kyoo.selectorLabels" (dict "context" . "name" .Values.auth.name) | nindent 6 }}
template:
metadata:
{{- with (mergeOverwrite (deepCopy .Values.global.podAnnotations) .Values.auth.podAnnotations) }}
annotations:
{{- range $key, $value := . }}
{{ $key }}: {{ $value | quote }}
{{- end }}
{{- end }}
labels:
{{- include "kyoo.labels" (dict "context" . "component" .Values.auth.name "name" .Values.auth.name) | nindent 8 }}
{{- with (mergeOverwrite (deepCopy .Values.global.podLabels) .Values.auth.podLabels) }}
{{- toYaml . | nindent 8 }}
{{- end }}
spec:
{{- with .Values.auth.imagePullSecrets | default .Values.global.imagePullSecrets }}
imagePullSecrets:
{{- toYaml . | nindent 8 }}
{{- end }}
{{- with .Values.global.securityContext }}
securityContext:
{{- toYaml . | nindent 8 }}
{{- end }}
serviceAccountName: {{ include "kyoo.auth.serviceAccountName" . }}
containers:
- name: main
image: {{ .Values.auth.kyoo_auth.image.repository | default (printf "%s/kyoo_auth" .Values.global.image.repositoryBase) }}:{{ default (include "kyoo.defaultTag" .) .Values.auth.kyoo_auth.image.tag }}
imagePullPolicy: {{ default .Values.global.image.imagePullPolicy }}
args:
{{- with .Values.auth.kyoo_auth.extraArgs }}
{{- toYaml . | nindent 12 }}
{{- end }}
env:
- name: EXTRA_CLAIMS
value: {{ .Values.kyoo.extraClaims | quote }}
- name: FIRST_USER_CLAIMS
value: {{ .Values.kyoo.firstUserClaims | quote }}
- name: GUEST_CLAIMS
value: {{ .Values.kyoo.guestClaims | quote }}
- name: PROTECTED_CLAIMS
value: {{ .Values.kyoo.protectedClaims | quote }}
- name: PUBLIC_URL
value: {{ .Values.kyoo.address | quote }}
- name: PGUSER
valueFrom:
secretKeyRef:
key: {{ .Values.global.postgres.kyoo_auth.kyoo_auth.userKey }}
name: {{ .Values.global.postgres.kyoo_auth.kyoo_auth.existingSecret }}
- name: PGPASSWORD
valueFrom:
secretKeyRef:
key: {{ .Values.global.postgres.kyoo_auth.kyoo_auth.passwordKey }}
name: {{ .Values.global.postgres.kyoo_auth.kyoo_auth.existingSecret }}
- name: PGDATABASE
value: {{ .Values.global.postgres.kyoo_auth.database }}
- name: PGHOST
value: {{ .Values.global.postgres.kyoo_auth.host | quote }}
- name: PGPORT
value: {{ .Values.global.postgres.kyoo_auth.port | quote }}
- name: PGSSLMODE
value: {{ .Values.global.postgres.kyoo_auth.sslmode | quote }}
{{- with (concat .Values.global.extraEnv .Values.auth.kyoo_auth.extraEnv) }}
{{- toYaml . | nindent 12 }}
{{- end }}
ports:
- name: main
containerPort: 8901
protocol: TCP
{{- with .Values.auth.kyoo_auth.livenessProbe }}
livenessProbe:
{{- toYaml . | nindent 12 }}
{{- end }}
{{- with .Values.auth.kyoo_auth.readinessProbe }}
readinessProbe:
{{- toYaml . | nindent 12 }}
{{- end }}
{{- with .Values.auth.kyoo_auth.resources }}
resources:
{{- toYaml . | nindent 12 }}
{{- end }}
{{- with .Values.auth.kyoo_auth.containerSecurityContext }}
securityContext:
{{- toYaml . | nindent 12 }}
{{- end }}
{{- with .Values.auth.kyoo_auth.extraVolumeMounts }}
volumeMounts:
{{- toYaml . | nindent 12 }}
{{- end }}
{{- with .Values.auth.extraContainers }}
{{- tpl (toYaml .) $ | nindent 8 }}
{{- end }}
{{- with .Values.auth.extraInitContainers }}
initContainers:
{{- tpl (toYaml .) $ | nindent 6 }}
{{- end }}
{{- with .Values.auth.extraVolumes }}
volumes:
{{- toYaml . | nindent 8 }}
{{- end }}