Skip to content
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

Enable RBAC in Minikube - Closes #287 #343

Merged
merged 3 commits into from
Apr 3, 2018
Merged

Enable RBAC in Minikube - Closes #287 #343

merged 3 commits into from
Apr 3, 2018

Conversation

scholzj
Copy link
Member

@scholzj scholzj commented Apr 2, 2018

Type of change

  • Bugfix
  • Enhancement / new feature
  • Refactoring

Description

This PR makes sure that the minikube used in TravisCI for system tests will be running with enabled RBAC. This should close issue #287

Add role through sudo

Remove sudo

Do not add binding

Is the cluster available later?

Further debugging

More debugging

More debugging

More debugging

More debugging

Increase timeout
@scholzj scholzj requested a review from tombentley April 2, 2018 16:05
sudo -E minikube addons enable default-storageclass
sleep 10
kubectl create clusterrolebinding add-on-cluster-admin --clusterrole=cluster-admin --serviceaccount=kube-system:default
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

out of curiosity ... what's the purpose for this one ?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I should have explained it in the description probably.

When RBAC is enabled, KubeDNS and Kubernetes Dashboard will not work because of missing permissions (do not ask me why Minikube still doesn't support RBAC properly). To work around it I create a new binding which gives all deployments using the default service account the cluster admin access. That gets them running.

The sleep 10 is there because it seems that although minikube says the cluster is ready, the connections from kubectl are not accepted. Waiting for 10 seconds seems to solve that issue (5 seconds were not enough).

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think it's probably worth commenting the kubectl create clusterrolebinding , because I for one will forget what it's there for.

I've noticed the problem with minikube start finishing before the cluster is fully up. But I suspect that sleeping for 10 seconds is likely to be flaky sometimes. Maybe we should code the kubectl create in a loop until it is successful?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@tombentley Better now?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

(now even with the explanatory comment why the binding is needed)

Copy link
Member

@tombentley tombentley left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@scholzj scholzj merged commit 5e6efc1 into master Apr 3, 2018
@scholzj scholzj deleted the minikube-rbac branch April 17, 2018 19:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants