Minikube: bash: /usr/local/bin/minikube: No such file or directory - kubernetes

I just installed Minikube for my Kubernetes local setup on Ubuntu 18.04 using the following command:
curl -LO https://storage.googleapis.com/minikube/releases/latest/minikube_latest_amd64.deb
sudo dpkg -i minikube_latest_amd64.deb
However, when I run the command:
minikube start
I get the following error:
bash: /usr/local/bin/minikube: No such file or directory
I'm really wondering what the issue will be.

I just figured it out after some research and trial.
Here's how I fixed it:
I simply closed that terminal and opened a new one, and ran the command again:
minikube start
OR
minikube start --driver=virtualbox
And it worked fine.
Note: By default minikube attempts to use Docker as the driver, but you specify VirtualBox as your preferred driver, which has some advantages.
Another way would have been to reload the Ubuntu bash terminal:
bash --login
Note:
If all the above techniques do not work, you add the Minikube executable to your path:
sudo mv minikube /usr/local/bin
You can then verify the Minikube executable path:
which minikube.
That's all.
I hope this helps

Related

Installing Rancher using docker containers is taking too long and is getting connection timeout

I am trying to install a K8S cluster with Rancher, after installing docker successfully I ran the following command to install Rancher containers:
$ sudo docker run -d --restart=unless-stopped -p 8088:8088 rancher/server:stable
The console I got was:
As you can see I am not being able to download the Rancher containers, what could I do to make it work?
Well, starting with the point this Rancher installation is based on what is proposed in this link https://phoenixnap.com/kb/install-rancher-on-ubuntu. The Rancher version to be installed following the script in the link, according to Docker Hub, is 1.x.
So, I don't recommend the command proposed in the script:
sudo docker run -d --restart=unless-stopped -p 8080:8080 rancher/server:stable
See, the rancher/server must be replaced by: rancher/rancher:stable, then you will install latest Rancher version 2.x.
Also, to avoid the timeout problem you instead of using the command "docker run" go for "docker pull" first, then "docker run". In other words, after finishing the "pull" then you go with the "run" option. I recommend you run the following commands which will be faster and effective:
sudo docker pull rancher/rancher:latest
sudo docker run -d --restart=unless-stopped -p 8088:8088 -p 8443:8443 --privileged rancher/rancher:latest
After running that everything is in good shape, you can run your Rancher. I hope that can help someone, I lost one day to figure that out, since the download time takes hours each time you run to timeout and fail.

restarting kube-proxy wating for conditions

While running the minikube start in windows 10, getting the following error.
Error : Error restarting cluster: restarting kube-proxy: waiting for kube-proxy to be up for configmap update: timed out waiting for the condition
Please help me resolve the give issue, I delete the minikube and restarted many time.
I faced the same issue on Centos 7
minikube delete
then
minikube start
solved my issue
I was getting the same error on mac os, tried almost everything but finally, this comment on GitHub saved my life :)
see steps
Now minikube has started as expected:
Below steps works for me :
Note : Do not work with root user
$ sudo minikube stop
$ sudo minikube delete
$ sudo rm -rf ~/.minikube
$ sudo minikube start --kubernetes-version=v1.12.4
you can specify any existing kubernetes version of your choice with prefix v compulsory
make sure .minikube directory created in users home directory but not in /root

How to confirm minikube is using hyperkit

When trying to run minikube with hyperkit, I was getting errors about xhyve not being installed. I installed that and reran minikube start --vm-driver hyperkit with no issues.
I was under the impression that hyperkit was a replacement for xhyve, not a supplement to it.
When I run ps I see both com.docker.hyperkit and docker-machine-driver-xhyve running.
How can I confirm that minikube is correctly using hyperkit?
Docker for Mac changed virtualization layer few times last years, and it can confuse users after updates of environment.
If the process list shows both com.docker.hyperkit and xhyve processes is probably due
to docker-machine environment which was previously set up using docker-machine-driver-xhyve.
You may consider cleaning up installation by
stopping Docker (from command line or from tray icon),
next removing machines created by docker-machine tool.
I can also suggest to remove current minikube installation using
minikube stop && minikube delete
and start fresh one with:
minikube start --v=10 --vm-driver=hyperkit"
That will add additional verbose output of building minikube environment.
This will give you the current driver for the current machine. Replace the second "minikube" with the name of your profile if you're using the --profile flag.
$ cat ~/.minikube/machines/minikube/config.json | grep DriverName
Strange, considering Hyperkit is supposed to replace xhyve eventually.
Make sure Hyperkit is built/installed and referenced by tour PATH.
And that you are using the latest docker-ce for Mac.
Use this command to get a list of each hypervisor instance that's running with hyperkit:
$ ps -ef | grep hyperkit
If minikube is running in hyperkit then the name 'minikube' should show up in the output:
0 29305 1 0 Tue06PM ?? 515:01.32 /usr/local/bin/hyperkit -A -u -F /Users/me/.minikube/machines/minikube/hyperkit.pid -c 2 -m 2000M -s 0:0,...
The instance labeled as 'com.docker.hyperkit' is the process that's being used by Docker and is NOT the minikube instance.

not able to start minikube on mac

