Skip to content
This repository has been archived by the owner on Mar 22, 2024. It is now read-only.

Commit

Permalink
Merge pull request #315 from spiffe/persistence-type
Browse files Browse the repository at this point in the history
Add persistence type flag
  • Loading branch information
edwbuck committed Jul 26, 2023
2 parents 624ca9c + e16210c commit 4687e20
Show file tree
Hide file tree
Showing 4 changed files with 22 additions and 0 deletions.
2 changes: 2 additions & 0 deletions charts/spire/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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 |
Expand Down
2 changes: 2 additions & 0 deletions charts/spire/charts/spire-server/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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 |
Expand Down
14 changes: 14 additions & 0 deletions charts/spire/charts/spire-server/templates/statefulset.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down Expand Up @@ -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
Expand All @@ -297,3 +310,4 @@ spec:
{{- if .Values.persistence.storageClass }}
storageClassName: {{ .Values.persistence.storageClass }}
{{- end }}
{{- end }}
4 changes: 4 additions & 0 deletions charts/spire/charts/spire-server/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down

0 comments on commit 4687e20

Please sign in to comment.