2017-12-06 02:37:00 +00:00
|
|
|
apiVersion: v1
|
|
|
|
kind: PersistentVolume
|
|
|
|
metadata:
|
2018-08-02 03:38:51 +00:00
|
|
|
name: longhorn-vol-pv
|
2017-12-06 02:37:00 +00:00
|
|
|
spec:
|
|
|
|
capacity:
|
|
|
|
storage: 2Gi
|
2018-08-02 03:38:51 +00:00
|
|
|
volumeMode: Filesystem
|
2017-12-06 02:37:00 +00:00
|
|
|
accessModes:
|
|
|
|
- ReadWriteOnce
|
2018-08-02 03:38:51 +00:00
|
|
|
persistentVolumeReclaimPolicy: Delete
|
|
|
|
csi:
|
|
|
|
driver: io.rancher.longhorn
|
|
|
|
fsType: ext4
|
|
|
|
volumeAttributes:
|
|
|
|
numberOfReplicas: '3'
|
|
|
|
staleReplicaTimeout: '30'
|
|
|
|
volumeHandle: existing-longhorn-volume
|
2017-12-06 02:37:00 +00:00
|
|
|
---
|
|
|
|
apiVersion: v1
|
|
|
|
kind: PersistentVolumeClaim
|
|
|
|
metadata:
|
2018-08-02 03:38:51 +00:00
|
|
|
name: longhorn-vol-pvc
|
2017-12-06 02:37:00 +00:00
|
|
|
spec:
|
|
|
|
accessModes:
|
|
|
|
- ReadWriteOnce
|
|
|
|
resources:
|
|
|
|
requests:
|
|
|
|
storage: 2Gi
|
2018-08-02 03:38:51 +00:00
|
|
|
volumeName: longhorn-vol-pv
|
2017-12-06 02:37:00 +00:00
|
|
|
---
|
|
|
|
apiVersion: v1
|
|
|
|
kind: Pod
|
|
|
|
metadata:
|
|
|
|
name: volume-test
|
|
|
|
namespace: default
|
|
|
|
spec:
|
|
|
|
containers:
|
|
|
|
- name: volume-test
|
2018-03-22 22:53:42 +00:00
|
|
|
image: nginx:stable-alpine
|
2017-12-06 02:37:00 +00:00
|
|
|
imagePullPolicy: IfNotPresent
|
|
|
|
volumeMounts:
|
2018-08-02 03:38:51 +00:00
|
|
|
- name: vol
|
2017-12-06 02:37:00 +00:00
|
|
|
mountPath: /data
|
|
|
|
ports:
|
|
|
|
- containerPort: 80
|
|
|
|
volumes:
|
2018-08-02 03:38:51 +00:00
|
|
|
- name: vol
|
2017-12-06 02:37:00 +00:00
|
|
|
persistentVolumeClaim:
|
2018-08-02 03:38:51 +00:00
|
|
|
claimName: longhorn-vol-pvc
|