added storageclass
This commit is contained in:
parent
7ffbc4214d
commit
1e78436c40
45
pv-pvc-pod.yaml
Normal file
45
pv-pvc-pod.yaml
Normal file
@ -0,0 +1,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
|
||||||
Loading…
Reference in New Issue
Block a user