2018-05-24 21:05:59 +08:00
|
|
|
kind: PersistentVolumeClaim
|
|
|
|
apiVersion: v1
|
|
|
|
metadata:
|
2018-07-28 10:21:34 +08:00
|
|
|
name: test-claim
|
2018-05-24 21:05:59 +08:00
|
|
|
spec:
|
2018-07-28 10:21:34 +08:00
|
|
|
storageClassName: nfs-dynamic-class-01
|
2018-05-24 21:05:59 +08:00
|
|
|
accessModes:
|
|
|
|
- ReadWriteMany
|
|
|
|
resources:
|
|
|
|
requests:
|
|
|
|
storage: 1Mi
|
|
|
|
|
|
|
|
---
|
|
|
|
kind: Pod
|
|
|
|
apiVersion: v1
|
|
|
|
metadata:
|
|
|
|
name: test
|
|
|
|
spec:
|
|
|
|
containers:
|
|
|
|
- name: test
|
2018-08-12 12:20:02 +08:00
|
|
|
image: busybox:1.28.4
|
2018-06-22 18:01:43 +08:00
|
|
|
imagePullPolicy: IfNotPresent
|
2018-05-24 21:05:59 +08:00
|
|
|
command:
|
|
|
|
- "/bin/sh"
|
|
|
|
args:
|
|
|
|
- "-c"
|
2018-07-28 10:21:34 +08:00
|
|
|
- "echo 'hello k8s' > /mnt/SUCCESS && sleep 36000 || exit 1"
|
2018-05-24 21:05:59 +08:00
|
|
|
volumeMounts:
|
|
|
|
- name: nfs-pvc
|
|
|
|
mountPath: "/mnt"
|
|
|
|
restartPolicy: "Never"
|
|
|
|
volumes:
|
|
|
|
- name: nfs-pvc
|
|
|
|
persistentVolumeClaim:
|
2018-07-28 10:21:34 +08:00
|
|
|
claimName: test-claim
|