When trying to install Minishift on Mac OS X, I had an issue with adding cluster-admin rights to developer user.
This is the error:
% oc adm policy add-cluster-role-to-user cluster-admin developer Error from server (Forbidden): clusterrolebindings.rbac.authorization.k8s.io is forbidden: User "system" cannot list clusterrolebindings.rbac.authorization.k8s.io at the cluster scope: no RBAC policy matched
The problem is, brew installation is done with docker-machine-driver-xhyve version 0.4.0
Installing docker-machine-driver-xhyve with 0.3.3 version solves the problem.
Trying to install with the following yielded an error:
$ brew install docker-machine-driver-xhyve@0.3.3
Error: No available formula with the name "docker-machine-driver-xhyve@v0.3.3" ==> Searching for a previously deleted formula (in the last month)... Warning: homebrew/core is shallow clone. To get complete history run: git -C "$(brew --repo homebrew/core)" fetch --unshallow Error: No previously deleted formula found. ==> Searching for similarly named formulae... Error: No similarly named formulae found. ==> Searching taps... ==> Searching taps on GitHub... Error: No formulae found in taps.
In order to solve the issue you can install version 0.3.3 using the following command:
Delete the minishift
% minishift delete You are deleting the Minishift VM: 'minishift'. Do you want to continue [y/N]?: y Removing entries from kubeconfig for cluster: 192-168-64-2:8443 Deleting the Minishift VM... Minishift VM deleted.
Create a new minishift deployment now.
% minishift start
Wait for it to be braught up and check statuf of OpenShift:
% minishift status Minishift: Running Profile: minishift OpenShift: Running (openshift v3.11.0+7876dd5-361) DiskUsage: 20% of 18G (Mounted On: /mnt/vda1) CacheUsage: 2.069 GB (used by oc binary, ISO or cached images)
Make sure you are logged in as system:admin
$ oc login -u system:admin
Now you can run the failed command:
$ oc adm policy add-cluster-role-to-user cluster-admin developer cluster role "cluster-admin" added: "developer