forked from sandervanvugt/cka
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathtask8.yaml
62 lines (58 loc) · 1009 Bytes
/
task8.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
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
apiVersion: v1
kind: Namespace
metadata:
name: myvol
---
apiVersion: storage.k8s.io/v1
kind: StorageClass
metadata:
name: mystorageclass
allowVolumeExpansion: true
provisioner: kubernetes.io/no-provisioner
---
apiVersion: v1
kind: PersistentVolume
metadata:
name: mypv
spec:
capacity:
storage: 1Gi
accessModes:
- ReadWriteOnce
persistentVolumeReclaimPolicy: Recycle
storageClassName: mystorageclass
hostPath:
path: /tmp/pv1
---
apiVersion: v1
kind: PersistentVolumeClaim
metadata:
name: mypvc
namespace: myvol
spec:
accessModes:
- ReadWriteOnce
resources:
requests:
storage: 100Mi
storageClassName: mystorageclass
---
apiVersion: v1
kind: Pod
metadata:
name: pv-pod
namespace: myvol
spec:
containers:
- name: busybox
image: busybox
args:
- sleep
- "3600"
volumeMounts:
- mountPath: "/vol1"
name: myvolume
volumes:
- name: myvolume
persistentVolumeClaim:
claimName: mypvc