2018-08-02 03:38:51 +00:00
|
|
|
apiVersion: storage.k8s.io/v1
|
|
|
|
kind: StorageClass
|
2017-12-06 02:37:00 +00:00
|
|
|
metadata:
|
2018-08-02 03:38:51 +00:00
|
|
|
name: longhorn
|
|
|
|
provisioner: rancher.io/longhorn
|
|
|
|
parameters:
|
|
|
|
numberOfReplicas: '3'
|
2019-09-19 01:24:10 +00:00
|
|
|
staleReplicaTimeout: '2880'
|
2018-08-02 03:38:51 +00:00
|
|
|
reclaimPolicy: Delete
|
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
|
|
|
storageClassName: longhorn
|
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
|