cw-infra-apps/charts/backend/charts/chat-event-handler-app-k8s/templates/deployment.yaml

88 lines
3.5 KiB
YAML
Executable File

apiVersion: apps/v1
kind: Deployment
metadata:
name: {{ include "chat-event-handler-app.fullname" . }}
labels:
{{- include "chat-event-handler-app.labels" . | nindent 4 }}
spec:
replicas: {{ .Values.replicaCount }}
selector:
matchLabels:
app: {{ include "chat-event-handler-app.name" . }}
template:
metadata:
labels:
app: {{ include "chat-event-handler-app.name" . }}
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
hostPort: 5086
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 }}
- name: DEEPLINK_HOST
value: {{ .Values.env.DEEPLINK_HOST }}
- name: DEEPLINK_PORT
value: {{ include "chat-event-handler-app.quote" .Values.env.DEEPLINK_PORT }}
- name: GEM_CALL_HOST
value: {{ .Values.env.GEM_CALL_HOST }}
- name: GEM_CALL_PORT
value: {{ include "chat-event-handler-app.quote" .Values.env.GEM_CALL_PORT }}
- name: MESSAGE_HOST
value: {{ .Values.env.MESSAGE_HOST }}
- name: MESSAGE_PORT
value: {{ .Values.env.MESSAGE_PORT | quote }}
- name: SEARCH_HOST
value: {{ .Values.env.SEARCH_HOST }}
- name: SEARCH_PORT
value: {{ include "chat-event-handler-app.quote" .Values.env.SEARCH_PORT }}
- name: USER_HOST
value: {{ .Values.env.USER_HOST }}
- name: USER_PORT
value: {{ include "chat-event-handler-app.quote" .Values.env.USER_PORT }}
volumeMounts:
- name: cacerts-volume
mountPath: /usr/lib/jvm/java-21-amazon-corretto/lib/security/cacerts
subPath: cacerts
restartPolicy: Always