Change spiffe-oidc-provider-config configmap to yaml format
Signed-off-by: Marco Franssen <[email protected]>
This commit is contained in:
@@ -1,4 +1,38 @@
|
|||||||
{{- $oidcSocket := "/run/spire/oidc-sockets/spire-oidc-server.sock" }}
|
{{- $oidcSocket := "/run/spire/oidc-sockets/spire-oidc-server.sock" }}
|
||||||
|
{{- define "spiffe-oidc-discovery-provider.yaml-config" -}}
|
||||||
|
{{- $oidcSocket := .oidcSocket }}
|
||||||
|
{{- with .root }}
|
||||||
|
log_level: {{ .Values.config.logLevel | quote }}
|
||||||
|
|
||||||
|
domains:
|
||||||
|
- "{{ include "spiffe-oidc-discovery-provider.fullname" . }}"
|
||||||
|
- "{{ include "spiffe-oidc-discovery-provider.fullname" . }}.{{ include "spiffe-oidc-discovery-provider.namespace" . }}"
|
||||||
|
- "{{ include "spiffe-oidc-discovery-provider.fullname" . }}.{{ include "spiffe-oidc-discovery-provider.namespace" . }}.svc.{{ include "spiffe-oidc-discovery-provider.cluster-domain" . }}"
|
||||||
|
{{- if gt (len .Values.config.domains) 0 }}
|
||||||
|
{{- .Values.config.domains | toYaml | nindent 2 }}
|
||||||
|
{{- end }}
|
||||||
|
|
||||||
|
{{- if .Values.insecureScheme.enabled }}
|
||||||
|
allow_insecure_scheme: {{ .Values.insecureScheme.enabled }}
|
||||||
|
listen_socket_path: {{ $oidcSocket | quote }}
|
||||||
|
{{- else }}
|
||||||
|
acme:
|
||||||
|
directory_url: {{ .Values.config.acme.directoryUrl | quote }}
|
||||||
|
cache_dir: {{ .Values.config.acme.cacheDir | quote }}
|
||||||
|
tos_accepted: {{ .Values.config.acme.tosAccepted }}
|
||||||
|
email: {{ .Values.config.acme.emailAddress | quote }}
|
||||||
|
{{- end }}
|
||||||
|
|
||||||
|
workload_api:
|
||||||
|
socket_path: {{ include "spiffe-oidc-discovery-provider.workload-api-socket-path" . | quote }}
|
||||||
|
trust_domain: {{ include "spiffe-oidc-discovery-provider.trust-domain" . | quote }}
|
||||||
|
|
||||||
|
health_checks:
|
||||||
|
bind_port: "8008"
|
||||||
|
ready_path: "/ready"
|
||||||
|
live_path: "/live"
|
||||||
|
{{- end }}
|
||||||
|
{{- end }}
|
||||||
apiVersion: v1
|
apiVersion: v1
|
||||||
kind: ConfigMap
|
kind: ConfigMap
|
||||||
metadata:
|
metadata:
|
||||||
@@ -6,39 +40,7 @@ metadata:
|
|||||||
namespace: {{ include "spiffe-oidc-discovery-provider.namespace" . }}
|
namespace: {{ include "spiffe-oidc-discovery-provider.namespace" . }}
|
||||||
data:
|
data:
|
||||||
oidc-discovery-provider.conf: |
|
oidc-discovery-provider.conf: |
|
||||||
log_level = "{{ .Values.config.logLevel }}"
|
{{- include "spiffe-oidc-discovery-provider.yaml-config" (dict "oidcSocket" $oidcSocket "root" .) | fromYaml | toPrettyJson | nindent 4 }}
|
||||||
|
|
||||||
domains = [
|
|
||||||
"{{ include "spiffe-oidc-discovery-provider.fullname" . }}",
|
|
||||||
"{{ include "spiffe-oidc-discovery-provider.fullname" . }}.{{ include "spiffe-oidc-discovery-provider.namespace" . }}",
|
|
||||||
"{{ include "spiffe-oidc-discovery-provider.fullname" . }}.{{ include "spiffe-oidc-discovery-provider.namespace" . }}.svc.{{ include "spiffe-oidc-discovery-provider.cluster-domain" . }}",
|
|
||||||
{{- if gt (len .Values.config.domains) 0 }}
|
|
||||||
"{{- join "\",\n \"" .Values.config.domains }}"
|
|
||||||
{{- end }}
|
|
||||||
]
|
|
||||||
|
|
||||||
{{- if .Values.insecureScheme.enabled }}
|
|
||||||
allow_insecure_scheme = {{ .Values.insecureScheme.enabled }}
|
|
||||||
listen_socket_path = {{ $oidcSocket | quote }}
|
|
||||||
{{- else }}
|
|
||||||
acme {
|
|
||||||
directory_url = "{{ .Values.config.acme.directoryUrl }}"
|
|
||||||
cache_dir = "{{ .Values.config.acme.cacheDir }}"
|
|
||||||
tos_accepted = {{ .Values.config.acme.tosAccepted }}
|
|
||||||
email = "{{ .Values.config.acme.emailAddress }}"
|
|
||||||
}
|
|
||||||
{{- end }}
|
|
||||||
|
|
||||||
workload_api {
|
|
||||||
socket_path = {{ include "spiffe-oidc-discovery-provider.workload-api-socket-path" . | quote }}
|
|
||||||
trust_domain = {{ include "spiffe-oidc-discovery-provider.trust-domain" . | quote }}
|
|
||||||
}
|
|
||||||
|
|
||||||
health_checks {
|
|
||||||
bind_port = "8008"
|
|
||||||
ready_path = "/ready"
|
|
||||||
live_path = "/live"
|
|
||||||
}
|
|
||||||
{{- if .Values.insecureScheme.enabled }}
|
{{- if .Values.insecureScheme.enabled }}
|
||||||
default.conf: |
|
default.conf: |
|
||||||
upstream oidc {
|
upstream oidc {
|
||||||
|
|||||||
Reference in New Issue
Block a user