Skip to content

Commit 96b6555

Browse files
Examples: Create a Block Mode PV and it's Snapshot
1 parent d20999f commit 96b6555

File tree

3 files changed

+41
-0
lines changed

3 files changed

+41
-0
lines changed

examples/csi-pod-raw.yaml

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
apiVersion: v1
2+
kind: Pod
3+
metadata:
4+
name: pod-raw
5+
labels:
6+
name: busybox-test
7+
spec:
8+
restartPolicy: Always
9+
containers:
10+
- image: gcr.io/google_containers/busybox
11+
command: ["/bin/sh", "-c"]
12+
args: [ "tail -f /dev/null" ]
13+
name: busybox
14+
volumeDevices:
15+
- name: vol
16+
devicePath: /dev/loop3 # This device path needs to be replaced with the site specific
17+
volumes:
18+
- name: vol
19+
persistentVolumeClaim:
20+
claimName: pvc-raw

examples/csi-pvc-raw.yaml

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
kind: PersistentVolumeClaim
2+
apiVersion: v1
3+
metadata:
4+
name: pvc-raw
5+
spec:
6+
accessModes:
7+
- ReadWriteOnce
8+
storageClassName: csi-hostpath-sc
9+
volumeMode: Block
10+
resources:
11+
requests:
12+
storage: 1Gi

examples/csi-raw-pv-snapshot.yaml

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
apiVersion: snapshot.storage.k8s.io/v1alpha1
2+
kind: VolumeSnapshot
3+
metadata:
4+
name: raw-pv-snapshot
5+
spec:
6+
snapshotClassName: csi-hostpath-snapclass
7+
source:
8+
name: pvc-raw
9+
kind: PersistentVolumeClaim

0 commit comments

Comments
 (0)