Skip to content

Enable csi snapshotter in stable overlay #507

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions deploy/kubernetes/base/controller.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,14 @@ spec:
volumeMounts:
- name: socket-dir
mountPath: /csi
- name: csi-snapshotter
image: gke.gcr.io/csi-snapshotter
args:
- "--v=5"
- "--csi-address=/csi/csi.sock"
volumeMounts:
- name: socket-dir
mountPath: /csi
- name: gce-pd-driver
# Don't change base image without changing pdImagePlaceholder in
# test/k8s-integration/main.go
Expand Down
40 changes: 39 additions & 1 deletion deploy/kubernetes/base/setup-cluster.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,12 @@ rules:
- apiGroups: [""]
resources: ["nodes"]
verbs: ["get", "list", "watch"]

- apiGroups: ["snapshot.storage.k8s.io"]
resources: ["volumesnapshots"]
verbs: ["get", "list"]
- apiGroups: ["snapshot.storage.k8s.io"]
resources: ["volumesnapshotcontents"]
verbs: ["get", "list"]
---

kind: ClusterRoleBinding
Expand Down Expand Up @@ -193,3 +198,36 @@ roleRef:
subjects:
- kind: ServiceAccount
name: csi-gce-pd-node-sa

---
apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRole
metadata:
name: csi-gce-pd-snapshotter-role
rules:
- apiGroups: [""]
resources: ["events"]
verbs: ["list", "watch", "create", "update", "patch"]
# Secrets resource omitted since GCE PD snapshots does not require them
- apiGroups: ["snapshot.storage.k8s.io"]
resources: ["volumesnapshotclasses"]
verbs: ["get", "list", "watch"]
- apiGroups: ["snapshot.storage.k8s.io"]
resources: ["volumesnapshotcontents"]
verbs: ["create", "get", "list", "watch", "update", "delete"]
- apiGroups: ["snapshot.storage.k8s.io"]
resources: ["volumesnapshotcontents/status"]
verbs: ["update"]
---

kind: ClusterRoleBinding
apiVersion: rbac.authorization.k8s.io/v1
metadata:
name: csi-gce-pd-controller-snapshotter-binding
subjects:
- kind: ServiceAccount
name: csi-gce-pd-controller-sa
roleRef:
kind: ClusterRole
name: csi-gce-pd-snapshotter-role
apiGroup: rbac.authorization.k8s.io
17 changes: 0 additions & 17 deletions deploy/kubernetes/overlays/alpha/controller_add_snapshotter.yaml

This file was deleted.

15 changes: 1 addition & 14 deletions deploy/kubernetes/overlays/alpha/kustomization.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,17 +2,4 @@ apiVersion: kustomize.config.k8s.io/v1beta1
kind: Kustomization
bases:
- ../stable
patches:
- controller_add_snapshotter.yaml
patchesJson6902:
- target:
group: rbac.authorization.k8s.io
version: v1
kind: ClusterRole
name: csi-gce-pd-provisioner-role
path: rbac_add_snapshots_to_provisioner.yaml
resources:
- rbac_add_snapshotter.yaml
# Reapplying namespace transformer to include newly added RBAC rules.
namespace:
gce-pd-csi-driver

This file was deleted.

48 changes: 0 additions & 48 deletions deploy/kubernetes/overlays/alpha/rbac_add_snapshotter.yaml

This file was deleted.

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -18,17 +18,6 @@ images:
- name: gke.gcr.io/csi-resizer
newName: quay.io/k8scsi/csi-resizer
newTag: "canary"
patches:
- controller_add_snapshotter.yaml
patchesJson6902:
- target:
group: rbac.authorization.k8s.io
version: v1
kind: ClusterRole
name: csi-gce-pd-provisioner-role
path: rbac_add_snapshots_to_provisioner.yaml
resources:
- rbac_add_snapshotter.yaml
# Reapplying namespace transformer to include newly added RBAC rules.
namespace:
gce-pd-csi-driver
- name: gke.gcr.io/csi-snapshotter
newName: quay.io/k8scsi/csi-snapshotter
newTag: "canary"

This file was deleted.

This file was deleted.

This file was deleted.

Original file line number Diff line number Diff line change
@@ -1,20 +1,19 @@
# for external-snapshotter
- op: add
path: /spec/template/spec/containers/0/args/-
value: "--metrics-address=:22014"

# for external-provisioner
- op: add
path: /spec/template/spec/containers/1/args/-
path: /spec/template/spec/containers/0/args/-
value: "--metrics-address=:22011"

# for external-attacher
- op: add
path: /spec/template/spec/containers/2/args/-
path: /spec/template/spec/containers/1/args/-
value: "--metrics-address=:22012"

# for external-resizer
- op: add
path: /spec/template/spec/containers/3/args/-
path: /spec/template/spec/containers/2/args/-
value: "--metrics-address=:22013"

# for external-snapshotter
- op: add
path: /spec/template/spec/containers/3/args/-
value: "--metrics-address=:22014"
Original file line number Diff line number Diff line change
Expand Up @@ -18,23 +18,13 @@ images:
- name: gke.gcr.io/csi-resizer
newName: gcr.io/gke-release-staging/csi-resizer
newTag: "v0.5.0-gke.0"
patches:
- controller_add_snapshotter.yaml
- name: gke.gcr.io/csi-snapshotter
newName: gcr.io/gke-release-staging/csi-snapshotter
newTag: "v2.1.1-gke.0"
patchesJson6902:
- target:
group: rbac.authorization.k8s.io
version: v1
kind: ClusterRole
name: csi-gce-pd-provisioner-role
path: rbac_add_snapshots_to_provisioner.yaml
- target:
group: apps
version: v1
kind: StatefulSet
name: csi-gce-pd-controller
path: enable_sidecar_metrics.yaml
resources:
- rbac_add_snapshotter.yaml
# Reapplying namespace transformer to include newly added RBAC rules.
namespace:
gce-pd-csi-driver

This file was deleted.

This file was deleted.

3 changes: 3 additions & 0 deletions deploy/kubernetes/overlays/stable/kustomization.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -20,3 +20,6 @@ images:
- name: gke.gcr.io/csi-resizer
newName: gke.gcr.io/csi-resizer
newTag: "v0.4.0-gke.0"
- name: gke.gcr.io/csi-snapshotter
newName: gke.gcr.io/csi-snapshotter
newTag: "v2.1.1-gke.0"
Loading