initial add of auth

This commit is contained in:
Arlan Lloyd 2025-10-30 04:28:06 +00:00 committed by Zoe Roux
parent ababb67b1a
commit 0943401d03
No known key found for this signature in database
4 changed files with 148 additions and 0 deletions

View File

@ -23,6 +23,24 @@ Create the name of the autosync service account to use
{{- end -}}
{{- end -}}
{{/*
Create kyoo auth name
*/}}
{{- define "kyoo.auth.fullname" -}}
{{- printf "%s-%s" (include "kyoo.fullname" .) .Values.auth.name | trunc 63 | trimSuffix "-" -}}
{{- end -}}
{{/*
Create the name of the auth service account to use
*/}}
{{- define "kyoo.auth.serviceAccountName" -}}
{{- if .Values.auth.serviceAccount.create -}}
{{ default (include "kyoo.auth.fullname" .) .Values.auth.serviceAccount.name }}
{{- else -}}
{{ default "default" .Values.auth.serviceAccount.name }}
{{- end -}}
{{- end -}}
{{/*
Create kyoo back name
*/}}

View File

@ -0,0 +1,93 @@
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" . }}
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: KYOO_URL
value: "http://{{ include "kyoo.back.fullname" . }}:5000/api"
{{- 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 }}

View File

@ -0,0 +1,24 @@
apiVersion: v1
kind: Service
metadata:
{{- if .Values.auth.service.annotations }}
annotations:
{{- range $key, $value := .Values.auth.service.annotations }}
{{ $key }}: {{ $value | quote }}
{{- end }}
{{- end }}
name: {{ include "kyoo.auth.fullname" . }}
labels:
{{- include "kyoo.labels" (dict "context" . "component" .Values.auth.name "name" .Values.auth.name) | nindent 4 }}
{{- with .Values.auth.service.labels }}
{{- toYaml . | nindent 4 }}
{{- end }}
spec:
type: {{ .Values.auth.service.type }}
ports:
- port: 4568
targetPort: 4568
protocol: TCP
name: main
selector:
{{- include "kyoo.selectorLabels" (dict "context" . "name" .Values.auth.name) | nindent 4 }}

View File

@ -0,0 +1,13 @@
{{- if .Values.auth.serviceAccount.create -}}
apiVersion: v1
kind: ServiceAccount
automountServiceAccountToken: {{ .Values.auth.serviceAccount.automount }}
metadata:
name: {{ include "kyoo.auth.serviceAccountName" . }}
labels:
{{- include "kyoo.labels" (dict "context" . "component" .Values.auth.name "name" .Values.auth.name) | nindent 4 }}
{{- with .Values.auth.serviceAccount.annotations }}
annotations:
{{- toYaml . | nindent 4 }}
{{- end }}
{{- end }}