Skip to content

Commit 1ab66e8

Browse files
committed
Adding separate namespace; removed driver-registrar role; bumped snapshotter version; added controller and node priorityclasses
1 parent d3e2ff0 commit 1ab66e8

11 files changed

+45
-51
lines changed

deploy/kubernetes/base/controller.yaml

+1
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ spec:
1414
app: gcp-compute-persistent-disk-csi-driver
1515
spec:
1616
serviceAccountName: csi-controller-sa
17+
priorityClassName: gce-pd-csi-driver-controller
1718
containers:
1819
- name: csi-provisioner
1920
image: gke.gcr.io/csi-provisioner

deploy/kubernetes/base/kustomization.yaml

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
commonLabels:
2-
app: gcp-compute-persistent-disk-csi-driver
2+
k8s-app: gcp-compute-persistent-disk-csi-driver
33
namespace:
4-
default
4+
gce-pd-csi-driver
55
resources:
66
- node.yaml
77
- controller.yaml

deploy/kubernetes/base/node.yaml

+1
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ spec:
1212
labels:
1313
app: gcp-compute-persistent-disk-csi-driver
1414
spec:
15+
priorityClassName: gce-pd-csi-driver-node
1516
serviceAccountName: csi-node-sa
1617
containers:
1718
- name: csi-driver-registrar

deploy/kubernetes/base/setup-cluster.yaml

+20-29
Original file line numberDiff line numberDiff line change
@@ -4,33 +4,6 @@ kind: ServiceAccount
44
metadata:
55
name: csi-node-sa
66

7-
---
8-
9-
kind: ClusterRole
10-
apiVersion: rbac.authorization.k8s.io/v1
11-
metadata:
12-
name: driver-registrar-role
13-
rules:
14-
- apiGroups: [""]
15-
resources: ["events"]
16-
verbs: ["get", "list", "watch", "create", "update", "patch"]
17-
18-
19-
---
20-
21-
kind: ClusterRoleBinding
22-
apiVersion: rbac.authorization.k8s.io/v1
23-
metadata:
24-
name: driver-registrar-binding
25-
subjects:
26-
- kind: ServiceAccount
27-
name: csi-node-sa
28-
namespace: default
29-
roleRef:
30-
kind: ClusterRole
31-
name: driver-registrar-role
32-
apiGroup: rbac.authorization.k8s.io
33-
347
---
358
##### Controller Service Account, Roles, Rolebindings
369
apiVersion: v1
@@ -73,7 +46,6 @@ metadata:
7346
subjects:
7447
- kind: ServiceAccount
7548
name: csi-controller-sa
76-
namespace: default
7749
roleRef:
7850
kind: ClusterRole
7951
name: external-provisioner-role
@@ -108,8 +80,27 @@ metadata:
10880
subjects:
10981
- kind: ServiceAccount
11082
name: csi-controller-sa
111-
namespace: default
11283
roleRef:
11384
kind: ClusterRole
11485
name: external-attacher-role
11586
apiGroup: rbac.authorization.k8s.io
87+
88+
---
89+
90+
apiVersion: scheduling.k8s.io/v1
91+
kind: PriorityClass
92+
metadata:
93+
name: gce-pd-csi-driver-controller
94+
value: 900000000
95+
globalDefault: false
96+
description: "This priority class should be used for the GCE PD CSI driver controller deployment only."
97+
98+
---
99+
100+
apiVersion: scheduling.k8s.io/v1
101+
kind: PriorityClass
102+
metadata:
103+
name: gce-pd-csi-driver-node
104+
value: 900001000
105+
globalDefault: false
106+
description: "This priority class should be used for the GCE PD CSI driver node deployment only."

deploy/kubernetes/delete-driver.sh

+7
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@
1010
set -o nounset
1111
set -o errexit
1212

13+
readonly NAMESPACE="${GCE_PD_DRIVER_NAMESPACE:-gce-pd-csi-driver}"
1314
readonly DEPLOY_VERSION="${GCE_PD_DRIVER_VERSION:-stable}"
1415
readonly PKGDIR="${GOPATH}/src/sigs.k8s.io/gcp-compute-persistent-disk-csi-driver"
1516
source "${PKGDIR}/deploy/common.sh"
@@ -18,3 +19,9 @@ ensure_kustomize
1819

1920
${KUSTOMIZE_PATH} build ${PKGDIR}/deploy/kubernetes/overlays/${DEPLOY_VERSION} | ${KUBECTL} delete -v="${VERBOSITY}" --ignore-not-found -f -
2021
${KUBECTL} delete secret cloud-sa -v="${VERBOSITY}" --ignore-not-found
22+
23+
if [[ ${NAMESPACE} != "" && ${NAMESPACE} != "default" ]] && \
24+
${KUBECTL} get namespace ${NAMESPACE} -v="${VERBOSITY}";
25+
then
26+
${KUBECTL} delete namespace ${NAMESPACE} -v="${VERBOSITY}"
27+
fi

