diff --git a/charts/spire/README.md b/charts/spire/README.md index 8a0e83a..4c24570 100644 --- a/charts/spire/README.md +++ b/charts/spire/README.md @@ -372,8 +372,10 @@ Now you can interact with the Spire agent socket from your own application. The | spire-server.nodeSelector | object | `{}` | Select specific nodes to run on (currently only amd64 is supported by Tornjak) | | spire-server.notifier.k8sbundle.namespace | string | `""` | Namespace to push the bundle into, if blank will default to SPIRE Server namespace | | spire-server.persistence.accessMode | string | `"ReadWriteOnce"` | | +| spire-server.persistence.hostPath | string | `""` | Which path to use on the host when type = hostPath | | spire-server.persistence.size | string | `"1Gi"` | | | spire-server.persistence.storageClass | string | `nil` | | +| spire-server.persistence.type | string | `"pvc"` | What type of volume to use for persistence. Valid options pvc (recommended), hostPath, emptyDir (testing only) | | spire-server.podAnnotations | object | `{}` | | | spire-server.podSecurityContext | object | `{}` | | | spire-server.readinessProbe.initialDelaySeconds | int | `5` | Initial delay seconds for readinessProbe | diff --git a/charts/spire/charts/spire-server/README.md b/charts/spire/charts/spire-server/README.md index f0208c3..bc5da26 100644 --- a/charts/spire/charts/spire-server/README.md +++ b/charts/spire/charts/spire-server/README.md @@ -172,8 +172,10 @@ In order to run Tornjak with simple HTTP Connection only, make sure you don't cr | nodeSelector | object | `{}` | Select specific nodes to run on (currently only amd64 is supported by Tornjak) | | notifier.k8sbundle.namespace | string | `""` | Namespace to push the bundle into, if blank will default to SPIRE Server namespace | | persistence.accessMode | string | `"ReadWriteOnce"` | | +| persistence.hostPath | string | `""` | Which path to use on the host when type = hostPath | | persistence.size | string | `"1Gi"` | | | persistence.storageClass | string | `nil` | | +| persistence.type | string | `"pvc"` | What type of volume to use for persistence. Valid options pvc (recommended), hostPath, emptyDir (testing only) | | podAnnotations | object | `{}` | | | podSecurityContext | object | `{}` | | | readinessProbe.initialDelaySeconds | int | `5` | Initial delay seconds for readinessProbe | diff --git a/charts/spire/charts/spire-server/templates/statefulset.yaml b/charts/spire/charts/spire-server/templates/statefulset.yaml index 4a5e148..99523af 100644 --- a/charts/spire/charts/spire-server/templates/statefulset.yaml +++ b/charts/spire/charts/spire-server/templates/statefulset.yaml @@ -3,6 +3,9 @@ {{- $configSum3 := (include (print $.Template.BasePath "/controller-manager-configmap.yaml") . | sha256sum) }} {{- $configSumTornjak := (include (print $.Template.BasePath "/tornjak-config.yaml") . | sha256sum) }} {{- $fullname := include "spire-server.fullname" . }} +{{- if not (has .Values.persistence.type (list "pvc" "hostPath" "emptyDir")) }} +{{- fail "persistence.type must be one of [\"pvc\", \"hostPath\", \"emptyDir\"]" }} +{{- end }} apiVersion: apps/v1 kind: StatefulSet metadata: @@ -285,6 +288,16 @@ spec: {{- if gt (len .Values.extraVolumes) 0 }} {{- toYaml .Values.extraVolumes | nindent 8 }} {{- end }} + {{- if eq .Values.persistence.type "emptyDir" }} + - name: spire-data + emptyDir: {} + {{- else if eq .Values.persistence.type "hostPath" }} + - name: spire-data + hostPath: + path: {{ .Values.persistence.hostPath }} + type: Directory + {{- end }} + {{- if eq .Values.persistence.type "pvc" }} volumeClaimTemplates: - metadata: name: spire-data @@ -297,3 +310,4 @@ spec: {{- if .Values.persistence.storageClass }} storageClassName: {{ .Values.persistence.storageClass }} {{- end }} + {{- end }} diff --git a/charts/spire/charts/spire-server/values.yaml b/charts/spire/charts/spire-server/values.yaml index 3472027..f2843c9 100644 --- a/charts/spire/charts/spire-server/values.yaml +++ b/charts/spire/charts/spire-server/values.yaml @@ -101,9 +101,13 @@ readinessProbe: periodSeconds: 5 persistence: + # -- What type of volume to use for persistence. Valid options pvc (recommended), hostPath, emptyDir (testing only) + type: pvc size: 1Gi accessMode: ReadWriteOnce storageClass: null + # -- Which path to use on the host when type = hostPath + hostPath: "" dataStore: sql: