我PersistentVolume
使用PersistentVolumeClaim
.
我想在吊舱完成后保留 PV。所以我想拥有什么persistentVolumeReclaimPolicy: Reclaim
。
但是,这适用于PersistentVolume
,而不是PersistentVolumeClaim
(AFAIK)。
如何更改动态配置 PV 的这种行为?
kind: PersistentVolumeClaim
apiVersion: v1
metadata:
name: {{ .Release.Name }}-pvc
spec:
accessModes:
- ReadWriteOnce
storageClassName: gp2
resources:
requests:
storage: 6Gi
---
kind: Pod
apiVersion: v1
metadata:
name: "{{ .Release.Name }}-gatling-test"
spec:
restartPolicy: Never
containers:
- name: {{ .Release.Name }}-gatling-test
image: ".../services-api-mvn-builder:latest"
command: ["sh", "-c", 'mvn -B gatling:test -pl csa-testing -DCSA_SERVER={{ template "project.fullname" . }} -DCSA_PORT={{ .Values.service.appPort }}']
volumeMounts:
- name: "{{ .Release.Name }}-test-res"
mountPath: "/tmp/testResults"
volumes:
- name: "{{ .Release.Name }}-test-res"
persistentVolumeClaim:
claimName: "{{ .Release.Name }}-pvc"
#persistentVolumeReclaimPolicy: Retain ???