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

118 lines
5.7 KiB
YAML

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