-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathpvc-example.yaml
41 lines (41 loc) · 889 Bytes
/
pvc-example.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
apiVersion: v1
kind: PersistentVolumeClaim
metadata:
name: nfs-pvc
spec:
accessModes:
- ReadWriteMany
storageClassName: nfs
resources:
requests:
storage: 80Mi
---
apiVersion: apps/v1
kind: Deployment
metadata:
name: busybox-with-pv
spec:
replicas: 2
selector:
matchLabels:
app: busybox-with-pv
template:
metadata:
labels:
app: busybox-with-pv
spec:
containers:
- image: busybox
command:
- sh
- -c
- "while true; do date > /mnt/index-`hostname`.html; hostname >> /mnt/index-`hostname`.html; sleep $(($RANDOM % 5 + 5)); done"
imagePullPolicy: IfNotPresent
name: busybox
volumeMounts:
- name: nfs
mountPath: "/mnt"
volumes:
- name: nfs
persistentVolumeClaim:
claimName: nfs-pvc