Require a name for pvcs

This commit is contained in:
Waqar Ahmed 2020-10-09 05:15:39 +05:00
parent 839cad1608
commit 8bd17a7e55
3 changed files with 11 additions and 4 deletions

View File

@ -251,6 +251,8 @@
group: "Storage" group: "Storage"
schema: schema:
type: list type: list
$ref:
- "validations/persistentVolumeClaims"
items: items:
- variable: persistentVolumeClaim - variable: persistentVolumeClaim
label: "Persistent Volume Claim Configuration" label: "Persistent Volume Claim Configuration"
@ -268,6 +270,11 @@
schema: schema:
type: int type: int
required: true required: true
- variable: name
label: "Persistent Volume Claim Name"
schema:
type: string
required: true
# Pod Probes # Pod Probes
# Liveness Probe # Liveness Probe

View File

@ -10,9 +10,9 @@ volumes:
path: {{ $hostPathConfiguration.hostPath }} path: {{ $hostPathConfiguration.hostPath }}
{{- end }} {{- end }}
{{- range $index, $claim := .Values.persistentVolumeClaims }} {{- range $index, $claim := .Values.persistentVolumeClaims }}
- name: ix-pv-{{ $.Release.Name }}-{{ $index }} - name: ix-pv-{{ $claim.name }}
persistentVolumeClaim: persistentVolumeClaim:
claimName: ix-pv-claim-{{ $.Release.Name }}-{{ $index }} claimName: ix-{{ $claim.name }}
{{- end }} {{- end }}
{{- end }} {{- end }}
{{- end }} {{- end }}
@ -30,7 +30,7 @@ volumeMounts:
{{- end }} {{- end }}
{{- range $index, $claim := .Values.persistentVolumeClaims }} {{- range $index, $claim := .Values.persistentVolumeClaims }}
- mountPath: {{ $claim.mountPath }} - mountPath: {{ $claim.mountPath }}
name: ix-pv-{{ $.Release.Name }}-{{ $index }} name: ix-pv-{{ $claim.name }}
{{- end }} {{- end }}
{{- end }} {{- end }}
{{- end }} {{- end }}

View File

@ -3,7 +3,7 @@
apiVersion: v1 apiVersion: v1
kind: PersistentVolumeClaim kind: PersistentVolumeClaim
metadata: metadata:
name: ix-pv-claim-{{ $.Release.Name }}-{{ $index }} name: ix-{{ $claim.name }}
spec: spec:
storageClassName: ix-storage-class-{{ $.Release.Name }} storageClassName: ix-storage-class-{{ $.Release.Name }}
resources: resources: