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
|
2019-11-13 07:20:19 +00:00
|
|
|
storageClassName: longhorn
|
2018-08-02 03:38:51 +00:00
|
|
|
csi:
|
2019-11-08 06:37:50 +00:00
|
|
|
driver: driver.longhorn.io
|
2018-08-02 03:38:51 +00:00
|
|
|
fsType: ext4
|
|
|
|
volumeAttributes:
|
|
|
|
numberOfReplicas: '3'
|
2019-09-19 01:24:10 +00:00
|
|
|
staleReplicaTimeout: '2880'
|
2018-08-02 03:38:51 +00:00
|
|
|
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
|
2019-11-13 07:20:19 +00:00
|
|
|
storageClassName: longhorn
|
2017-12-06 02:37:00 +00:00
|
|
|
---
|
|
|
|
apiVersion: v1
|
|
|
|
kind: Pod
|
|
|
|
metadata:
|
2019-11-13 07:20:19 +00:00
|
|
|
name: volume-pv-test
|
2017-12-06 02:37:00 +00:00
|
|
|
namespace: default
|
|
|
|
spec:
|
2019-11-13 07:20:19 +00:00
|
|
|
restartPolicy: Always
|
2017-12-06 02:37:00 +00:00
|
|
|
containers:
|
2019-11-13 07:20:19 +00:00
|
|
|
- name: volume-pv-test
|
2018-03-22 22:53:42 +00:00
|
|
|
image: nginx:stable-alpine
|
2017-12-06 02:37:00 +00:00
|
|
|
imagePullPolicy: IfNotPresent
|
2019-11-13 07:20:19 +00:00
|
|
|
livenessProbe:
|
|
|
|
exec:
|
|
|
|
command:
|
|
|
|
- ls
|
|
|
|
- /data/lost+found
|
|
|
|
initialDelaySeconds: 5
|
|
|
|
periodSeconds: 5
|
2017-12-06 02:37:00 +00:00
|
|
|
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
|