Add disk based KeyManager (#627)

* Add disk based KeyManager

Signed-off-by: Eric Cavalcanti <[email protected]>
Signed-off-by: Eric Cavalcanti <[email protected]>

* Change disk to false

Signed-off-by: Eric Cavalcanti <[email protected]>
Signed-off-by: Eric Cavalcanti <[email protected]>

* Change disk to false

Signed-off-by: Eric Cavalcanti <[email protected]>
Signed-off-by: Eric Cavalcanti <[email protected]>

* Fix per requirement

Signed-off-by: Eric Cavalcanti <[email protected]>

* Update information

Signed-off-by: Eric Cavalcanti <[email protected]>

* Detail doc

Signed-off-by: Eric Cavalcanti <[email protected]>

* Test change comment

Signed-off-by: Eric Cavalcanti <[email protected]>

* Commnet better before

Signed-off-by: Eric Cavalcanti <[email protected]>

---------

Signed-off-by: Eric Cavalcanti <[email protected]>
Signed-off-by: Eric Cavalcanti <[email protected]>
Co-authored-by: kfox1111 <[email protected]>
This commit is contained in:
Eric Cavalcanti
2025-07-19 18:06:02 -07:00
committed by GitHub
co-authored by kfox1111
parent d2913ffca0
commit 6581b117a0
4 changed files with 28 additions and 1 deletions
@@ -19,8 +19,11 @@
{{- end }}
{{- end }}
{{- end }}
{{- if and .Values.keyManager.disk.enabled (ne .Values.persistence.type "hostPath") }}
{{- fail "keyManager.disk.enabled is true but persistence.type is not hostPath. Ensure persistence.type is hostPath when keyManager.disk.enabled is true." }}
{{- end }}
{{- if hasPrefix (.Values.socketPath | dir | clean) (.Values.sockets.hostBasePath | clean) }}
{{- fail "The sockets.hostBasePath can not be located under the socketPath direcotry" }}
{{- fail "The sockets.hostBasePath can not be located under the socketPath directory" }}
{{- end }}
{{- end }}
{{- define "spire-agent.yaml-config" -}}
@@ -121,6 +124,12 @@ plugins:
plugin_data:
{{- $keyManagerUsed = add1 $keyManagerUsed }}
{{- end }}
{{- if .Values.keyManager.disk.enabled }}
disk:
plugin_data:
directory: {{ .Values.persistence.hostPath }}
{{- $keyManagerUsed = add1 $keyManagerUsed }}
{{- end }}
{{- if ne $keyManagerUsed 1 }}
{{- fail (printf "You have to enable exactly one Key Manager. There are %d enabled." $keyManagerUsed) }}
{{- end }}