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