Skip to content

Commit 680cb80

Browse files
committed
enable 2.x snapshotter side car in PD CSI driver in staging rc
1 parent 7bc35da commit 680cb80

File tree

5 files changed

+87
-4
lines changed

5 files changed

+87
-4
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
kind: StatefulSet
2+
apiVersion: apps/v1
3+
metadata:
4+
name: csi-gce-pd-controller
5+
spec:
6+
template:
7+
spec:
8+
containers:
9+
- name: csi-snapshotter
10+
imagePullPolicy: Always
11+
image: quay.io/k8scsi/csi-snapshotter:v2.1.0
12+
args:
13+
- "--v=5"
14+
- "--csi-address=/csi/csi.sock"
15+
volumeMounts:
16+
- name: socket-dir
17+
mountPath: /csi
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,20 @@
1-
# for external-provisioner
1+
# for external-snapshotter
22
- op: add
33
path: /spec/template/spec/containers/0/args/-
4+
value: "--metrics-address=:22014"
5+
6+
# for external-provisioner
7+
- op: add
8+
path: /spec/template/spec/containers/1/args/-
49
value: "--metrics-address=:22011"
510

611
# for external-attacher
712
- op: add
8-
path: /spec/template/spec/containers/1/args/-
13+
path: /spec/template/spec/containers/2/args/-
914
value: "--metrics-address=:22012"
1015

1116
# for external-resizer
1217
- op: add
13-
path: /spec/template/spec/containers/2/args/-
18+
path: /spec/template/spec/containers/3/args/-
1419
value: "--metrics-address=:22013"
20+

deploy/kubernetes/overlays/prow-gke-release-staging-rc/kustomization.yaml

+13-1
Original file line numberDiff line numberDiff line change
@@ -18,11 +18,23 @@ images:
1818
- name: gke.gcr.io/csi-resizer
1919
newName: gcr.io/gke-release-staging/csi-resizer
2020
newTag: "v0.5.0-gke.0"
21-
21+
patches:
22+
- controller_add_snapshotter.yaml
2223
patchesJson6902:
24+
- target:
25+
group: rbac.authorization.k8s.io
26+
version: v1
27+
kind: ClusterRole
28+
name: csi-gce-pd-provisioner-role
29+
path: rbac_add_snapshots_to_provisioner.yaml
2330
- target:
2431
group: apps
2532
version: v1
2633
kind: StatefulSet
2734
name: csi-gce-pd-controller
2835
path: enable_sidecar_metrics.yaml
36+
resources:
37+
- rbac_add_snapshotter.yaml
38+
# Reapplying namespace transformer to include newly added RBAC rules.
39+
namespace:
40+
gce-pd-csi-driver
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
# arrays without strategic patch merge defined need to be appended
2+
# using jsonpatch
3+
# https://github.com/kubernetes-sigs/kustomize/blob/master/examples/jsonpatch.md
4+
- op: add
5+
path: /rules/-
6+
value:
7+
apiGroups: ["snapshot.storage.k8s.io"]
8+
resources: ["volumesnapshots"]
9+
verbs: ["get", "list"]
10+
11+
- op: add
12+
path: /rules/-
13+
value:
14+
apiGroups: ["snapshot.storage.k8s.io"]
15+
resources: ["volumesnapshotcontents"]
16+
verbs: ["get", "list"]
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
# xref: https://github.com/kubernetes-csi/external-snapshotter/blob/master/deploy/kubernetes/rbac.yaml
2+
apiVersion: rbac.authorization.k8s.io/v1
3+
kind: ClusterRole
4+
metadata:
5+
name: csi-gce-pd-snapshotter-role
6+
rules:
7+
- apiGroups: [""]
8+
resources: ["events"]
9+
verbs: ["list", "watch", "create", "update", "patch"]
10+
# Secrets resource omitted since GCE PD snapshots does not require them
11+
- apiGroups: ["snapshot.storage.k8s.io"]
12+
resources: ["volumesnapshotclasses"]
13+
verbs: ["get", "list", "watch"]
14+
- apiGroups: ["snapshot.storage.k8s.io"]
15+
resources: ["volumesnapshotcontents"]
16+
verbs: ["create", "get", "list", "watch", "update", "delete"]
17+
- apiGroups: ["snapshot.storage.k8s.io"]
18+
resources: ["volumesnapshotcontents/status"]
19+
verbs: ["update"]
20+
---
21+
22+
kind: ClusterRoleBinding
23+
apiVersion: rbac.authorization.k8s.io/v1
24+
metadata:
25+
name: csi-gce-pd-controller-snapshotter-binding
26+
subjects:
27+
- kind: ServiceAccount
28+
name: csi-gce-pd-controller-sa
29+
roleRef:
30+
kind: ClusterRole
31+
name: csi-gce-pd-snapshotter-role
32+
apiGroup: rbac.authorization.k8s.io

0 commit comments

Comments
 (0)