diff --git a/charts/argo-cd/templates/_helpers.tpl b/charts/argo-cd/templates/_helpers.tpl index d34dc0bde..11a15cb29 100644 --- a/charts/argo-cd/templates/_helpers.tpl +++ b/charts/argo-cd/templates/_helpers.tpl @@ -39,6 +39,16 @@ Create dex name and version as used by the chart label. {{- define "argo-cd.dex.fullname" -}} {{- printf "%s-%s" (include "argo-cd.fullname" .) .Values.dex.name | trunc 63 | trimSuffix "-" -}} {{- end -}} +{{/* +Create dex server host and schema. +*/}} +{{- define "argo-cd.dex.serverUrl" -}} +{{- if .Values.dex.tls.enabled -}} +{{- printf "https://%s:%s" (include "argo-cd.dex.fullname" .) .Values.dex.servicePortHttp -}} +{{- else -}} +{{- printf "http://%s:%s" (include "argo-cd.dex.fullname" .) .Values.dex.servicePortHttp -}} +{{- end -}} +{{- end -}} {{/* Create redis name and version as used by the chart label. diff --git a/charts/argo-cd/templates/argocd-server/deployment.yaml b/charts/argo-cd/templates/argocd-server/deployment.yaml index b2ca6af05..aba591d79 100755 --- a/charts/argo-cd/templates/argocd-server/deployment.yaml +++ b/charts/argo-cd/templates/argocd-server/deployment.yaml @@ -48,7 +48,7 @@ spec: - {{ template "argo-cd.repoServer.fullname" . }}:{{ .Values.repoServer.service.port }} {{- if .Values.dex.enabled }} - --dex-server - - http://{{ template "argo-cd.dex.fullname" . }}:{{ .Values.dex.servicePortHttp }} + - {{ template "argo-cd.dex.serverUrl" . }} {{- end }} - --logformat - {{default .Values.global.logging.format .Values.server.logFormat }} diff --git a/charts/argo-cd/templates/dex/deployment.yaml b/charts/argo-cd/templates/dex/deployment.yaml index 6ce4a36db..7ad2e6582 100755 --- a/charts/argo-cd/templates/dex/deployment.yaml +++ b/charts/argo-cd/templates/dex/deployment.yaml @@ -47,6 +47,10 @@ spec: volumeMounts: - mountPath: /shared name: static-files + {{- if .Values.dex.tls.secretName }} + - mountPath: /tls + name: argocd-dex-server-tls + {{- end }} {{- if .Values.dex.initContainers }} {{- toYaml .Values.dex.initContainers | nindent 6 }} {{- end }} @@ -57,6 +61,9 @@ spec: command: - /shared/argocd-dex - rundex + {{- if eq .Values.dex.tls.enabled false }} + - --disable-tls + {{- end }} {{- with .Values.dex.extraArgs }} {{- . | toYaml | nindent 8 }} {{- end }} @@ -143,6 +150,19 @@ spec: volumes: - emptyDir: {} name: tmp-dir + {{- if .Values.dex.tls.secretName }} + - name: dex-server-tls + secret: + secretName: {{ .Values.dex.tls.secretName }} + optional: true + items: + - key: tls.crt + path: tls.crt + - key: tls.key + path: tls.key + - key: ca.crt + path: ca.crt + {{- end }} {{- if .Values.dex.volumes }} {{- toYaml .Values.dex.volumes | nindent 6 }} {{- end }} diff --git a/charts/argo-cd/values.yaml b/charts/argo-cd/values.yaml index a0ec01504..dd7a401c3 100755 --- a/charts/argo-cd/values.yaml +++ b/charts/argo-cd/values.yaml @@ -388,6 +388,12 @@ dex: # -- Additional command line arguments to pass to the Dex server extraArgs: [] + tls: + # -- Use TLS to expose dex server to ArgoCD + enabled: false + # -- Use this secret as a certificate source + secretName: "" + metrics: # -- Deploy metrics service enabled: false