Skip to content

Commit

Permalink
Fixes for RBAC + Minikube issues in #86
Browse files Browse the repository at this point in the history
  • Loading branch information
markmandel committed Feb 13, 2018
1 parent aafe57b commit af9ed94
Showing 1 changed file with 11 additions and 2 deletions.
13 changes: 11 additions & 2 deletions build/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -233,7 +233,7 @@ gcloud-auth-cluster: ensure-build-image
docker run --rm $(common_mounts) $(build_tag) gcloud config set compute/zone \
`grep zone: $(build_path)/gke-test-cluster/deployment.yml | sed 's/zone: //'`
docker run --rm $(common_mounts) $(build_tag) gcloud container clusters get-credentials $(CLUSTER_NAME)
-docker run --rm $(common_mounts) $(build_tag) kubectl create clusterrolebinding cluster-admin-binding --clusterrole cluster-admin --user $$(gcloud config get-value account)
-docker run --rm $(common_mounts) $(build_tag) bash -c 'kubectl create clusterrolebinding cluster-admin-binding --clusterrole cluster-admin --user $$(gcloud config get-value account)'

# authenticate our docker configuration so that you can do a docker push directly
# to the gcr.io repository
Expand Down Expand Up @@ -263,7 +263,16 @@ clean-gcloud-config:
# (defaults virtualbox for Linux and OSX, hyperv for windows) if you so desire.
minikube-test-cluster: minikube-agones-profile
$(MINIKUBE) start --kubernetes-version v1.8.0 --vm-driver $(MINIKUBE_DRIVER) \
--extra-config=apiserver.Authorization.Mode=RBAC
--extra-config=apiserver.Authorization.Mode=RBAC
# wait until the master is up
until docker run --rm $(common_mounts) --network=host -v $(minikube_cert_mount) $(DOCKER_RUN_ARGS) $(build_tag) kubectl cluster-info; \
do \
echo "Waiting for cluster to start..."; \
sleep 1; \
done
# this is needed for kubernetes component to work correctly while RBAC is enabled
-docker run --rm $(common_mounts) --network=host -v $(minikube_cert_mount) $(DOCKER_RUN_ARGS) $(build_tag) \
kubectl create clusterrolebinding add-on-cluster-admin --clusterrole=cluster-admin --serviceaccount=kube-system:default
$(MAKE) minikube-post-start

# switch to the agones cluster
Expand Down

0 comments on commit af9ed94

Please sign in to comment.