Add support for PVC's in ix-chart
This commit is contained in:
parent
1766eb1aaf
commit
c3c8f25c62
|
@ -162,6 +162,7 @@
|
||||||
# Host path based volumes
|
# Host path based volumes
|
||||||
- variable: hostPathVolumes
|
- variable: hostPathVolumes
|
||||||
label: "Host Path Volumes"
|
label: "Host Path Volumes"
|
||||||
|
group: "Storage"
|
||||||
schema:
|
schema:
|
||||||
type: list
|
type: list
|
||||||
items:
|
items:
|
||||||
|
@ -186,3 +187,27 @@
|
||||||
schema:
|
schema:
|
||||||
type: boolean
|
type: boolean
|
||||||
default: false
|
default: false
|
||||||
|
|
||||||
|
# Persistent Volume Claims
|
||||||
|
- variable: persistentVolumeClaims
|
||||||
|
label: "Persistent Volume Claims"
|
||||||
|
group: "Storage"
|
||||||
|
schema:
|
||||||
|
type: list
|
||||||
|
items:
|
||||||
|
- variable: persistentVolumeClaim
|
||||||
|
label: "Persistent Volume Claim Configuration"
|
||||||
|
schema:
|
||||||
|
type: dict
|
||||||
|
attrs:
|
||||||
|
- variable: mountPath
|
||||||
|
label: "Mount Path"
|
||||||
|
description: "Path where the volume will be mounted inside the pod"
|
||||||
|
schema:
|
||||||
|
type: path
|
||||||
|
required: true
|
||||||
|
- variable: capacity
|
||||||
|
label: "Volume Capacity"
|
||||||
|
schema:
|
||||||
|
type: int
|
||||||
|
required: true
|
||||||
|
|
|
@ -20,13 +20,17 @@ spec:
|
||||||
spec:
|
spec:
|
||||||
containers:
|
containers:
|
||||||
- name: {{ .Chart.Name }}
|
- name: {{ .Chart.Name }}
|
||||||
{{- if .Values.hostPathVolumes }}
|
{{- if or .Values.hostPathVolumes .Values.persistentVolumeClaims }}
|
||||||
volumeMounts:
|
volumeMounts:
|
||||||
{{- range $index, $hostPathConfiguration := .Values.hostPathVolumes }}
|
{{- range $index, $hostPathConfiguration := .Values.hostPathVolumes }}
|
||||||
- mountPath: {{ $hostPathConfiguration.mountPath }}
|
- mountPath: {{ $hostPathConfiguration.mountPath }}
|
||||||
name: ix-host-path-{{ $.Release.Name }}-{{ $index }}
|
name: ix-host-path-{{ $.Release.Name }}-{{ $index }}
|
||||||
readOnly: {{ $hostPathConfiguration.readOnly }}
|
readOnly: {{ $hostPathConfiguration.readOnly }}
|
||||||
{{- end }}
|
{{- end }}
|
||||||
|
{{- range $index, $claim := .Values.persistentVolumeClaims }}
|
||||||
|
- mountPath: {{ $claim.mountPath }}
|
||||||
|
name: ix-pv-{{ $.Release.Name }}-{{ $index }}
|
||||||
|
{{- end }}
|
||||||
{{- end }}
|
{{- end }}
|
||||||
securityContext:
|
securityContext:
|
||||||
{{- toYaml .Values.securityContext | nindent 12 }}
|
{{- toYaml .Values.securityContext | nindent 12 }}
|
||||||
|
@ -51,11 +55,16 @@ spec:
|
||||||
value: {{ .value | quote }}
|
value: {{ .value | quote }}
|
||||||
{{- end }}
|
{{- end }}
|
||||||
{{- end }}
|
{{- end }}
|
||||||
{{- if .Values.hostPathVolumes }}
|
{{- if or .Values.persistentVolumeClaims .Values.hostPathVolumes }}
|
||||||
volumes:
|
volumes:
|
||||||
{{- range $index, $hostPathConfiguration := .Values.hostPathVolumes }}
|
{{- range $index, $hostPathConfiguration := .Values.hostPathVolumes }}
|
||||||
- name: ix-host-path-{{ $.Release.Name }}-{{ $index }}
|
- name: ix-host-path-{{ $.Release.Name }}-{{ $index }}
|
||||||
hostPath:
|
hostPath:
|
||||||
path: {{ $hostPathConfiguration.hostPath }}
|
path: {{ $hostPathConfiguration.hostPath }}
|
||||||
{{- end }}
|
{{- end }}
|
||||||
|
{{- range $index, $claim := .Values.persistentVolumeClaims }}
|
||||||
|
- name: ix-pv-{{ $.Release.Name }}-{{ $index }}
|
||||||
|
persistentVolumeClaim:
|
||||||
|
claimName: ix-pv-claim-{{ $.Release.Name }}-{{ $index }}
|
||||||
|
{{- end }}
|
||||||
{{- end }}
|
{{- end }}
|
||||||
|
|
|
@ -0,0 +1,14 @@
|
||||||
|
{{- range $index, $claim := .Values.persistentVolumeClaims }}
|
||||||
|
---
|
||||||
|
apiVersion: v1
|
||||||
|
kind: PersistentVolumeClaim
|
||||||
|
metadata:
|
||||||
|
name: ix-pv-claim-{{ $.Release.Name }}-{{ $index }}
|
||||||
|
spec:
|
||||||
|
storageClassName: ix-storage-class-{{ $.Release.Name }}
|
||||||
|
resources:
|
||||||
|
requests:
|
||||||
|
storage: {{ $claim.capacity }}
|
||||||
|
accessModes:
|
||||||
|
- ReadWriteMany
|
||||||
|
{{- end }}
|
|
@ -16,3 +16,4 @@ externalInterfaces: []
|
||||||
|
|
||||||
# Storage related configuration
|
# Storage related configuration
|
||||||
hostPathVolumes: []
|
hostPathVolumes: []
|
||||||
|
persistentVolumeClaims: []
|
||||||
|
|
Loading…
Reference in New Issue