-
Notifications
You must be signed in to change notification settings - Fork 4
Expand file tree
/
Copy pathdev-driver.yaml
More file actions
230 lines (224 loc) · 6.37 KB
/
Copy pathdev-driver.yaml
File metadata and controls
230 lines (224 loc) · 6.37 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
---
apiVersion: storage.k8s.io/v1
kind: CSIDriver
metadata:
name: csi.oras.land
labels:
app.kubernetes.io/part-of: csi-driver-oras
spec:
attachRequired: false
podInfoOnMount: true
volumeLifecycleModes:
- Ephemeral
---
kind: StorageClass
apiVersion: storage.k8s.io/v1
metadata:
name: oras-storage
namespace: kube-system
annotations:
storageclass.kubernetes.io/is-default-class: "true"
provisioner: csi.oras.land
---
apiVersion: v1
kind: ServiceAccount
metadata:
name: csi-oras-node-sa
namespace: kube-system
---
kind: ClusterRole
apiVersion: rbac.authorization.k8s.io/v1
metadata:
name: csi-oras-provisioner-role
rules:
- apiGroups: [""]
resources: ["secrets"]
verbs: ["get", "list"]
- apiGroups: [""]
resources: ["persistentvolumes"]
verbs: ["get", "list", "watch", "create", "delete"]
- apiGroups: [""]
resources: ["persistentvolumeclaims"]
verbs: ["get", "list", "watch", "update"]
- apiGroups: ["storage.k8s.io"]
resources: ["storageclasses"]
verbs: ["get", "list", "watch"]
- apiGroups: [""]
resources: ["events"]
verbs: ["get", "list", "watch", "create", "update", "patch"]
---
kind: ClusterRole
apiVersion: rbac.authorization.k8s.io/v1
metadata:
name: csi-oras-attacher-role
rules:
- apiGroups: [""]
resources: ["persistentvolumes"]
verbs: ["get", "list", "watch", "patch"]
- apiGroups: ["storage.k8s.io"]
resources: ["csinodes"]
verbs: ["get", "list", "watch"]
- apiGroups: ["storage.k8s.io"]
resources: ["volumeattachments"]
verbs: ["get", "list", "watch", "patch"]
- apiGroups: ["storage.k8s.io"]
resources: ["volumeattachments/status"]
verbs: ["patch"]
---
kind: ClusterRole
apiVersion: rbac.authorization.k8s.io/v1
metadata:
name: csi-oras-resizer-role
rules:
- apiGroups: [""]
resources: ["persistentvolumes"]
verbs: ["get", "list", "watch", "update", "patch"]
- apiGroups: [""]
resources: ["persistentvolumeclaims"]
verbs: ["get", "list", "watch"]
- apiGroups: [""]
resources: ["persistentvolumeclaims/status"]
verbs: ["update", "patch"]
- apiGroups: [""]
resources: ["events"]
verbs: ["get", "list", "watch", "create", "update", "patch"]
---
kind: ClusterRole
apiVersion: rbac.authorization.k8s.io/v1
metadata:
name: csi-oras-driver-registrar-node-role
rules:
- apiGroups: [""]
resources: ["events"]
verbs: ["get", "list", "watch", "create", "update", "patch"]
---
kind: ClusterRoleBinding
apiVersion: rbac.authorization.k8s.io/v1
metadata:
name: csi-oras-driver-registrar-node-binding
subjects:
- kind: ServiceAccount
name: csi-oras-node-sa
namespace: kube-system
roleRef:
kind: ClusterRole
name: csi-oras-driver-registrar-node-role
apiGroup: rbac.authorization.k8s.io
---
kind: DaemonSet
apiVersion: apps/v1
metadata:
name: csi-oras-node
namespace: kube-system
labels:
app.kubernetes.io/part-of: csi-driver-oras
spec:
selector:
matchLabels:
app: csi-oras-node
template:
metadata:
labels:
app.kubernetes.io/part-of: csi-driver-oras
app: csi-oras-node
role: csi-oras
spec:
priorityClassName: system-node-critical
serviceAccount: csi-oras-node-sa
hostNetwork: true
containers:
# registrar
- name: driver-registrar
image: quay.io/k8scsi/csi-node-driver-registrar:v1.1.0
args:
- "--v=5"
- "--csi-address=$(ADDRESS)"
- "--kubelet-registration-path=$(DRIVER_REG_SOCK_PATH)"
env:
- name: ADDRESS
value: /csi/csi.sock
- name: DRIVER_REG_SOCK_PATH
value: /var/lib/kubelet/plugins/csi.oras.land/csi.sock
- name: KUBE_NODE_NAME
valueFrom:
fieldRef:
fieldPath: spec.nodeName
volumeMounts:
- name: plugin-dir
mountPath: /csi/
- name: registration-dir
mountPath: /registration/
# ORAS CSI Plugin
- name: csi-oras-plugin
securityContext:
privileged: true
capabilities:
add: ["SYS_ADMIN"]
allowPrivilegeEscalation: true
image: ghcr.io/billy-playground/oras-csi-plugin:0.1.0-dev
args:
- "--mode=node"
- "--csi-endpoint=$(CSI_ENDPOINT)"
- "--node-id=$(NODE_ID)"
- "--root-dir=$(ROOT_DIR)"
- "--plugin-data-dir=$(WORKING_DIR)"
- "--handlers-count=$(HANDLERS_COUNT)"
- "--oras-logging=$(ORAS_LOGGING)"
- "--enforce-namespaces=$(ENFORCE_NAMESPACES)"
env:
- name: CSI_ENDPOINT
value: unix:///csi/csi.sock
- name: NODE_ID
valueFrom:
fieldRef:
fieldPath: spec.nodeName
- name: ENFORCE_NAMESPACES
valueFrom:
configMapKeyRef:
name: csi-oras-config
key: enforce_namespaces
- name: ROOT_DIR
valueFrom:
configMapKeyRef:
name: csi-oras-config
key: csi_root_dir
- name: WORKING_DIR
valueFrom:
configMapKeyRef:
name: csi-oras-config
key: driver_working_dir
- name: HANDLERS_COUNT
valueFrom:
configMapKeyRef:
name: csi-oras-config
key: handlers_count
- name: ORAS_LOGGING
valueFrom:
configMapKeyRef:
name: csi-oras-config
key: oras_logging
imagePullPolicy: "Always"
volumeMounts:
- name: plugin-dir
mountPath: /csi
- name: pods-mount-dir
mountPath: /var/lib/kubelet
mountPropagation: "Bidirectional"
- mountPath: /dev
name: device-dir
volumes:
- name: registration-dir
hostPath:
path: /var/lib/kubelet/plugins_registry/
type: Directory
- name: plugin-dir
hostPath:
path: /var/lib/kubelet/plugins/csi.oras.land
type: DirectoryOrCreate
- name: pods-mount-dir
hostPath:
path: /var/lib/kubelet
type: Directory
- name: device-dir
hostPath:
path: /dev