Skip to content

Commit

Permalink
Create pvs templates
Browse files Browse the repository at this point in the history
  • Loading branch information
Piwero committed Apr 19, 2024
1 parent daf6b2b commit baddc54
Show file tree
Hide file tree
Showing 3 changed files with 41 additions and 2 deletions.
25 changes: 25 additions & 0 deletions piwhelm/templates/_pvs.tpl
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
{{- define "piwhelm.manifest.pvs" }}
{{ $dict := (get .Values.global .Chart.Name) }}
{{- if hasKey $dict "pvs" }}
{{- range $dict.pvs }}
{{- if .enabled -}}
apiVersion: v1
kind: PersistentVolume
metadata:
name: {{ .name | default (printf "%s-config" $.Chart.Name) }}
{{- include "metadata" $ | indent 2 }}
spec:
storageClassName: {{ .storageClassName | default "" | indent 2 }}
capacity:
storage: {{ .capacity.storage }}
{{ toYaml .accessmodes | indent 4 }}
persistentVolumeReclaimPolicy: {{ .persistentVolumeReclaimPolicy | default "Delete" }}
nfs:
path: {{ .nfs.path}}
server: {{ .nfs.server}}
readOnly: {{ .nfs.readOnly }}
---
{{- end }}
{{- end }}
{{- end }}
{{- end }}
2 changes: 2 additions & 0 deletions piwhelm/templates/pvs.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
{{ include "piwhelm.manifest.pvs" . }}

16 changes: 14 additions & 2 deletions piwhelm/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,18 @@ global:
protocol: TCP
port: 443
targetPort: 0000

deployment:
pvs:
- name: ""
enabled: true
storageClassName: ""
capacity:
storage: 1Gi
accessmodes:
accessModes:
- ReadWriteMany
persistentVolumeReclaimPolicy: Retain
nfs:
path: ""
server: ""
readOnly: false

0 comments on commit baddc54

Please sign in to comment.