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
Related
I performed the steps in https://minikube.sigs.k8s.io/docs/start/ to properly install minikube locally in my ubuntu running on my VM:
pcname#ubuntu:~$curl -LO https://storage.googleapis.com/minikube/releases/latest/minikube-linux-amd64
also
pcname#ubuntu:~$sudo install minikube-linux-amd64 /usr/local/bin/minikube
an empty cmd line is returned. When I type minikube start as if it is install properly I get the following error:
😄 minikube v1.22.0 on Ubuntu 20.04 👎 Unable to pick a default
driver. Here is what was considered, in preference order:
▪ docker: Not installed: exec: "docker": executable file not found in $PATH
▪ kvm2: Not installed: exec: "virsh": executable file not found in $PATH
▪ podman: Not installed: exec: "podman": executable file not found in $PATH
▪ vmware: Not installed: exec: "docker-machine-driver-vmware": executable file not found in $PATH
▪ virtualbox: Not installed: unable to find VBoxManage in $PATH
❌ Exiting due to DRV_NOT_DETECTED: No possible driver was detected.
Try specifying --driver, or see
https://minikube.sigs.k8s.io/docs/start/
Notice: Before those, I followed all steps in https://kubernetes.io/docs/tasks/tools/install-kubectl-linux/ and I installed kubectl and verified it is installed by:
pcname#ubuntu:kubectl version --client
Client Version: version.Info{Major:"1", Minor:"21", GitVersion:"v1.21.3", GitCommit:"ca643a4d1f7bfe3***************", GitTreeState:"clean", BuildDate:"2021-07-15T21:04:39Z", GoVersion:"go1.16.6", Compiler:"gc", Platform:"linux/amd64"}
even if the 3 step failed.
What is wrong? I am just trying to install kubectl and then minikube. Do I have to install Docker as it is suggested when I type "minikube start" ?
Solution
-sudo chmod 755 /usr/local/bin/minikube to give execute permission to minikube
-minikube version => It gave the version
-minikube start => it did not work.
-Figured out that I have to install Virtual Box so I typed:
sudo apt install virtualbox virtualbox-ext-pack
-minikube start [again] and installation started and goes on without a hitch.
Upgraded to PC to ubuntu 20.04 and having problems re-installing microk8s (1.19 and 1.20 have the same issue on my PC).
starting fresh to demo problem
snap remove microk8s
Following instructions on Install MicroK8s
sudo snap install microk8s --classic --channel=1.19
result:
microk8s (1.19/stable) v1.19.5 from Canonical✓ installed
Step: Join the group
sudo usermod -a -G microk8s $USER
sudo chown -f -R $USER ~/.kube
su - $USER
Step: Check the status
microk8s status --wait-ready
Result: Hangs forever
Figure out what is going on:
microk8s inspect
The tar files contain lots of
Container runtime network not ready: NetworkReady=false reason:NetworkPluginNotReady message:Network plugin returns error: cni plugin not initialized
dial tcp 127.0.0.1:16443: connect: connection refused
Any suggestions would be appreciated.
I had the same issue on a new Ubuntu 20.04.1 Server install and following the same instructions... e.g.
sudo snap install microk8s --classic --channel=1.19
What worked for me was using the 1.18 channel
sudo snap remove microk8s
sudo snap install microk8s --classic --channel=1.18/stable
And then refreshing to 1.19 once microk8s 1.18 became ready...
sudo snap refresh microk8s --classic --channel=1.19/stable
Don't ask me why this worked but it did.
Check your /etc/ hosts file there should be these lines
127.0.0.1 localhost 127.0.1.1 name you servers
It's funny in microk8s 1.18 all works good)
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
I'm having some troubles with initializing the master using kubeadm..
I'm trying to follow https://kubernetes.io/docs/setup/independent/create-cluster-kubeadm/ . I installed docker, kubelet, kubeadm and kubectl.
Now I executed kubeadm init, but it stops at [init] This might take a minute or longer if the control plane images have to be pulled.
I looked into journalctl and there I found out that: Unable to update cni config: No networks found in /etc/cni/net.d and Failed to list *v1.Pod: Get https://10.159.43.30:6443/api/v1/pods?fieldSelector=spec.nodeName%3Deskubernv01&limit=500&resourceVersion=0: dial tcp 10.159.43.30:6443: getsockopt: connection refused.
I tried to set up weave-net with kubectl apply -f https://git.io/weave-kube but it cannot connect: The connection to the server localhost:8080 was refused - did you specify the right host or port?.
I cannot copy admin.conf file which should allow me to connect from /etc/kubernates, because kubeadm init failed so these are not proper files.
I feel like I'm in a loop here and I'm mising something.
I'm out of options right now. Any ideas?
I found the way out.
If anyone has a problem like this - check docker logs.
In my case it was proxy which was unset for docker service.
To set it I used:
Create a systemd drop-in directory for the docker service:
$ sudo mkdir -p /etc/systemd/system/docker.service.d
Create a file called /etc/systemd/system/docker.service.d/http-proxy.conf that adds the HTTP_PROXY environment variable:
[Service]
Environment="HTTP_PROXY=http://proxy.example.com:80/"
Source: https://docs.docker.com/config/daemon/systemd/#httphttps-proxy
I solved it by specifying the version [1.9.7-00] when installing kubeadm,kubectl,and kubelet , like this:
# ----- Install kubernetes -----
# kubeadm docs: https://kubernetes.io/docs/setup/independent/install-kubeadm/
echo " "
echo - Installing Kubernetes...
apt-get update && apt-get install -y apt-transport-https
curl -s https://packages.cloud.google.com/apt/doc/apt-key.gpg | apt-key add -
cat <<EOF >/etc/apt/sources.list.d/kubernetes.list
deb http://apt.kubernetes.io/ kubernetes-xenial main
EOF
apt-get update
apt-get install -y kubelet=1.9.7-00 kubeadm=1.9.7-00 kubectl=1.9.7-00
Note the kubelet=1.9.7-00 kubeadm=1.9.7-00 kubectl=1.9.7-00
Is there a way to run Kubernetes minikube on a RHEL VM (Hypervisor)? Or is there any other way to try out Kubernetes with a single VM?
To run minikube on a RHEL CentOS VM, you need to install docker and virtualbox, before installing minikube and kubectl. Since minikube runs in a VM also, you be using nested virtualization, so you need to ensure that virtualization is enabled in the BIOS of your RHEL CentOS VM.
Once your VM is up and running, SSH in as root and run the following:
# Install docker dependencies
yum install -y yum-utils device-mapper-persistent-data lvm2
# Add Docker repo
yum-config-manager --add-repo https://download.docker.com/linux/centos/docker-ce.repo
yum install -y docker-ce epel-release wget
cd /etc/yum.repos.d/
wget http://download.virtualbox.org/virtualbox/rpm/rhel/virtualbox.repo
yum update
Reboot your VM here and ensure that virtualization is enabled in the BIOS
# Install EPEL repo, Minikube kubectl etc.
rpm -Uvh https://dl.fedoraproject.org/pub/epel/epel-release-latest-7.noarch.rpm
yum --enablerepo=epel install dkms
yum groupinstall "Development Tools"
yum install -y kernel-devel VirtualBox-5.2
curl -LO https://storage.googleapis.com/kubernetes-release/release/$(curl -s https://storage.googleapis.com/kubernetes-release/release/stable.txt)/bin/linux/amd64/kubectl
chmod +x ./kubectl
sudo mv ./kubectl /usr/local/bin/kubectl
curl -Lo minikube https://storage.googleapis.com/minikube/releases/v0.23.0/minikube-linux-amd64 && chmod +x minikube && sudo mv minikube /usr/local/bin/
sudo /sbin/vboxconfig
# Start the minikube cluster
minikube start --vm-driver=virtualbox SERVICE_CLUSTER_IP_RANGE="X.X.X.X/24" --container-runtime=docker --extra-config kubelet.EnableCustomMetrics=true
# Start the dashboard
minikube dashboard
The minikube dashboard should be running and accessible at http://192.168.99.100:30000