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