freeleaps-ops/freeleaps-devops-reconciler/helm-pkg/reconciler/templates/reconciler/deployment.yaml

131 lines
6.3 KiB
YAML

apiVersion: apps/v1
kind: Deployment
metadata:
labels:
app.kubernetes.io/version: {{ .Chart.AppVersion | quote }}
app.kubernetes.io/name: "reconciler"
app.kubernetes.io/managed-by: {{ .Release.Service }}
app.kubernetes.io/instance: {{ .Release.Name }}
{{/* logIngest related code commented out
{{- if .Values.logIngest.enabled }}
annotations:
opentelemetry.io/config-checksum: {{ include (print $.Template.BasePath "/reconciler/opentelemetry.yaml") . | sha256sum }}
{{- end }}
*/}}
name: "reconciler"
namespace: {{ .Release.Namespace | quote }}
spec:
selector:
matchLabels:
app.kubernetes.io/name: "reconciler"
app.kubernetes.io/instance: {{ .Release.Name }}
app.kubernetes.io/version: {{ .Chart.AppVersion | quote }}
app.kubernetes.io/managed-by: {{ .Release.Service }}
replicas: {{ .Values.reconciler.replicas }}
template:
metadata:
labels:
app.kubernetes.io/version: {{ .Chart.AppVersion | quote }}
app.kubernetes.io/name: "reconciler"
app.kubernetes.io/managed-by: {{ .Release.Service }}
app.kubernetes.io/instance: {{ .Release.Name }}
annotations:
app.kubernetes.io/config-checksum: {{ include (print $.Template.BasePath "/reconciler/reconciler-config.yaml") . | sha256sum }}
{{/* logIngest related code commented out
{{- if .Values.logIngest.enabled }}
opentelemetry.io/config-checksum: {{ include (print $.Template.BasePath "/reconciler/opentelemetry.yaml") . | sha256sum }}
sidecar.opentelemetry.io/inject: "{{ .Release.Namespace}}/{{ .Release.Name }}-opentelemetry-collector"
{{- end }}
*/}}
spec:
{{/* logIngest related code commented out
{{- if .Values.logIngest.enabled }}
serviceAccountName: "{{ .Release.Name }}-otel-collector"
{{- end }}
*/}}
containers:
- name: "reconciler"
image: "{{ coalesce .Values.reconciler.image.registry .Values.global.registry "docker.io"}}/{{ coalesce .Values.reconciler.image.repository .Values.global.repository }}/{{ .Values.reconciler.image.name }}:{{ .Values.reconciler.image.tag | default "latest" }}"
imagePullPolicy: {{ .Values.reconciler.image.imagePullPolicy | default "IfNotPresent" }}
ports:
{{- range $port := .Values.reconciler.ports }}
- containerPort: {{ $port.containerPort }}
name: {{ $port.name }}
protocol: {{ $port.protocol }}
{{- end }}
{{- if .Values.reconciler.resources }}
resources:
{{- toYaml .Values.reconciler.resources | nindent 12 }}
{{- end }}
{{- if .Values.reconciler.probes }}
{{- if and (.Values.reconciler.probes.liveness) (eq .Values.reconciler.probes.liveness.type "httpGet") }}
livenessProbe:
httpGet:
path: {{ .Values.reconciler.probes.liveness.config.path }}
port: {{ .Values.reconciler.probes.liveness.config.port }}
{{- if .Values.reconciler.probes.liveness.config.initialDelaySeconds }}
initialDelaySeconds: {{ .Values.reconciler.probes.liveness.config.initialDelaySeconds }}
{{- end }}
{{- if .Values.reconciler.probes.liveness.config.periodSeconds }}
periodSeconds: {{ .Values.reconciler.probes.liveness.config.periodSeconds }}
{{- end }}
{{- if .Values.reconciler.probes.liveness.config.timeoutSeconds }}
timeoutSeconds: {{ .Values.reconciler.probes.liveness.config.timeoutSeconds }}
{{- end }}
{{- if .Values.reconciler.probes.liveness.config.successThreshold }}
successThreshold: {{ .Values.reconciler.probes.liveness.config.successThreshold }}
{{- end }}
{{- if .Values.reconciler.probes.liveness.config.failureThreshold }}
failureThreshold: {{ .Values.reconciler.probes.liveness.config.failureThreshold }}
{{- end }}
{{- if .Values.reconciler.probes.liveness.config.terminationGracePeriodSeconds }}
terminationGracePeriodSeconds: {{ .Values.reconciler.probes.liveness.config.terminationGracePeriodSeconds }}
{{- end }}
{{- end }}
{{- if and (.Values.reconciler.probes.readiness) (eq .Values.reconciler.probes.readiness.type "httpGet") }}
readinessProbe:
httpGet:
path: {{ .Values.reconciler.probes.readiness.config.path }}
port: {{ .Values.reconciler.probes.readiness.config.port }}
{{- if .Values.reconciler.probes.readiness.config.initialDelaySeconds }}
initialDelaySeconds: {{ .Values.reconciler.probes.readiness.config.initialDelaySeconds }}
{{- end }}
{{- if .Values.reconciler.probes.readiness.config.periodSeconds }}
periodSeconds: {{ .Values.reconciler.probes.readiness.config.periodSeconds }}
{{- end }}
{{- if .Values.reconciler.probes.readiness.config.timeoutSeconds }}
timeoutSeconds: {{ .Values.reconciler.probes.readiness.config.timeoutSeconds }}
{{- end }}
{{- if .Values.reconciler.probes.readiness.config.successThreshold }}
successThreshold: {{ .Values.reconciler.probes.readiness.config.successThreshold }}
{{- end }}
{{- if .Values.reconciler.probes.readiness.config.failureThreshold }}
failureThreshold: {{ .Values.reconciler.probes.readiness.config.failureThreshold }}
{{- end }}
{{- if .Values.reconciler.probes.readiness.config.terminationGracePeriodSeconds }}
terminationGracePeriodSeconds: {{ .Values.reconciler.probes.readiness.config.terminationGracePeriodSeconds }}
{{- end }}
{{- end }}
{{- end}}
env:
{{- range $key, $value := .Values.reconciler.configs }}
- name: {{ $key | snakecase | upper }}
valueFrom:
secretKeyRef:
name: reconciler-config
key: {{ $key | snakecase | upper }}
{{- end }}
{{/* logIngest related code commented out
{{- if .Values.logIngest.enabled }}
volumeMounts:
- name: app-logs
mountPath: {{ .Values.logIngest.logPath }}
{{- end }}
*/}}
{{/* logIngest related code commented out
{{- if .Values.logIngest.enabled }}
volumes:
- name: app-logs
emptyDir: {}
{{- end }}
*/}}