Skip to content

Commit c7dd73d

Browse files
committed
Add example yaml files for deployment and testing
1 parent 234c01b commit c7dd73d

File tree

6 files changed

+284
-0
lines changed

6 files changed

+284
-0
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,232 @@
1+
apiVersion: v1
2+
kind: ServiceAccount
3+
metadata:
4+
name: csi-service-account
5+
namespace: default
6+
---
7+
apiVersion: rbac.authorization.k8s.io/v1
8+
kind: ClusterRole
9+
metadata:
10+
name: csi-cluster-role
11+
rules:
12+
- apiGroups:
13+
- ""
14+
resources:
15+
- endpoints
16+
verbs:
17+
- create
18+
- delete
19+
- get
20+
- list
21+
- watch
22+
- update
23+
- apiGroups:
24+
- ""
25+
resources:
26+
- persistentvolumes
27+
verbs:
28+
- create
29+
- delete
30+
- get
31+
- list
32+
- watch
33+
- update
34+
- apiGroups:
35+
- ""
36+
resources:
37+
- secrets
38+
verbs:
39+
- get
40+
- list
41+
- apiGroups:
42+
- ""
43+
resources:
44+
- persistentvolumeclaims
45+
verbs:
46+
- get
47+
- list
48+
- watch
49+
- update
50+
- apiGroups:
51+
- ""
52+
resources:
53+
- nodes
54+
verbs:
55+
- get
56+
- list
57+
- watch
58+
- update
59+
- apiGroups:
60+
- storage.k8s.io
61+
resources:
62+
- volumeattachments
63+
verbs:
64+
- get
65+
- list
66+
- watch
67+
- update
68+
- apiGroups:
69+
- storage.k8s.io
70+
resources:
71+
- storageclasses
72+
verbs:
73+
- get
74+
- list
75+
- watch
76+
- apiGroups:
77+
- snapshot.storage.k8s.io
78+
resources:
79+
- volumesnapshotclasses
80+
verbs:
81+
- get
82+
- list
83+
- watch
84+
- apiGroups:
85+
- snapshot.storage.k8s.io
86+
resources:
87+
- volumesnapshotcontents
88+
verbs:
89+
- create
90+
- get
91+
- list
92+
- watch
93+
- update
94+
- delete
95+
- apiGroups:
96+
- snapshot.storage.k8s.io
97+
resources:
98+
- volumesnapshots
99+
verbs:
100+
- create
101+
- get
102+
- list
103+
- watch
104+
- update
105+
- delete
106+
- apiGroups:
107+
- snapshot.storage.k8s.io
108+
resources:
109+
- volumesnapshots/status
110+
verbs:
111+
- update
112+
- apiGroups:
113+
- ""
114+
resources:
115+
- events
116+
verbs:
117+
- list
118+
- watch
119+
- create
120+
- update
121+
- patch
122+
- apiGroups:
123+
- apiextensions.k8s.io
124+
resources:
125+
- customresourcedefinitions
126+
verbs:
127+
- create
128+
- list
129+
- watch
130+
- delete
131+
---
132+
apiVersion: rbac.authorization.k8s.io/v1
133+
kind: ClusterRoleBinding
134+
metadata:
135+
name: csi-role-binding
136+
roleRef:
137+
apiGroup: rbac.authorization.k8s.io
138+
kind: ClusterRole
139+
name: csi-cluster-role
140+
subjects:
141+
- kind: ServiceAccount
142+
name: csi-service-account
143+
namespace: default
144+
---
145+
apiVersion: v1
146+
kind: Pod
147+
metadata:
148+
labels:
149+
app: hostpath-driver
150+
name: csi-pod
151+
namespace: default
152+
spec:
153+
serviceAccount: csi-service-account
154+
containers:
155+
- name: external-provisioner
156+
args:
157+
- --v=5
158+
- --provisioner=csi-hostpath
159+
- --csi-address=/csi/csi.sock
160+
image: xyang105/csi:csi-provisioner
161+
#image: quay.io/k8scsi/csi-provisioner:v0.3.0
162+
imagePullPolicy: IfNotPresent #Always
163+
volumeMounts:
164+
- mountPath: /csi
165+
name: socket-dir
166+
- name: external-snapshotter
167+
args:
168+
- --v=10
169+
- --snapshotter=csi-hostpath
170+
- --csi-address=/csi/csi.sock
171+
image: xyang105/csi:csi-snapshotter
172+
#image: quay.io/k8scsi/csi-snapshotter:v0.3.0
173+
imagePullPolicy: IfNotPresent
174+
volumeMounts:
175+
- mountPath: /csi
176+
name: socket-dir
177+
- name: driver-registrar
178+
args:
179+
- --v=5
180+
- --csi-address=/csi/csi.sock
181+
env:
182+
- name: KUBE_NODE_NAME
183+
valueFrom:
184+
fieldRef:
185+
apiVersion: v1
186+
fieldPath: spec.nodeName
187+
image: quay.io/k8scsi/driver-registrar:v0.3.0
188+
imagePullPolicy: Always
189+
volumeMounts:
190+
- mountPath: /csi
191+
name: socket-dir
192+
- name: external-attacher
193+
args:
194+
- --v=5
195+
- --csi-address=$(ADDRESS)
196+
env:
197+
- name: ADDRESS
198+
value: /csi/csi.sock
199+
image: quay.io/k8scsi/csi-attacher:v0.3.0
200+
imagePullPolicy: Always
201+
volumeMounts:
202+
- mountPath: /csi
203+
name: socket-dir
204+
- name: hostpath-driver
205+
args:
206+
- --v=5
207+
- --endpoint=$(CSI_ENDPOINT)
208+
- --nodeid=$(KUBE_NODE_NAME)
209+
env:
210+
- name: CSI_ENDPOINT
211+
value: unix:///csi/csi.sock
212+
- name: KUBE_NODE_NAME
213+
valueFrom:
214+
fieldRef:
215+
apiVersion: v1
216+
fieldPath: spec.nodeName
217+
image: xyang105/csi:csi-hostpath
218+
imagePullPolicy: IfNotPresent
219+
securityContext:
220+
privileged: true
221+
volumeMounts:
222+
- mountPath: /csi
223+
name: socket-dir
224+
volumes:
225+
- hostPath:
226+
path: /var/lib/kubelet/plugins/csi-hostpath
227+
type: DirectoryOrCreate
228+
name: socket-dir
229+
- hostPath:
230+
path: /var/lib/kubelet/pods
231+
type: DirectoryOrCreate
232+
name: mountpoint-dir

examples/pvc.yaml

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

examples/restore.yaml

+16
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
apiVersion: v1
2+
kind: PersistentVolumeClaim
3+
metadata:
4+
name: hpvc-restore
5+
spec:
6+
storageClassName: csi-hostpath-sc
7+
dataSource:
8+
name: new-snapshot-demo
9+
kind: VolumeSnapshot
10+
apiGroup: snapshot.storage.k8s.io
11+
accessModes:
12+
- ReadWriteOnce
13+
resources:
14+
requests:
15+
storage: 1Gi
16+

examples/snapshot.yaml

+9
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: new-snapshot-demo
5+
spec:
6+
snapshotClassName: csi-hostpath-snapclass
7+
source:
8+
name: hpvc
9+
kind: PersistentVolumeClaim

examples/snapshotclass.yaml

+5
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
apiVersion: snapshot.storage.k8s.io/v1alpha1
2+
kind: VolumeSnapshotClass
3+
metadata:
4+
name: csi-hostpath-snapclass
5+
snapshotter: csi-hostpath

examples/storageclass.yaml

+10
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
metadata:
2+
name: csi-role-binding
3+
roleRef:
4+
apiGroup: rbac.authorization.k8s.io
5+
kind: ClusterRole
6+
name: csi-cluster-role
7+
subjects:
8+
- kind: ServiceAccount
9+
name: csi-service-account
10+
namespace: default

0 commit comments

Comments
 (0)