Kyoo/chart/templates/autosync/deployment.yaml
2024-12-22 22:06:23 +00:00

101 lines
4.1 KiB
YAML

apiVersion: apps/v1
kind: Deployment
metadata:
{{- with (mergeOverwrite (deepCopy .Values.global.deploymentAnnotations) .Values.autosync.deploymentAnnotations) }}
annotations:
{{- range $key, $value := . }}
{{ $key }}: {{ $value | quote }}
{{- end }}
{{- end }}
name: {{ include "kyoo.autosync.fullname" . }}
labels:
{{- include "kyoo.labels" (dict "context" . "component" .Values.autosync.name "name" .Values.autosync.name) | nindent 4 }}
spec:
replicas: {{ .Values.autosync.replicaCount }}
{{- with .Values.autosync.updateStrategy }}
strategy:
{{- toYaml . | nindent 4 }}
{{- end }}
selector:
matchLabels:
{{- include "kyoo.selectorLabels" (dict "context" . "name" .Values.autosync.name) | nindent 6 }}
template:
metadata:
{{- with (mergeOverwrite (deepCopy .Values.global.podAnnotations) .Values.autosync.podAnnotations) }}
annotations:
{{- range $key, $value := . }}
{{ $key }}: {{ $value | quote }}
{{- end }}
{{- end }}
labels:
{{- include "kyoo.labels" (dict "context" . "component" .Values.autosync.name "name" .Values.autosync.name) | nindent 8 }}
{{- with (mergeOverwrite (deepCopy .Values.global.podLabels) .Values.autosync.podLabels) }}
{{- toYaml . | nindent 8 }}
{{- end }}
spec:
{{- with .Values.autosync.imagePullSecrets | default .Values.global.imagePullSecrets }}
imagePullSecrets:
{{- toYaml . | nindent 8 }}
{{- end }}
{{- with .Values.global.securityContext }}
securityContext:
{{- toYaml . | nindent 8 }}
{{- end }}
serviceAccountName: {{ include "kyoo.autosync.serviceAccountName" . }}
containers:
- name: main
image: {{ .Values.autosync.kyoo_autosync.image.repository | default (printf "%s/kyoo_autosync" .Values.global.image.repositoryBase) }}:{{ default (include "kyoo.defaultTag" .) .Values.autosync.kyoo_autosync.image.tag }}
imagePullPolicy: {{ default .Values.global.image.imagePullPolicy }}
args:
{{- with .Values.autosync.kyoo_autosync.extraArgs }}
{{- toYaml . | nindent 12 }}
{{- end }}
env:
- name: RABBITMQ_HOST
value: {{ .Values.global.rabbitmq.host | quote }}
- name: RABBITMQ_PORT
value: {{ .Values.global.rabbitmq.port | quote }}
- name: RABBITMQ_DEFAULT_USER
valueFrom:
secretKeyRef:
key: {{ .Values.global.rabbitmq.kyoo_autosync.userKey }}
name: {{ .Values.global.rabbitmq.kyoo_autosync.existingSecret }}
- name: RABBITMQ_DEFAULT_PASS
valueFrom:
secretKeyRef:
key: {{ .Values.global.rabbitmq.kyoo_autosync.passwordKey }}
name: {{ .Values.global.rabbitmq.kyoo_autosync.existingSecret }}
{{- with (concat .Values.global.extraEnv .Values.autosync.kyoo_autosync.extraEnv) }}
{{- toYaml . | nindent 12 }}
{{- end }}
{{- with .Values.autosync.kyoo_autosync.livenessProbe }}
livenessProbe:
{{- toYaml . | nindent 12 }}
{{- end }}
{{- with .Values.autosync.kyoo_autosync.readinessProbe }}
readinessProbe:
{{- toYaml . | nindent 12 }}
{{- end }}
{{- with .Values.autosync.kyoo_autosync.resources }}
resources:
{{- toYaml . | nindent 12 }}
{{- end }}
{{- with .Values.autosync.kyoo_autosync.containerSecurityContext }}
securityContext:
{{- toYaml . | nindent 12 }}
{{- end }}
{{- with .Values.autosync.kyoo_autosync.extraVolumeMounts }}
volumeMounts:
{{- toYaml . | nindent 12 }}
{{- end }}
{{- with .Values.autosync.extraContainers }}
{{- tpl (toYaml .) $ | nindent 8 }}
{{- end }}
{{- with .Values.autosync.extraInitContainers }}
initContainers:
{{- tpl (toYaml .) $ | nindent 6 }}
{{- end }}
{{- with .Values.autosync.extraVolumes }}
volumes:
{{- toYaml . | nindent 8 }}
{{- end }}