103 lines
3.9 KiB
YAML
Executable File
103 lines
3.9 KiB
YAML
Executable File
apiVersion: apps/v1
|
|
kind: Deployment
|
|
metadata:
|
|
name: {{ include "auth-app-k8s.fullname" . }}
|
|
labels:
|
|
{{- include "auth-app-k8s.labels" . | nindent 4 }}
|
|
io.kompose.service: auth-app
|
|
spec:
|
|
replicas: {{ .Values.replicaCount }}
|
|
selector:
|
|
matchLabels:
|
|
{{- include "auth-app-k8s.selectorLabels" . | nindent 6 }}
|
|
io.kompose.service: auth-app
|
|
template:
|
|
metadata:
|
|
annotations:
|
|
{{- toYaml .Values.podAnnotations | nindent 8 }}
|
|
labels:
|
|
{{- include "auth-app-k8s.selectorLabels" . | nindent 8 }}
|
|
{{- toYaml .Values.podLabels | nindent 8 }}
|
|
spec:
|
|
{{- with .Values.imagePullSecrets }}
|
|
imagePullSecrets:
|
|
{{- toYaml . | nindent 8 }}
|
|
{{- end }}
|
|
volumes:
|
|
- name: ca-cert
|
|
configMap:
|
|
name: {{ include "auth-app-k8s.fullname" . }}-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.image.repository }}:{{ .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 &&
|
|
keytool -import -trustcacerts -storepass changeit -noprompt \
|
|
-alias gemcert \
|
|
-file /app/resources/RootCA_${CERT_ALIAS}.crt \
|
|
-keystore /tmp/cacerts/cacerts
|
|
containers:
|
|
- name: auth-app
|
|
image: "{{ .Values.image.repository }}:{{ .Values.image.tag }}"
|
|
imagePullPolicy: {{ .Values.image.pullPolicy }}
|
|
ports:
|
|
- containerPort: {{ .Values.service.targetPort }}
|
|
{{- if .Values.service.hostPort }}
|
|
hostPort: {{ .Values.service.hostPort }}
|
|
{{- end }}
|
|
protocol: TCP
|
|
env:
|
|
- name: ADMIN_CLIENT_ID
|
|
value: {{ .Values.env.adminClientId | quote }}
|
|
- name: ADMIN_PASSWORD
|
|
valueFrom:
|
|
secretKeyRef:
|
|
name: {{ .Values.secrets.adminPassword.name }}
|
|
key: {{ .Values.secrets.adminPassword.key }}
|
|
- name: ADMIN_REALM
|
|
value: {{ .Values.env.adminRealm | quote }}
|
|
- name: ADMIN_URL
|
|
value: {{ .Values.env.adminUrl | quote }}
|
|
- name: ADMIN_USERNAME
|
|
value: {{ .Values.env.adminUsername | quote }}
|
|
- name: CLIENT_ID
|
|
value: {{ .Values.env.clientId | quote }}
|
|
- name: CLIENT_ISSUER_IRI
|
|
value: {{ .Values.env.clientIssuerIri | quote }}
|
|
- name: CLIENT_REALM
|
|
value: {{ .Values.env.clientRealm | quote }}
|
|
- name: CLIENT_SECRET
|
|
valueFrom:
|
|
secretKeyRef:
|
|
name: {{ .Values.secrets.clientSecret.name }}
|
|
key: {{ .Values.secrets.clientSecret.key }}
|
|
- name: REALM
|
|
value: {{ .Values.env.realm | quote }}
|
|
- name: CERT_ALIAS
|
|
value: {{ .Values.global.cert_alias | quote }}
|
|
- name: SECURITY_ADMIN_REALM
|
|
value: {{ .Values.env.securityAdminRealm | quote }}
|
|
- name: SECURITY_OAUTH2_CLIENT_ISSUER_URI
|
|
value: {{ .Values.env.securityOauth2ClientIssuerUri | quote }}
|
|
volumeMounts:
|
|
- name: cacerts-volume
|
|
mountPath: /usr/lib/jvm/java-21-amazon-corretto/lib/security/cacerts
|
|
subPath: cacerts
|
|
resources:
|
|
{{- toYaml .Values.resources | nindent 12 }} |