I am trying to setup minikube on my mac machine
Below are environment:
nhs-MBP:~ anhtrang$ minikube version
minikube version: v0.26.1
anhs-MBP:~ anhtrang$ echo "";
anhs-MBP:~ anhtrang$ echo "OS:";
OS:
anhs-MBP:~ anhtrang$ cat /etc/os-release
cat: /etc/os-release: No such file or directory
anhs-MBP:~ anhtrang$ echo "";
anhs-MBP:~ anhtrang$ echo "VM driver":
VM driver:
anhs-MBP:~ anhtrang$ grep DriverName ~/.minikube/machines/minikube/config.json
"DriverName": "virtualbox",
anhs-MBP:~ anhtrang$ echo "";
anhs-MBP:~ anhtrang$ echo "ISO version";
ISO version
anhs-MBP:~ anhtrang$ grep -i ISO ~/.minikube/machines/minikube/config.json
"Boot2DockerURL": "file:///Users/anhtrang/.minikube/cache/iso/minikube-v0.26.0.iso",
Got following error:
nhs-MBP:~ anhtrang$ Starting local Kubernetes v1.10.0 cluster...
-bash: Starting: command not found
anhs-MBP:~ anhtrang$ Starting VM...
-bash: Starting: command not found
anhs-MBP:~ anhtrang$ E0420 08:24:57.963653 81977 start.go:159] Error starting host: Temporary Error: Error configuring auth on host: OS type not recognized.
Please advise
Minikube is a tool that makes it easy to run Kubernetes locally. Minikube runs a single-node Kubernetes cluster inside a VM on your laptop for users looking to try out Kubernetes or develop with it day-to-day.
Let’s start with some pre-installation checks:
do you have Docker containers installed? Please check it by executing the below command:
docker version
If it’s not installed or is outdated - Docker installation guide will help you:
https://docs.docker.com/docker-for-mac/install/
do you have any of the supported virtualization software installed?
At this moment, minikube can use these virtualization solutions to spin up all-in-one cluster:
xhyve
VirtualBox
hyperkit
In this installation, we use hyperkit, because xhyve is deprecated. You can choose
VirtualBox as well, but I will not describe it here and focus on hyperkit.
Paste the following command in a terminal window:
curl -Lo minikube https://storage.googleapis.com/minikube/releases/v0.26.1/minikube-darwin-amd64 && chmod +x minikube && sudo mv minikube /usr/local/bin/
next install hyperkit:
curl -LO https://storage.googleapis.com/minikube/releases/latest/docker-machine-driver-hyperkit \
&& chmod +x docker-machine-driver-hyperkit \
&& sudo mv docker-machine-driver-hyperkit /usr/local/bin/ \
&& sudo chown root:wheel /usr/local/bin/docker-machine-driver-hyperkit \
&& sudo chmod u+s /usr/local/bin/docker-machine-driver-hyperkit
At this point, please consider removing failed minikube installation :
minikube delete
Now you are ready to get started with minikube!
minikube --vm-driver=hyperkit start
After a while, the cluster is started, and you can use it by the command:
kubectl
minikube delete and start will solve the issues
minikube delete
minikube start
for unavoidable situations, try uninstall and re-install minikube
brew cask uninstall minikube
brew cask install minikube
Try using below commands for installing minikube on mac
brew install minikube
brew link minikube

minikube install package using toolbox but the container does not internet conexion

I'm wondering how can install a package inside the minikube VM. I need some tools.
I have tried the /bin/toolbox container, but It does not have internet conexion.
[root#docker-fedora-24 ~]# dnf update --verbose
cachedir: /var/cache/dnf
DNF version: 1.1.9
Cannot download 'https://mirrors.fedoraproject.org/metalink?repo=updates-released-f24&arch=x86_64': Cannot prepare internal mirrorlist: Curl error (6): Couldn't resolve host name for https://mirrors.fedoraproject.org/metalink?repo=updates-released-f24&arch=x86_64 [Could not resolve host: mirrors.fedoraproject.org].
Error: Failed to synchronize cache for repo 'updates'
I have tried the same toolbox script in my computer and it is properly working.
What configuration parameters I'm missing in minikube or systemd-nspaw?
Or how can I cook a customized minikube VM?
Thanks a lot
You can run minicube without VM on your local docker (if you use linux):
minikube start --vm-driver=none
A alternative, run toolbox with docker run --net=host ... to make network for container more transparent. Troubleshoot your internet connection with nslookup, traceroute/tracepath, curl -v, ifconfig.
http://www.linuxhomenetworking.com/wiki/index.php/Quick_HOWTO_:Ch04:_Simple_Network_Troubleshooting#.WfY1xGi0OUk
Minikube is not meant to be tweaked. The advised method is to prepare a helm chart for your application. As part of the helm chart you can add whatever tool you need in your docker file... Including make... Then you can install or upgrade your package in kubernetes/minikube using helm.
I had a similar problem when I wanted to use tcpdump in the minikube VM.
I ended up using minikube mount SRC-dir:DST-dir to mount the host folder inside the VM and copying the tcpdump binary along with dependent libs (libcrypto and libpcap) to the mount point.
Then I executed tcpdump from the minikube VM and it worked.
Note: My host arch and the minikube VM arch (x86_64) was the same.
Note also: export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:DST-dir has to be done.