Skip to content

Commit

Permalink
fix: apl keycloak operator tls (#1646)
Browse files Browse the repository at this point in the history
  • Loading branch information
ElderMatt authored Jul 10, 2024
1 parent 096d9a1 commit 7ef335d
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 5 deletions.
6 changes: 5 additions & 1 deletion charts/apl-keycloak-operator/templates/deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ spec:
{{- toYaml .Values.securityContext | nindent 12 }}
image: "{{ .Values.image.repository }}:{{ .Values.image.tag | default .Chart.AppVersion }}"
imagePullPolicy: {{ .Values.image.pullPolicy }}
{{- if and .Values.configs (not (empty .Values.configs.tls.certificates)) }}
{{- if (not (empty .Values.configs.tls.certificates)) }}
command: ['/bin/sh', '-c']
args: ['export NODE_EXTRA_CA_CERTS=/app/config/tls/certificate.crt && npm run operator:keycloak']
env:
Expand All @@ -42,10 +42,12 @@ spec:
{{- end }}
resources:
{{- toYaml .Values.resources | nindent 12 }}
{{- if (not (empty .Values.configs.tls.certificates)) }}
volumeMounts:
- name: tls-certs
mountPath: /app/config/tls/certificate.crt
subPath: certificate.crt
{{- end }}
{{- with .Values.nodeSelector }}
nodeSelector:
{{- toYaml . | nindent 8 }}
Expand All @@ -59,9 +61,11 @@ spec:
{{- toYaml . | nindent 8 }}
{{- end }}
volumes:
{{- if (not (empty .Values.configs.tls.certificates)) }}
- name: tls-certs
secret:
secretName: keycloak-operator-tls-certs-cm
{{- end }}
- name: operator-config-kc
configMap:
name: apl-keycloak-operator-cm
Expand Down
4 changes: 2 additions & 2 deletions charts/apl-keycloak-operator/templates/secrets.yaml
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
{{- with .Values.configs.tls.certificates.caCert }}
{{- if and .Values.configs .Values.configs.tls .Values.configs.tls.certificates .Values.configs.tls.certificates.caCert }}
apiVersion: v1
kind: Secret
metadata:
name: keycloak-operator-tls-certs-cm
namespace: apl-keycloak-operator
data:
certificate.crt: {{- . | b64enc | nindent 4 }}
certificate.crt: {{- .Values.configs.tls.certificates.caCert | b64enc | nindent 4 }}
{{- end }}
6 changes: 4 additions & 2 deletions values/apl-keycloak-operator/apl-keycloak-operator.gotmpl
Original file line number Diff line number Diff line change
Expand Up @@ -12,12 +12,14 @@ imagePullSecrets:
- name: apl-pullsecret-global
{{- end }}
configs:
{{ if $v._derived.untrustedCA }}
tls:
certificates:
{{ if $v._derived.untrustedCA }}
caCert: |
{{- $v._derived.caCert | nindent 8 }}
{{ end }}
{{- else }}
{}
{{ end }}
script: |
{{- if $v._derived.untrustedCA }}
export NODE_EXTRA_CA_CERTS=/app/config/tls/certificates.crt
Expand Down

0 comments on commit 7ef335d

Please sign in to comment.