apiVersion: v1 kind: ConfigMap metadata: name: messenger-config namespace: {{ .Release.Namespace }} data: APP_PORT: '8080' VALKEY_COORDINATOR: shard0 VALKEY_SHARDS: {{ include "messenger.shards" . | quote }} {{- range $key, $value := .Values.api.env }} {{ $key }}: {{ $value | quote }} {{- end }} --- apiVersion: v1 kind: Service metadata: name: api namespace: {{ .Release.Namespace }} spec: selector: app: api ports: - port: 8080 targetPort: 8080 --- apiVersion: apps/v1 kind: Deployment metadata: name: api namespace: {{ .Release.Namespace }} spec: replicas: {{ .Values.api.replicas }} selector: matchLabels: app: api template: metadata: annotations: checksum/config: {{ printf "%s%s" (include "messenger.shards" .) (toJson .Values.api.env) | sha256sum }} labels: app: api spec: imagePullSecrets: - name: {{ .Values.imagePullSecret }} terminationGracePeriodSeconds: 10 securityContext: runAsNonRoot: true runAsUser: 65532 seccompProfile: type: RuntimeDefault containers: - name: api image: "{{ .Values.image.repository }}@{{ .Values.image.digest }}" imagePullPolicy: IfNotPresent ports: - containerPort: 8080 envFrom: - configMapRef: name: messenger-config env: - name: DATABASE_URL valueFrom: secretKeyRef: name: {{ .Values.databaseSecret }} key: database-url resources: {{- toYaml .Values.api.resources | nindent 12 }} startupProbe: httpGet: path: /health/ready port: 8080 periodSeconds: 2 failureThreshold: 30 readinessProbe: httpGet: path: /health/ready port: 8080 periodSeconds: 2 livenessProbe: httpGet: path: /health/live port: 8080 periodSeconds: 5 securityContext: readOnlyRootFilesystem: true allowPrivilegeEscalation: false capabilities: drop: [ALL]