Skip to content

Commit 1c0e451

Browse files
authored
Merge pull request #68 from davidz627/fix/driverOnGKE
Bind GCP SA to Kubernetes Cluster-Admin for GKE
2 parents fc8a07e + d6cf365 commit 1c0e451

File tree

2 files changed

+10
-3
lines changed

2 files changed

+10
-3
lines changed

deploy/kubernetes/deploy-driver.sh

+9-2
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,15 @@ readonly KUBEDEPLOY="${PKGDIR}/deploy/kubernetes"
88

99
if ! kubectl get secret cloud-sa;
1010
then
11-
kubectl create secret generic cloud-sa --from-file="${SA_FILE}"
11+
kubectl create secret generic cloud-sa --from-file="${SA_FILE}"
1212
fi
13+
14+
# GKE Required Setup
15+
if ! kubectl get clusterrolebinding cluster-admin-binding;
16+
then
17+
kubectl create clusterrolebinding cluster-admin-binding --clusterrole cluster-admin --user $(gcloud config get-value account)
18+
fi
19+
1320
kubectl apply -f "${KUBEDEPLOY}/setup-cluster.yaml"
1421
kubectl apply -f "${KUBEDEPLOY}/node.yaml"
15-
kubectl apply -f "${KUBEDEPLOY}/controller.yaml"
22+
kubectl apply -f "${KUBEDEPLOY}/controller.yaml"

deploy/setup-project.sh

+1-1
Original file line numberDiff line numberDiff line change
@@ -16,4 +16,4 @@ gcloud iam service-accounts delete "$IAM_NAME" --quiet || true
1616
gcloud iam service-accounts create "${GCEPD_SA_NAME}"
1717
gcloud iam service-accounts keys create "${SA_FILE}" --iam-account "${IAM_NAME}"
1818
gcloud projects add-iam-policy-binding "${PROJECT}" --member serviceAccount:"${IAM_NAME}" --role roles/compute.admin
19-
gcloud projects add-iam-policy-binding "${PROJECT}" --member serviceAccount:"${IAM_NAME}" --role roles/iam.serviceAccountUser
19+
gcloud projects add-iam-policy-binding "${PROJECT}" --member serviceAccount:"${IAM_NAME}" --role roles/iam.serviceAccountUser

0 commit comments

Comments
 (0)