add
This commit is contained in:
@@ -0,0 +1,12 @@
|
||||
|
||||
{{- if .Values.enabled }}
|
||||
[INFO] 选择创建 Persistent Volume Claims !
|
||||
|
||||
{{- range $key, $value := .Values.pvc.name_and_capacity }}
|
||||
{{- $applicationName := $key | trunc 63 }}
|
||||
{{- $capacity := $value | trunc 63 | quote }}
|
||||
|
||||
persistence volume claim with name: {{ $applicationName }} and capacity: {{ $capacity}} has been created !
|
||||
|
||||
{{- end }}
|
||||
{{- end }}
|
||||
@@ -0,0 +1,17 @@
|
||||
{{/* vim: set filetype=mustache: */}}
|
||||
{{/*
|
||||
Create chart name and version as used by the chart label.
|
||||
We truncate at 63 chars because some Kubernetes name fields are limited to this (by the DNS naming spec).
|
||||
*/}}
|
||||
{{- define "uavcloud.pvc.chart" -}}
|
||||
{{- printf "%s-%s" $.Chart.Name $.Chart.Version | replace "+" "_" | trunc 63 }}
|
||||
{{- end }}
|
||||
|
||||
{{/*
|
||||
Kubernetes standard labels
|
||||
*/}}
|
||||
{{- define "uavcloud.pvc.labels.standard" -}}
|
||||
helm.sh/chart: {{ include "uavcloud.pvc.chart" $ }}
|
||||
app.kubernetes.io/version: {{ $.Values.global.image.tag }}
|
||||
{{- end -}}
|
||||
|
||||
@@ -0,0 +1,26 @@
|
||||
{{- if .Values.enabled }}
|
||||
{{- $namespace := .Release.Namespace -}}
|
||||
{{- range $key, $value := .Values.pvc.name_and_capacity }}
|
||||
{{- $applicationName := $key | trunc 63 }}
|
||||
{{- $capacity := $value | trunc 63 }}
|
||||
---
|
||||
apiVersion: v1
|
||||
kind: PersistentVolumeClaim
|
||||
metadata:
|
||||
name: {{ $applicationName }}
|
||||
namespace: {{ $namespace }}
|
||||
labels:
|
||||
cmii.type: {{ $.Values.cmii.label }}
|
||||
cmii.app: {{ $applicationName }}
|
||||
{{- include "uavcloud.pvc.labels.standard" $ | nindent 4 }}
|
||||
spec:
|
||||
storageClassName: {{ $.Values.global.pvc.storageClass }}
|
||||
accessModes:
|
||||
- {{ $.Values.global.pvc.accessModes }}
|
||||
volumeMode: {{ $.Values.global.pvc.volumeMode }}
|
||||
resources:
|
||||
requests:
|
||||
storage: {{ $capacity | default $.Values.global.pvc.resources.requests.storage }}
|
||||
---
|
||||
{{- end }}
|
||||
{{- end }}
|
||||
Reference in New Issue
Block a user