longhorn/examples/csi/example_pv.yaml

62 lines
1.2 KiB
YAML
Raw Permalink Normal View History

apiVersion: v1
kind: PersistentVolume
metadata:
2018-08-02 03:38:51 +00:00
name: longhorn-vol-pv
spec:
capacity:
storage: 2Gi
2018-08-02 03:38:51 +00:00
volumeMode: Filesystem
accessModes:
- ReadWriteOnce
2018-08-02 03:38:51 +00:00
persistentVolumeReclaimPolicy: Delete
storageClassName: longhorn
2018-08-02 03:38:51 +00:00
csi:
driver: driver.longhorn.io
2018-08-02 03:38:51 +00:00
fsType: ext4
volumeAttributes:
numberOfReplicas: '3'
staleReplicaTimeout: '2880'
2018-08-02 03:38:51 +00:00
volumeHandle: existing-longhorn-volume
---
apiVersion: v1
kind: PersistentVolumeClaim
metadata:
2018-08-02 03:38:51 +00:00
name: longhorn-vol-pvc
namespace: default
spec:
accessModes:
- ReadWriteOnce
resources:
requests:
storage: 2Gi
2018-08-02 03:38:51 +00:00
volumeName: longhorn-vol-pv
storageClassName: longhorn
---
apiVersion: v1
kind: Pod
metadata:
name: volume-pv-test
namespace: default
spec:
restartPolicy: Always
containers:
- name: volume-pv-test
image: nginx:stable-alpine
imagePullPolicy: IfNotPresent
livenessProbe:
exec:
command:
- ls
- /data/lost+found
initialDelaySeconds: 5
periodSeconds: 5
volumeMounts:
2018-08-02 03:38:51 +00:00
- name: vol
mountPath: /data
ports:
- containerPort: 80
volumes:
2018-08-02 03:38:51 +00:00
- name: vol
persistentVolumeClaim:
2018-08-02 03:38:51 +00:00
claimName: longhorn-vol-pvc