Skip to content

Commit f420366

Browse files
committed
Add alpha overlay for snapshots
1 parent b48a7de commit f420366

File tree

7 files changed

+97
-57
lines changed

7 files changed

+97
-57
lines changed

deploy/kubernetes/base/setup-cluster.yaml

Lines changed: 0 additions & 53 deletions
Original file line numberDiff line numberDiff line change
@@ -45,9 +45,6 @@ apiVersion: rbac.authorization.k8s.io/v1
4545
metadata:
4646
name: external-provisioner-role
4747
rules:
48-
- apiGroups: [""]
49-
resources: ["secrets"]
50-
verbs: ["get", "list"]
5148
- apiGroups: [""]
5249
resources: ["persistentvolumes"]
5350
verbs: ["get", "list", "watch", "create", "delete"]
@@ -60,12 +57,6 @@ rules:
6057
- apiGroups: [""]
6158
resources: ["events"]
6259
verbs: ["list", "watch", "create", "update", "patch"]
63-
- apiGroups: ["snapshot.storage.k8s.io"]
64-
resources: ["volumesnapshots"]
65-
verbs: ["get", "list"]
66-
- apiGroups: ["snapshot.storage.k8s.io"]
67-
resources: ["volumesnapshotcontents"]
68-
verbs: ["get", "list"]
6960

7061
---
7162

@@ -116,47 +107,3 @@ roleRef:
116107
kind: ClusterRole
117108
name: external-attacher-role
118109
apiGroup: rbac.authorization.k8s.io
119-
120-
---
121-
# xref: https://github.com/kubernetes-csi/external-snapshotter/blob/master/deploy/kubernetes/rbac.yaml
122-
apiVersion: rbac.authorization.k8s.io/v1
123-
kind: ClusterRole
124-
metadata:
125-
name: external-snapshotter-role
126-
rules:
127-
- apiGroups: ["snapshot.storage.k8s.io"]
128-
resources: ["volumesnapshotclasses"]
129-
verbs: ["get", "list", "watch"]
130-
- apiGroups: ["snapshot.storage.k8s.io"]
131-
resources: ["volumesnapshotcontents"]
132-
verbs: ["create", "get", "list", "watch", "update", "delete"]
133-
- apiGroups: ["snapshot.storage.k8s.io"]
134-
resources: ["volumesnapshots"]
135-
verbs: ["get", "list", "watch", "update"]
136-
- apiGroups: ["apiextensions.k8s.io"]
137-
resources: ["customresourcedefinitions"]
138-
verbs: ["create", "list", "watch", "delete"]
139-
- apiGroups: [""]
140-
resources: ["events"]
141-
verbs: ["list", "watch", "create", "update", "patch"]
142-
- apiGroups: ["storage.k8s.io"]
143-
resources: ["storageclasses"]
144-
verbs: ["watch", "get", "list"]
145-
- apiGroups: ["admissionregistration.k8s.io"]
146-
resources: ["mutatingwebhookconfigurations"]
147-
verbs: ["create"]
148-
149-
---
150-
151-
kind: ClusterRoleBinding
152-
apiVersion: rbac.authorization.k8s.io/v1
153-
metadata:
154-
name: csi-controller-snapshotter-binding
155-
subjects:
156-
- kind: ServiceAccount
157-
name: csi-controller-sa
158-
namespace: default
159-
roleRef:
160-
kind: ClusterRole
161-
name: external-snapshotter-role
162-
apiGroup: rbac.authorization.k8s.io
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
WARNING: DO NOT USE THE ALPHA VERSION OF THE DRIVER FOR PRODUCTION
2+
3+
Alpha features are unsupported and may be unstable and have breaking changes across releases.
Lines changed: 17 additions & 0 deletions
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:v1.0.1
12+
args:
13+
- "--v=5"
14+
- "--csi-address=/csi/csi.sock"
15+
volumeMounts:
16+
- name: socket-dir
17+
mountPath: /csi
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
apiVersion: kustomize.config.k8s.io/v1beta1
2+
kind: Kustomization
3+
bases:
4+
- ../stable
5+
patches:
6+
- controller_add_snapshotter.yaml
7+
patchesJson6902:
8+
- target:
9+
group: rbac.authorization.k8s.io
10+
version: v1
11+
kind: ClusterRole
12+
name: external-provisioner-role
13+
path: rbac_add_snapshots_to_provisioner.yaml
14+
resources:
15+
- rbac_add_snapshotter.yaml
Lines changed: 16 additions & 0 deletions
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"]
Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
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: external-snapshotter-role
6+
rules:
7+
- apiGroups: ["snapshot.storage.k8s.io"]
8+
resources: ["volumesnapshotclasses"]
9+
verbs: ["get", "list", "watch"]
10+
- apiGroups: ["snapshot.storage.k8s.io"]
11+
resources: ["volumesnapshotcontents"]
12+
verbs: ["create", "get", "list", "watch", "update", "delete"]
13+
- apiGroups: ["snapshot.storage.k8s.io"]
14+
resources: ["volumesnapshots"]
15+
verbs: ["get", "list", "watch", "update"]
16+
- apiGroups: ["apiextensions.k8s.io"]
17+
resources: ["customresourcedefinitions"]
18+
verbs: ["create", "list", "watch", "delete"]
19+
- apiGroups: [""]
20+
resources: ["events"]
21+
verbs: ["list", "watch", "create", "update", "patch"]
22+
- apiGroups: ["storage.k8s.io"]
23+
resources: ["storageclasses"]
24+
verbs: ["watch", "get", "list"]
25+
- apiGroups: ["admissionregistration.k8s.io"]
26+
resources: ["mutatingwebhookconfigurations"]
27+
verbs: ["create"]
28+
29+
---
30+
31+
kind: ClusterRoleBinding
32+
apiVersion: rbac.authorization.k8s.io/v1
33+
metadata:
34+
name: csi-controller-snapshotter-binding
35+
subjects:
36+
- kind: ServiceAccount
37+
name: csi-controller-sa
38+
namespace: default
39+
roleRef:
40+
kind: ClusterRole
41+
name: external-snapshotter-role
42+
apiGroup: rbac.authorization.k8s.io

deploy/kubernetes/overlays/dev/kustomization.yaml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,10 +7,10 @@ patches:
77
- controller_always_pull.yaml
88
- node_always_pull.yaml
99
images:
10-
- name: REPLACEME/gcp-compute-persistent-disk-csi-driver
11-
# Replace this with your private image names and tags
12-
newName: gcr.io/gke-release/gcp-compute-persistent-disk-csi-driver
13-
newTag: "v0.4.0-gke.0"
10+
# Replace this with your private image names and tags
11+
#- name: REPLACEME/gcp-compute-persistent-disk-csi-driver
12+
# newName: gcr.io/my-project/gcp-compute-persistent-disk-csi-driver
13+
# newTag: "latest"
1414
- name: REPLACEME/csi-provisioner
1515
newName: gcr.io/gke-release/csi-provisioner
1616
newTag: "v1.0.1-gke.0"

0 commit comments

Comments
 (0)