Allow to use spire-server as an upstream authority (#304)

Co-authored-by: Marco Franssen <[email protected]>
This commit is contained in:
kfox1111
2023-05-23 14:39:37 +00:00
committed by GitHub
co-authored by Marco Franssen
parent 0ba03880a1
commit 88efc77bee
4 changed files with 29 additions and 0 deletions
@@ -1,4 +1,5 @@
{{- define "spire-server.yaml-config" -}}
{{- $upstreamAuthorityUsed := 0 }}
{{- $root := . }}
server:
bind_address: "0.0.0.0"
@@ -59,6 +60,7 @@ plugins:
{{- with .Values.upstreamAuthority.disk }}
{{- if eq (.enabled | toString) "true" }}
{{- $upstreamAuthorityUsed = add1 $upstreamAuthorityUsed }}
UpstreamAuthority:
- disk:
plugin_data:
@@ -72,6 +74,7 @@ plugins:
{{- with .Values.upstreamAuthority.certManager }}
{{- if eq (.enabled | toString) "true" }}
{{- $upstreamAuthorityUsed = add1 $upstreamAuthorityUsed }}
UpstreamAuthority:
- cert-manager:
plugin_data:
@@ -85,6 +88,21 @@ plugins:
{{- end }}
{{- end }}
{{- with .Values.upstreamAuthority.spire }}
{{- if eq (.enabled | toString) "true" }}
{{- $upstreamAuthorityUsed = add1 $upstreamAuthorityUsed }}
UpstreamAuthority:
- spire:
plugin_data:
server_address: {{ .server.address | quote }}
server_port: {{ .server.port }}
workload_api_socket: "/run/spire/upstream_agent/spire-agent.sock"
{{- end }}
{{- end }}
{{- if gt $upstreamAuthorityUsed 1 }}
{{- fail "You can only enable a single Upstream Authority." }}
{{- end }}
health_checks:
listener_enabled: true
bind_address: "0.0.0.0"