Merge pull request #315 from spiffe/persistence-type

Add persistence type flag
This commit is contained in:
Edwin Buck
2023-07-26 10:05:50 -05:00
committed by GitHub
4 changed files with 22 additions and 0 deletions
+2
View File
@@ -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.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.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.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.size | string | `"1Gi"` | |
| spire-server.persistence.storageClass | string | `nil` | | | 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.podAnnotations | object | `{}` | |
| spire-server.podSecurityContext | object | `{}` | | | spire-server.podSecurityContext | object | `{}` | |
| spire-server.readinessProbe.initialDelaySeconds | int | `5` | Initial delay seconds for readinessProbe | | spire-server.readinessProbe.initialDelaySeconds | int | `5` | Initial delay seconds for readinessProbe |
@@ -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) | | 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 | | notifier.k8sbundle.namespace | string | `""` | Namespace to push the bundle into, if blank will default to SPIRE Server namespace |
| persistence.accessMode | string | `"ReadWriteOnce"` | | | persistence.accessMode | string | `"ReadWriteOnce"` | |
| persistence.hostPath | string | `""` | Which path to use on the host when type = hostPath |
| persistence.size | string | `"1Gi"` | | | persistence.size | string | `"1Gi"` | |
| persistence.storageClass | string | `nil` | | | 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 | `{}` | | | podAnnotations | object | `{}` | |
| podSecurityContext | object | `{}` | | | podSecurityContext | object | `{}` | |
| readinessProbe.initialDelaySeconds | int | `5` | Initial delay seconds for readinessProbe | | readinessProbe.initialDelaySeconds | int | `5` | Initial delay seconds for readinessProbe |
@@ -3,6 +3,9 @@
{{- $configSum3 := (include (print $.Template.BasePath "/controller-manager-configmap.yaml") . | sha256sum) }} {{- $configSum3 := (include (print $.Template.BasePath "/controller-manager-configmap.yaml") . | sha256sum) }}
{{- $configSumTornjak := (include (print $.Template.BasePath "/tornjak-config.yaml") . | sha256sum) }} {{- $configSumTornjak := (include (print $.Template.BasePath "/tornjak-config.yaml") . | sha256sum) }}
{{- $fullname := include "spire-server.fullname" . }} {{- $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 apiVersion: apps/v1
kind: StatefulSet kind: StatefulSet
metadata: metadata:
@@ -285,6 +288,16 @@ spec:
{{- if gt (len .Values.extraVolumes) 0 }} {{- if gt (len .Values.extraVolumes) 0 }}
{{- toYaml .Values.extraVolumes | nindent 8 }} {{- toYaml .Values.extraVolumes | nindent 8 }}
{{- end }} {{- 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: volumeClaimTemplates:
- metadata: - metadata:
name: spire-data name: spire-data
@@ -297,3 +310,4 @@ spec:
{{- if .Values.persistence.storageClass }} {{- if .Values.persistence.storageClass }}
storageClassName: {{ .Values.persistence.storageClass }} storageClassName: {{ .Values.persistence.storageClass }}
{{- end }} {{- end }}
{{- end }}
@@ -101,9 +101,13 @@ readinessProbe:
periodSeconds: 5 periodSeconds: 5
persistence: persistence:
# -- What type of volume to use for persistence. Valid options pvc (recommended), hostPath, emptyDir (testing only)
type: pvc
size: 1Gi size: 1Gi
accessMode: ReadWriteOnce accessMode: ReadWriteOnce
storageClass: null storageClass: null
# -- Which path to use on the host when type = hostPath
hostPath: ""
dataStore: dataStore:
sql: sql: