kubernetes · macos · minishift · openshift · x86_64

minishift: could not set oc CLI context for ‘minishift’ profile

I decided to install Minishift in the MacOS I’m using and during my first attempt I got the following (I pasted the full log):


✘-1 ~
17:42 $ minishift start --vm-driver virtualbox
-- Starting profile 'minishift'
-- Check if deprecated options are used ... OK
-- Checking if https://github.com is reachable ... OK
-- Checking if requested OpenShift version 'v3.11.0' is valid ... OK
-- Checking if requested OpenShift version 'v3.11.0' is supported ... OK
-- Checking if requested hypervisor 'virtualbox' is supported on this platform ... OK
-- Checking if VirtualBox is installed ... OK
-- Checking the ISO URL ... OK
-- Checking if provided oc flags are supported ... OK
-- Starting the OpenShift cluster using 'virtualbox' hypervisor ...
-- Starting Minishift VM .......................... OK
-- Checking for IP address ... OK
-- Checking for nameservers ... OK
-- Checking if external host is reachable from the Minishift VM ...
Pinging 8.8.8.8 ... OK
-- Checking HTTP connectivity from the VM ...
Retrieving http://minishift.io/index.html ... OK
-- Checking if persistent storage volume is mounted ... OK
-- Checking available disk space ... 1% used OK
-- Writing current configuration for static assignment of IP address ... OK
-- OpenShift cluster will be configured with ...
Version: v3.11.0
-- Pulling the OpenShift Container Image ................. OK
-- Copying oc binary from the OpenShift container image to VM ... OK
-- Starting OpenShift cluster ........................................................
Getting a Docker client ...
Checking if image openshift/origin-control-plane:v3.11.0 is available ...
Pulling image openshift/origin-cli:v3.11.0
E0209 19:44:16.174297 5185 helper.go:173] Reading docker config from /home/docker/.docker/config.json failed: open /home/docker/.docker/config.json: no such file or directory, will attempt to pull image docker.io/openshift/origin-cli:v3.11.0 anonymously
Image pull complete
Pulling image openshift/origin-node:v3.11.0
E0209 19:44:24.244495 5185 helper.go:173] Reading docker config from /home/docker/.docker/config.json failed: open /home/docker/.docker/config.json: no such file or directory, will attempt to pull image docker.io/openshift/origin-node:v3.11.0 anonymously
Pulled 5/6 layers, 86% complete
Pulled 6/6 layers, 100% complete
Extracting
Image pull complete
Checking type of volume mount ...
Determining server IP ...
Using public hostname IP 192.168.99.110 as the host IP
Checking if OpenShift is already running ...
Checking for supported Docker version (=>1.22) ...
Checking if insecured registry is configured properly in Docker ...
Checking if required ports are available ...
Checking if OpenShift client is configured properly ...
Checking if image openshift/origin-control-plane:v3.11.0 is available ...
Starting OpenShift using openshift/origin-control-plane:v3.11.0 ...
I0209 19:44:40.068475 5185 config.go:40] Running "create-master-config"
I0209 19:44:41.658330 5185 config.go:46] Running "create-node-config"
I0209 19:44:42.448717 5185 flags.go:30] Running "create-kubelet-flags"
I0209 19:44:42.768423 5185 run_kubelet.go:49] Running "start-kubelet"
I0209 19:44:42.921080 5185 run_self_hosted.go:181] Waiting for the kube-apiserver to be ready ...
I0209 19:45:16.936797 5185 interface.go:26] Installing "kube-proxy" ...
I0209 19:45:16.937767 5185 interface.go:26] Installing "kube-dns" ...
I0209 19:45:16.937774 5185 interface.go:26] Installing "openshift-service-cert-signer-operator" ...
I0209 19:45:16.937777 5185 interface.go:26] Installing "openshift-apiserver" ...
I0209 19:45:16.937802 5185 apply_template.go:81] Installing "openshift-apiserver"
I0209 19:45:16.938654 5185 apply_template.go:81] Installing "kube-proxy"
I0209 19:45:16.939703 5185 apply_template.go:81] Installing "kube-dns"
I0209 19:45:16.939835 5185 apply_template.go:81] Installing "openshift-service-cert-signer-operator"
I0209 19:45:20.962351 5185 interface.go:41] Finished installing "kube-proxy" "kube-dns" "openshift-service-cert-signer-operator" "openshift-apiserver"
I0209 19:47:23.981838 5185 run_self_hosted.go:242] openshift-apiserver available
I0209 19:47:23.982499 5185 interface.go:26] Installing "openshift-controller-manager" ...
I0209 19:47:23.982517 5185 apply_template.go:81] Installing "openshift-controller-manager"
I0209 19:47:26.541039 5185 interface.go:41] Finished installing "openshift-controller-manager"
Adding default OAuthClient redirect URIs ...
Adding registry ...
Adding router ...
Adding web-console ...
Adding centos-imagestreams ...
Adding sample-templates ...
Adding persistent-volumes ...
I0209 19:47:26.557678 5185 interface.go:26] Installing "openshift-image-registry" ...
I0209 19:47:26.557685 5185 interface.go:26] Installing "openshift-router" ...
I0209 19:47:26.557690 5185 interface.go:26] Installing "openshift-web-console-operator" ...
I0209 19:47:26.557693 5185 interface.go:26] Installing "centos-imagestreams" ...
I0209 19:47:26.557697 5185 interface.go:26] Installing "sample-templates" ...
I0209 19:47:26.557701 5185 interface.go:26] Installing "persistent-volumes" ...
I0209 19:47:26.564040 5185 apply_template.go:81] Installing "openshift-web-console-operator"
I0209 19:47:26.564588 5185 apply_list.go:67] Installing "centos-imagestreams"
I0209 19:47:26.564761 5185 interface.go:26] Installing "sample-templates/postgresql" ...
I0209 19:47:26.564767 5185 interface.go:26] Installing "sample-templates/django quickstart" ...
I0209 19:47:26.564771 5185 interface.go:26] Installing "sample-templates/nodejs quickstart" ...
I0209 19:47:26.564775 5185 interface.go:26] Installing "sample-templates/sample pipeline" ...
I0209 19:47:26.564778 5185 interface.go:26] Installing "sample-templates/mariadb" ...
I0209 19:47:26.564784 5185 interface.go:26] Installing "sample-templates/mysql" ...
I0209 19:47:26.564788 5185 interface.go:26] Installing "sample-templates/dancer quickstart" ...
I0209 19:47:26.564792 5185 interface.go:26] Installing "sample-templates/rails quickstart" ...
I0209 19:47:26.564796 5185 interface.go:26] Installing "sample-templates/jenkins pipeline ephemeral" ...
I0209 19:47:26.564800 5185 interface.go:26] Installing "sample-templates/mongodb" ...
I0209 19:47:26.564805 5185 interface.go:26] Installing "sample-templates/cakephp quickstart" ...
I0209 19:47:26.564832 5185 apply_list.go:67] Installing "sample-templates/cakephp quickstart"
I0209 19:47:26.565997 5185 apply_list.go:67] Installing "sample-templates/mysql"
I0209 19:47:26.566024 5185 apply_list.go:67] Installing "sample-templates/mariadb"
I0209 19:47:26.566114 5185 apply_list.go:67] Installing "sample-templates/dancer quickstart"
I0209 19:47:26.566192 5185 apply_list.go:67] Installing "sample-templates/postgresql"
I0209 19:47:26.566213 5185 apply_list.go:67] Installing "sample-templates/rails quickstart"
I0209 19:47:26.566290 5185 apply_list.go:67] Installing "sample-templates/django quickstart"
I0209 19:47:26.566303 5185 apply_list.go:67] Installing "sample-templates/jenkins pipeline ephemeral"
I0209 19:47:26.566388 5185 apply_list.go:67] Installing "sample-templates/nodejs quickstart"
I0209 19:47:26.566395 5185 apply_list.go:67] Installing "sample-templates/mongodb"
I0209 19:47:26.566479 5185 apply_list.go:67] Installing "sample-templates/sample pipeline"
I0209 19:47:36.712833 5185 interface.go:41] Finished installing "sample-templates/postgresql" "sample-templates/django quickstart" "sample-templates/nodejs quickstart" "sample-templates/sample pipeline" "sample-templates/mariadb" "sample-templates/mysql" "sample-templates/dancer quickstart" "sample-templates/rails quickstart" "sample-templates/jenkins pipeline ephemeral" "sample-templates/mongodb" "sample-templates/cakephp quickstart"
I0209 19:48:11.949516 5185 interface.go:41] Finished installing "openshift-image-registry" "openshift-router" "openshift-web-console-operator" "centos-imagestreams" "sample-templates" "persistent-volumes"
Login to server ...
Creating initial project "myproject" ...
Server Information ...
OpenShift server started.

The server is accessible via web console at:
https://192.168.99.110:8443/console

You are logged in as:
User: developer
Password: 

To login as administrator:
oc login -u system:admin
Could not set oc CLI context for 'minishift' profile: Error during setting 'minishift' as active profile: The specified path to the kube config '/Users/rpsene/.minishift/machines/minishift_kubeconfig' does not exist

It took me a good amount of time to discover that doing the following solves the issue:


$ minishift stop
Stopping the OpenShift cluster...
Cluster stopped.

$ rm -rf ~/.minishift/
$ rm -rf ~/.kube/config

And enables me to have Minishift up and running in MacOS:


17:53 $ minishift start --vm-driver virtualbox --show-libmachine-logs -v2
-- minishift version: v1.30.0+186b034
-- Starting profile 'minishift'
-- Check if deprecated options are used ... OK
-- Checking if https://github.com is reachable ... OK
-- Checking if requested OpenShift version 'v3.11.0' is valid ... OK
-- Checking if requested OpenShift version 'v3.11.0' is supported ... OK
-- Checking if requested hypervisor 'virtualbox' is supported on this platform ... OK
-- Checking if VirtualBox is installed ... OK
-- Checking the ISO URL ... OK
-- Downloading OpenShift binary 'oc' version 'v3.11.0'
53.27 MiB / 53.27 MiB [========================================================================================================================================================================================================] 100.00% 0s-- Downloading OpenShift v3.11.0 checksums ... OK
-- Checking if provided oc flags are supported ... OK
-- Starting the OpenShift cluster using 'virtualbox' hypervisor ...
-- Minishift VM will be configured with ...
Memory: 4 GB
vCPUs : 2
Disk size: 20 GB