deploy/kubernetes/deploy-driver.sh

+6-1
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ set -o nounset
1616
set -o errexit
1717
set -x
1818

19-
readonly NAMESPACE="${GCE_PD_DRIVER_NAMESPACE:-default}"
19+
readonly NAMESPACE="${GCE_PD_DRIVER_NAMESPACE:-gce-pd-csi-driver}"
2020
readonly DEPLOY_VERSION="${GCE_PD_DRIVER_VERSION:-stable}"
2121
readonly PKGDIR="${GOPATH}/src/sigs.k8s.io/gcp-compute-persistent-disk-csi-driver"
2222
source "${PKGDIR}/deploy/common.sh"
@@ -75,6 +75,11 @@ if [ "$skip_sa_check" != true ]; then
7575
check_service_account
7676
fi
7777

78+
if ! ${KUBECTL} get namespace ${NAMESPACE} -v="${VERBOSITY}";
79+
then
80+
${KUBECTL} create namespace ${NAMESPACE} -v="${VERBOSITY}"
81+
fi
82+
7883
if ! ${KUBECTL} get secret cloud-sa -v="${VERBOSITY}" -n ${NAMESPACE};
7984
then
8085
${KUBECTL} create secret generic cloud-sa -v="${VERBOSITY}" --from-file="${GCE_PD_SA_DIR}/cloud-sa.json" -n ${NAMESPACE}

deploy/kubernetes/overlays/alpha/controller_add_resizer.yaml

+2-2
Original file line numberDiff line numberDiff line change
@@ -8,10 +8,10 @@ spec:
88
containers:
99
- name: csi-resizer
1010
imagePullPolicy: Always
11-
image: quay.io/k8scsi/csi-resizer:canary
11+
image: gke.gcr.io/csi-resizer:v0.2.0-gke.0
1212
args:
1313
- "--v=5"
1414
- "--csi-address=/csi/csi.sock"
1515
volumeMounts:
1616
- name: socket-dir
17-
mountPath: /csi
17+
mountPath: /csi

deploy/kubernetes/overlays/alpha/controller_add_snapshotter.yaml

+1-1
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ spec:
88
containers:
99
- name: csi-snapshotter
1010
imagePullPolicy: Always
11-
image: gke.gcr.io/csi-snapshotter:v1.0.1-gke.0
11+
image: gke.gcr.io/csi-snapshotter:v1.2.0-gke.0
1212
args:
1313
- "--v=5"
1414
- "--csi-address=/csi/csi.sock"

deploy/kubernetes/overlays/alpha/rbac_add_resizer.yaml

+2-2
Original file line numberDiff line numberDiff line change
@@ -21,12 +21,12 @@ rules:
2121
kind: ClusterRoleBinding
2222
apiVersion: rbac.authorization.k8s.io/v1
2323
metadata:
24-
name: csi-resizer-role
24+
name: csi-controller-resizer-binding
2525
subjects:
2626
- kind: ServiceAccount
2727
name: csi-controller-sa
2828
namespace: default
2929
roleRef:
3030
kind: ClusterRole
3131
name: external-resizer-role
32-
apiGroup: rbac.authorization.k8s.io
32+
apiGroup: rbac.authorization.k8s.io

deploy/kubernetes/overlays/alpha/rbac_add_snapshotter.yaml

+3
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,9 @@ rules:
2626
- apiGroups: ["snapshot.storage.k8s.io"]
2727
resources: ["volumesnapshots"]
2828
verbs: ["get", "list", "watch", "update"]
29+
- apiGroups: ["snapshot.storage.k8s.io"]
30+
resources: ["volumesnapshots/status"]
31+
verbs: ["update"]
2932
- apiGroups: ["apiextensions.k8s.io"]
3033
resources: ["customresourcedefinitions"]
3134
verbs: ["create", "list", "watch", "delete"]

examples/kubernetes/demo-pod.yaml

-14
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,3 @@
1-
kind: PersistentVolumeClaim
2-
apiVersion: v1
3-
metadata:
4-
name: podpvc
5-
spec:
6-
accessModes:
7-
- ReadWriteOnce
8-
storageClassName: csi-gce-pd
9-
resources:
10-
requests:
11-
storage: 6Gi
12-
13-
---
14-
151
apiVersion: v1
162
kind: Pod
173
metadata:

0 commit comments

Comments
 (0)