mirror of
https://github.com/bjw-s-labs/helm-charts.git
synced 2025-07-03 16:37:04 +02:00
Copy over kah library
This commit is contained in:
parent
c922af6065
commit
61626834fe
57 changed files with 3583 additions and 0 deletions
45
charts/library/common/templates/classes/_pvc.tpl
Normal file
45
charts/library/common/templates/classes/_pvc.tpl
Normal file
|
@ -0,0 +1,45 @@
|
|||
{{/*
|
||||
This template serves as a blueprint for all PersistentVolumeClaim objects that are created
|
||||
within the common library.
|
||||
*/}}
|
||||
{{- define "common.classes.pvc" -}}
|
||||
{{- $values := .Values.persistence -}}
|
||||
{{- if hasKey . "ObjectValues" -}}
|
||||
{{- with .ObjectValues.persistence -}}
|
||||
{{- $values = . -}}
|
||||
{{- end -}}
|
||||
{{ end -}}
|
||||
{{- $pvcName := include "common.names.fullname" . -}}
|
||||
{{- if and (hasKey $values "nameOverride") $values.nameOverride -}}
|
||||
{{- if not (eq $values.nameOverride "-") -}}
|
||||
{{- $pvcName = printf "%v-%v" $pvcName $values.nameOverride -}}
|
||||
{{ end -}}
|
||||
{{ end }}
|
||||
---
|
||||
kind: PersistentVolumeClaim
|
||||
apiVersion: v1
|
||||
metadata:
|
||||
name: {{ $pvcName }}
|
||||
{{- with (merge ($values.labels | default dict) (include "common.labels" $ | fromYaml)) }}
|
||||
labels: {{- toYaml . | nindent 4 }}
|
||||
{{- end }}
|
||||
annotations:
|
||||
{{- if $values.retain }}
|
||||
"helm.sh/resource-policy": keep
|
||||
{{- end }}
|
||||
{{- with (merge ($values.annotations | default dict) (include "common.annotations" $ | fromYaml)) }}
|
||||
{{- toYaml . | nindent 4 }}
|
||||
{{- end }}
|
||||
spec:
|
||||
accessModes:
|
||||
- {{ required (printf "accessMode is required for PVC %v" $pvcName) $values.accessMode | quote }}
|
||||
resources:
|
||||
requests:
|
||||
storage: {{ required (printf "size is required for PVC %v" $pvcName) $values.size | quote }}
|
||||
{{- if $values.storageClass }}
|
||||
storageClassName: {{ if (eq "-" $values.storageClass) }}""{{- else }}{{ $values.storageClass | quote }}{{- end }}
|
||||
{{- end }}
|
||||
{{- if $values.volumeName }}
|
||||
volumeName: {{ $values.volumeName | quote }}
|
||||
{{- end }}
|
||||
{{- end -}}
|
Loading…
Add table
Add a link
Reference in a new issue