mirror of
https://github.com/zoriya/Kyoo.git
synced 2026-02-23 03:30:08 -05:00
172 lines
7.1 KiB
YAML
172 lines
7.1 KiB
YAML
apiVersion: apps/v1
|
|
kind: Deployment
|
|
metadata:
|
|
{{- with (mergeOverwrite (deepCopy .Values.global.deploymentAnnotations) .Values.api.deploymentAnnotations) }}
|
|
annotations:
|
|
{{- range $key, $value := . }}
|
|
{{ $key }}: {{ $value | quote }}
|
|
{{- end }}
|
|
{{- end }}
|
|
name: {{ include "kyoo.api.fullname" . }}
|
|
labels:
|
|
{{- include "kyoo.labels" (dict "context" . "component" .Values.api.name "name" .Values.api.name) | nindent 4 }}
|
|
spec:
|
|
replicas: {{ .Values.api.replicaCount }}
|
|
{{- with .Values.api.updateStrategy }}
|
|
strategy:
|
|
{{- toYaml . | nindent 4 }}
|
|
{{- end }}
|
|
selector:
|
|
matchLabels:
|
|
{{- include "kyoo.selectorLabels" (dict "context" . "name" .Values.api.name) | nindent 6 }}
|
|
template:
|
|
metadata:
|
|
{{- with (mergeOverwrite (deepCopy .Values.global.podAnnotations) .Values.api.podAnnotations) }}
|
|
annotations:
|
|
{{- range $key, $value := . }}
|
|
{{ $key }}: {{ $value | quote }}
|
|
{{- end }}
|
|
{{- end }}
|
|
labels:
|
|
{{- include "kyoo.labels" (dict "context" . "component" .Values.api.name "name" .Values.api.name) | nindent 8 }}
|
|
{{- with (mergeOverwrite (deepCopy .Values.global.podLabels) .Values.api.podLabels) }}
|
|
{{- toYaml . | nindent 8 }}
|
|
{{- end }}
|
|
spec:
|
|
{{- with .Values.api.imagePullSecrets | default .Values.global.imagePullSecrets }}
|
|
imagePullSecrets:
|
|
{{- toYaml . | nindent 8 }}
|
|
{{- end }}
|
|
{{- with .Values.global.securityContext }}
|
|
securityContext:
|
|
{{- toYaml . | nindent 8 }}
|
|
{{- end }}
|
|
serviceAccountName: {{ include "kyoo.api.serviceAccountName" . }}
|
|
initContainers:
|
|
{{- with .Values.api.extraInitContainers }}
|
|
{{- tpl (toYaml .) $ | nindent 6 }}
|
|
{{- end }}
|
|
containers:
|
|
- name: main
|
|
image: {{ .Values.api.kyoo_api.image.repository | default (printf "%s/kyoo_api" .Values.global.image.repositoryBase) }}:{{ default (include "kyoo.defaultTag" .) .Values.api.kyoo_api.image.tag }}
|
|
imagePullPolicy: {{ default .Values.global.image.imagePullPolicy }}
|
|
args:
|
|
{{- with .Values.api.kyoo_api.extraArgs }}
|
|
{{- toYaml . | nindent 12 }}
|
|
{{- end }}
|
|
env:
|
|
- name: TRANSCODER_URL
|
|
value: "http://{{ include "kyoo.transcoder.fullname" . }}:7666/video"
|
|
- name: KYOO_PREFIX
|
|
value: "/api"
|
|
- name: PUBLIC_URL
|
|
value: {{ .Values.kyoo.address | quote }}
|
|
- name: REQUIRE_ACCOUNT_VERIFICATION
|
|
value: {{ .Values.kyoo.requireAccountVerification | quote }}
|
|
- name: DEFAULT_PERMISSIONS
|
|
value: {{ .Values.kyoo.defaultPermissions | quote }}
|
|
- name: UNLOGGED_PERMISSIONS
|
|
value: {{ .Values.kyoo.unloggedPermissions | quote}}
|
|
- name: KYOO_APIKEYS
|
|
valueFrom:
|
|
secretKeyRef:
|
|
key: {{ .Values.kyoo.apikey.apikeyKey }}
|
|
name: {{ .Values.kyoo.apikey.existingSecret }}
|
|
- name: POSTGRES_USER
|
|
valueFrom:
|
|
secretKeyRef:
|
|
key: {{ .Values.global.postgres.kyoo_api.kyoo_api.userKey }}
|
|
name: {{ .Values.global.postgres.kyoo_api.kyoo_api.existingSecret }}
|
|
- name: POSTGRES_PASSWORD
|
|
valueFrom:
|
|
secretKeyRef:
|
|
key: {{ .Values.global.postgres.kyoo_api.kyoo_api.passwordKey }}
|
|
name: {{ .Values.global.postgres.kyoo_api.kyoo_api.existingSecret }}
|
|
- name: POSTGRES_DB
|
|
value: {{ .Values.global.postgres.kyoo_api.database }}
|
|
- name: POSTGRES_SERVER
|
|
value: {{ .Values.global.postgres.kyoo_api.host | quote }}
|
|
- name: POSTGRES_PORT
|
|
value: {{ .Values.global.postgres.kyoo_api.port | quote }}
|
|
{{- range $index, $provider := .Values.kyoo.oidc_providers }}
|
|
- name: OIDC_{{ $provider.name | upper }}_NAME
|
|
value: {{ $provider.name | quote }}
|
|
- name: OIDC_{{ $provider.name | upper }}_LOGO
|
|
value: {{ $provider.logo | quote }}
|
|
- name: OIDC_{{ $provider.name | upper }}_CLIENTID
|
|
valueFrom:
|
|
secretKeyRef:
|
|
key: {{ $provider.clientIdKey }}
|
|
name: {{ $provider.existingSecret }}
|
|
- name: OIDC_{{ $provider.name | upper }}_SECRET
|
|
valueFrom:
|
|
secretKeyRef:
|
|
key: {{ $provider.clientSecretKey }}
|
|
name: {{ $provider.existingSecret }}
|
|
- name: OIDC_{{ $provider.name | upper }}_AUTHORIZATION
|
|
value: {{ $provider.authorizationAddress | quote }}
|
|
- name: OIDC_{{ $provider.name | upper }}_TOKEN
|
|
value: {{ $provider.tokenAddress | quote }}
|
|
- name: OIDC_{{ $provider.name | upper }}_PROFILE
|
|
value: {{ $provider.profileAddress | quote }}
|
|
- name: OIDC_{{ $provider.name | upper }}_SCOPE
|
|
value: {{ $provider.scope | quote }}
|
|
- name: OIDC_{{ $provider.name | upper }}_AUTHMETHOD
|
|
value: {{ $provider.authMethod | default "ClientSecretBasic" | quote }}
|
|
{{- end }}
|
|
{{- with (concat .Values.global.extraEnv .Values.api.kyoo_api.extraEnv) }}
|
|
{{- toYaml . | nindent 12 }}
|
|
{{- end }}
|
|
ports:
|
|
- name: main
|
|
containerPort: 5000
|
|
protocol: TCP
|
|
{{- with .Values.api.kyoo_api.livenessProbe }}
|
|
livenessProbe:
|
|
{{- toYaml . | nindent 12 }}
|
|
{{- end }}
|
|
{{- with .Values.api.kyoo_api.readinessProbe }}
|
|
readinessProbe:
|
|
{{- toYaml . | nindent 12 }}
|
|
{{- end }}
|
|
{{- with .Values.api.kyoo_api.resources }}
|
|
resources:
|
|
{{- toYaml . | nindent 12 }}
|
|
{{- end }}
|
|
{{- with .Values.api.kyoo_api.containerSecurityContext }}
|
|
securityContext:
|
|
{{- toYaml . | nindent 12 }}
|
|
{{- end }}
|
|
volumeMounts:
|
|
{{- if .Values.api.persistence.enabled }}
|
|
- name: apimetadata
|
|
mountPath: /metadata
|
|
{{- end }}
|
|
{{- with .Values.api.kyoo_api.volumeMounts }}
|
|
{{- toYaml . | nindent 12 }}
|
|
{{- end }}
|
|
{{- with .Values.api.kyoo_api.extraVolumeMounts }}
|
|
{{- toYaml . | nindent 12 }}
|
|
{{- end }}
|
|
{{- with .Values.api.extraContainers }}
|
|
{{- tpl (toYaml .) $ | nindent 8 }}
|
|
{{- end }}
|
|
volumes:
|
|
{{- if .Values.api.persistence.enabled }}
|
|
{{- if .Values.api.persistence.existingClaim }}
|
|
- name: apimetadata
|
|
persistentVolumeClaim:
|
|
claimName: {{ .Values.api.persistence.existingClaim }}
|
|
{{- else }}
|
|
- name: apimetadata
|
|
persistentVolumeClaim:
|
|
claimName: {{ include "kyoo.apimetadata.fullname" . }}
|
|
{{- end }}
|
|
{{- end }}
|
|
{{- with .Values.api.volumes }}
|
|
{{- toYaml . | nindent 8 }}
|
|
{{- end }}
|
|
{{- with .Values.api.extraVolumes }}
|
|
{{- toYaml . | nindent 8 }}
|
|
{{- end }}
|