Downloading ISO 'https://github.com/minishift/minishift-centos-iso/releases/download/v1.14.0/minishift-centos7.iso'
355.00 MiB / 355.00 MiB [======================================================================================================================================================================================================] 100.00% 0s
-- Starting Minishift VM ....Creating CA: /Users/rpsene/.minishift/certs/ca.pem
Creating client certificate: /Users/rpsene/.minishift/certs/cert.pem
Running pre-create checks...
Creating machine...
(minishift) Downloading /Users/rpsene/.minishift/cache/boot2docker.iso from file:///Users/rpsene/.minishift/cache/iso/centos/v1.14.0/minishift-centos7.iso...
(minishift) Creating VirtualBox VM...
(minishift) Creating SSH key...
...(minishift) Starting the VM...
(minishift) Check network to re-create if needed...
(minishift) Waiting for an IP...
.............Waiting for machine to be running, this may take a few minutes...
Detecting operating system of created instance...
Waiting for SSH to be available...
.Detecting the provisioner...
Provisioning with minishift...

Setting hostname ...
OK
.Copying certs to the local machine directory...
Copying certs to the remote machine...
.Setting Docker configuration on the remote daemon...
.
Feature detection ...
OK
Checking connection to Docker...
Docker is up and running!
OK
-- Checking for IP address ... OK
-- Checking for nameservers ... OK
-- Checking if external host is reachable from the Minishift VM ...
Pinging 8.8.8.8 ... OK
-- Checking HTTP connectivity from the VM ...
Retrieving http://minishift.io/index.html ... OK
-- Checking if persistent storage volume is mounted ... OK
-- Checking available disk space ... 1% used OK
-- Writing current configuration for static assignment of IP address ... OK
Importing 'openshift/origin-control-plane:v3.11.0' . CACHE MISS
Importing 'openshift/origin-docker-registry:v3.11.0' CACHE MISS
Importing 'openshift/origin-haproxy-router:v3.11.0' CACHE MISS
-- OpenShift cluster will be configured with ...
Version: v3.11.0
-- Pulling the OpenShift Container Image ................. OK
-- Copying oc binary from the OpenShift container image to VM ... OK
-- Starting OpenShift cluster .-- Running 'oc' with: 'cluster up --base-dir /var/lib/minishift/base --image 'openshift/origin-${component}:v3.11.0' --public-hostname 192.168.99.112 --routing-suffix 192.168.99.112.nip.io'
.......................................................
Getting a Docker client ...
Checking if image openshift/origin-control-plane:v3.11.0 is available ...
Pulling image openshift/origin-cli:v3.11.0
E0209 19:57:51.170157 5260 helper.go:173] Reading docker config from /home/docker/.docker/config.json failed: open /home/docker/.docker/config.json: no such file or directory, will attempt to pull image docker.io/openshift/origin-cli:v3.11.0 anonymously
Image pull complete
Pulling image openshift/origin-node:v3.11.0
E0209 19:57:54.074811 5260 helper.go:173] Reading docker config from /home/docker/.docker/config.json failed: open /home/docker/.docker/config.json: no such file or directory, will attempt to pull image docker.io/openshift/origin-node:v3.11.0 anonymously
Pulled 5/6 layers, 86% complete
Pulled 6/6 layers, 100% complete
Extracting
Image pull complete
Checking type of volume mount ...
Determining server IP ...
Using public hostname IP 192.168.99.112 as the host IP
Checking if OpenShift is already running ...
Checking for supported Docker version (=>1.22) ...
Checking if insecured registry is configured properly in Docker ...
Checking if required ports are available ...
Checking if OpenShift client is configured properly ...
Checking if image openshift/origin-control-plane:v3.11.0 is available ...
Starting OpenShift using openshift/origin-control-plane:v3.11.0 ...
I0209 19:58:09.403522 5260 config.go:40] Running "create-master-config"
I0209 19:58:11.217030 5260 config.go:46] Running "create-node-config"
I0209 19:58:11.808425 5260 flags.go:30] Running "create-kubelet-flags"
I0209 19:58:12.138761 5260 run_kubelet.go:49] Running "start-kubelet"
I0209 19:58:12.292572 5260 run_self_hosted.go:181] Waiting for the kube-apiserver to be ready ...
I0209 19:59:14.310555 5260 interface.go:26] Installing "kube-proxy" ...
I0209 19:59:14.310585 5260 interface.go:26] Installing "kube-dns" ...
I0209 19:59:14.310591 5260 interface.go:26] Installing "openshift-service-cert-signer-operator" ...
I0209 19:59:14.310640 5260 interface.go:26] Installing "openshift-apiserver" ...
I0209 19:59:14.310659 5260 apply_template.go:81] Installing "openshift-apiserver"
I0209 19:59:14.310662 5260 apply_template.go:81] Installing "kube-proxy"
I0209 19:59:14.310818 5260 apply_template.go:81] Installing "kube-dns"
I0209 19:59:14.311909 5260 apply_template.go:81] Installing "openshift-service-cert-signer-operator"
I0209 19:59:17.384013 5260 interface.go:41] Finished installing "kube-proxy" "kube-dns" "openshift-service-cert-signer-operator" "openshift-apiserver"
I0209 20:00:58.435440 5260 run_self_hosted.go:242] openshift-apiserver available
I0209 20:00:58.436099 5260 interface.go:26] Installing "openshift-controller-manager" ...
I0209 20:00:58.436124 5260 apply_template.go:81] Installing "openshift-controller-manager"
I0209 20:01:00.970492 5260 interface.go:41] Finished installing "openshift-controller-manager"
Adding default OAuthClient redirect URIs ...
Adding registry ...
Adding web-console ...
Adding centos-imagestreams ...
Adding router ...
Adding sample-templates ...
Adding persistent-volumes ...
I0209 20:01:00.991900 5260 interface.go:26] Installing "openshift-image-registry" ...
I0209 20:01:00.991910 5260 interface.go:26] Installing "openshift-web-console-operator" ...
I0209 20:01:00.991915 5260 interface.go:26] Installing "centos-imagestreams" ...
I0209 20:01:00.991920 5260 interface.go:26] Installing "openshift-router" ...
I0209 20:01:00.991924 5260 interface.go:26] Installing "sample-templates" ...
I0209 20:01:00.991928 5260 interface.go:26] Installing "persistent-volumes" ...
I0209 20:01:00.992615 5260 apply_template.go:81] Installing "openshift-web-console-operator"
I0209 20:01:00.992708 5260 apply_list.go:67] Installing "centos-imagestreams"
I0209 20:01:00.993033 5260 interface.go:26] Installing "sample-templates/sample pipeline" ...
I0209 20:01:00.993039 5260 interface.go:26] Installing "sample-templates/mongodb" ...
I0209 20:01:00.993043 5260 interface.go:26] Installing "sample-templates/mariadb" ...
I0209 20:01:00.993077 5260 interface.go:26] Installing "sample-templates/cakephp quickstart" ...
I0209 20:01:00.993083 5260 interface.go:26] Installing "sample-templates/django quickstart" ...
I0209 20:01:00.993088 5260 interface.go:26] Installing "sample-templates/nodejs quickstart" ...
I0209 20:01:00.993091 5260 interface.go:26] Installing "sample-templates/rails quickstart" ...
I0209 20:01:00.993094 5260 interface.go:26] Installing "sample-templates/jenkins pipeline ephemeral" ...
I0209 20:01:00.993098 5260 interface.go:26] Installing "sample-templates/mysql" ...
I0209 20:01:00.993101 5260 interface.go:26] Installing "sample-templates/postgresql" ...
I0209 20:01:00.993105 5260 interface.go:26] Installing "sample-templates/dancer quickstart" ...
I0209 20:01:00.993130 5260 apply_list.go:67] Installing "sample-templates/dancer quickstart"
I0209 20:01:00.993230 5260 apply_list.go:67] Installing "sample-templates/sample pipeline"
I0209 20:01:00.993299 5260 apply_list.go:67] Installing "sample-templates/mongodb"
I0209 20:01:00.993362 5260 apply_list.go:67] Installing "sample-templates/mariadb"
I0209 20:01:00.993429 5260 apply_list.go:67] Installing "sample-templates/cakephp quickstart"
I0209 20:01:00.993491 5260 apply_list.go:67] Installing "sample-templates/django quickstart"
I0209 20:01:00.993557 5260 apply_list.go:67] Installing "sample-templates/nodejs quickstart"
I0209 20:01:00.993622 5260 apply_list.go:67] Installing "sample-templates/rails quickstart"
I0209 20:01:00.993703 5260 apply_list.go:67] Installing "sample-templates/jenkins pipeline ephemeral"
I0209 20:01:00.993838 5260 apply_list.go:67] Installing "sample-templates/mysql"
I0209 20:01:00.993918 5260 apply_list.go:67] Installing "sample-templates/postgresql"
I0209 20:01:13.731957 5260 interface.go:41] Finished installing "sample-templates/sample pipeline" "sample-templates/mongodb" "sample-templates/mariadb" "sample-templates/cakephp quickstart" "sample-templates/django quickstart" "sample-templates/nodejs quickstart" "sample-templates/rails quickstart" "sample-templates/jenkins pipeline ephemeral" "sample-templates/mysql" "sample-templates/postgresql" "sample-templates/dancer quickstart"
I0209 20:01:46.369483 5260 interface.go:41] Finished installing "openshift-image-registry" "openshift-web-console-operator" "centos-imagestreams" "openshift-router" "sample-templates" "persistent-volumes"
Login to server ...
Creating initial project "myproject" ...
Server Information ...
OpenShift server started.

The server is accessible via web console at:
https://192.168.99.112:8443/console

You are logged in as:
User: developer
Password: 

To login as administrator:
oc login -u system:admin
Using Kubeconfig Path: /Users/rpsene/.kube/config
-- Exporting of OpenShift images is occuring in background process with pid 2467.

Screen Shot 2019-02-09 at 18.17.33

 

Advertisement

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s