forked from sandervanvugt/ckad
-
Notifications
You must be signed in to change notification settings - Fork 0
/
pv-pvc-pod.yaml
45 lines (45 loc) · 838 Bytes
/
pv-pvc-pod.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
apiVersion: v1
kind: PersistentVolume
metadata:
name: local-pv-volume
spec:
storageClassName: manual
capacity:
storage: 10Gi
accessModes:
- ReadWriteOnce
hostPath:
path: "/mnt/data"
---
apiVersion: v1
kind: PersistentVolumeClaim
metadata:
name: local-pv-claim
namespace: myvol
spec:
storageClassName: manual
accessModes:
- ReadWriteOnce
resources:
requests:
storage: 3Gi
---
apiVersion: v1
kind: Pod
metadata:
name: local-pv-pod
namespace: myvol
spec:
volumes:
- name: local-pv-storage
persistentVolumeClaim:
claimName: local-pv-claim
containers:
- name: local-pv-container
image: nginx
ports:
- containerPort: 80
name: "http-server"
volumeMounts:
- mountPath: "/usr/share/nginx/html"
name: local-pv-storage