cw-infra-apps/charts/backend/charts/call-realtime-app-k8s/templates/deployment.yaml

95 lines
3.7 KiB
YAML
Executable File

apiVersion: apps/v1
kind: Deployment
metadata:
name: {{ include "call-realtime-app.fullname" . }}
labels:
{{- include "call-realtime-app.labels" . | nindent 4 }}
annotations:
{{- toYaml .Values.podAnnotations | nindent 4 }}
spec:
replicas: {{ .Values.replicaCount }}
selector:
matchLabels:
{{- include "call-realtime-app.selectorLabels" . | nindent 6 }}
template:
metadata:
annotations:
{{- toYaml .Values.podAnnotations | nindent 8 }}
labels:
{{- include "call-realtime-app.selectorLabels" . | nindent 8 }}
{{- toYaml .Values.podLabels | nindent 8 }}
spec:
volumes:
- name: ca-cert
configMap:
name: auth-app-ca-cert
items:
- key: RootCA_{{ .Values.global.cert_alias }}.crt
path: RootCA_{{ .Values.global.cert_alias }}.crt
- name: cacerts-volume
emptyDir: {}
initContainers:
- name: import-ca
image: "{{ .Values.global.dockerRegistryPrefix }}{{ .Chart.Name }}:{{ .Values.image.tag }}"
env:
- name: CERT_ALIAS
value: {{ .Values.global.cert_alias | quote }}
volumeMounts:
- name: ca-cert
mountPath: /app/resources
- name: cacerts-volume
mountPath: /tmp/cacerts
command:
- sh
- -c
- |
cp /usr/lib/jvm/java-21-amazon-corretto/lib/security/cacerts /tmp/cacerts/cacerts
if keytool -list -keystore /tmp/cacerts/cacerts -storepass changeit -alias gemcert > /dev/null 2>&1; then
echo "Certificate with alias gemcert already exists, skipping import"
else
echo "Importing certificate with alias gemcert"
keytool -import -trustcacerts -storepass changeit -noprompt \
-alias gemcert \
-file /app/resources/RootCA_${CERT_ALIAS}.crt \
-keystore /tmp/cacerts/cacerts
fi
containers:
- name: {{ .Chart.Name }}
image: "{{ .Values.global.dockerRegistryPrefix }}{{ .Chart.Name }}:{{ .Values.image.tag }}"
imagePullPolicy: {{ .Values.image.pullPolicy }}
ports:
- containerPort: 5005
protocol: TCP
- containerPort: 9090
protocol: TCP
env:
{{- include "global.env.cassandra" . | nindent 12 }}
{{- include "global.env.kafka" . | nindent 12 }}
{{- include "global.env.redis" . | nindent 12 }}
{{- include "global.env.general" . | nindent 12 }}
{{- include "global.env.callevent" . | nindent 12 }}
- name: LIVEKIT_API_KEY
valueFrom:
secretKeyRef:
name: {{ .Values.secrets.livekit.name }}
key: {{ .Values.secrets.livekit.apiKeyKey }}
- name: LIVEKIT_SECRET
valueFrom:
secretKeyRef:
name: {{ .Values.secrets.livekit.name }}
key: {{ .Values.secrets.livekit.secretKey }}
- name: RECORDING_ACCESS_KEY
valueFrom:
secretKeyRef:
name: {{ .Values.secrets.recording.name }}
key: {{ .Values.secrets.recording.accessKeyKey }}
- name: RECORDING_SECRET
valueFrom:
secretKeyRef:
name: {{ .Values.secrets.recording.name }}
key: {{ .Values.secrets.recording.secretKey }}
volumeMounts:
- name: cacerts-volume
mountPath: /usr/lib/jvm/java-21-amazon-corretto/lib/security/cacerts
subPath: cacerts