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)
Related
I have running k8s cluster using kops. the autoscaling policy terminate the master machine and recreated a new one since then every time i try to run kubectl command it returns "The connection to the server refused, did you specify the right host or port". i tried to ssh to the master machine but the did not found any of k8s services so i think the autoscale policy did not configure the master node correctly. so what should i do in this situation ?
update: also i found this log in syslog file:
E: Package 'ebtables' has no installation candidate
Jun 25 12:03:33 ip-172-20-35-193 nodeup[7160]: I0625 12:03:33.389286 7160 executor.go:145] No progress made, sleeping before retrying 2 failed task(s)
the issue was the kops was unable to install ebtables and conntrack so i installed it manually by :
sudo apt-get -o Acquire::Check-Valid-Until=false update
sudo apt-get install -y ebtables --allow-unauthenticated
sudo apt-get install --yes conntrack
and everything is running fine now
I used below mentioned commands to remove kubernetes from my ubuntu 18.04 server.
kubeadm reset
sudo apt-get purge kubeadm kubectl kubelet kubernetes-cni kube*
sudo apt-get autoremove
sudo rm -rf ~/.kube
but still its showing :
Client Version: version.Info{Major:"1", Minor:"16", GitVersion:"v1.16.0", GitCommit:"2bd9643cee5b3b3a5ecbd3af49d09018f0773c77", GitTreeState:"clean", BuildDate:"2019-09-18T14:36:53Z", GoVersion:"go1.12.9", Compiler:"gc", Platform:"linux/amd64"}
The connection to the server `localhost:8080 was refused - did you specify the right host or port? while running kubectl version .
How can i completely remove kubectl from my ubuntu server 18.04 ?
Depending on the method you chose in https://kubernetes.io/docs/tasks/tools/install-kubectl/, it can be any of these:
Install kubectl binary via curl: sudo rm /usr/local/bin/kubectl
Download as part of the Google Cloud SDK: gcloud components remove kubectl
Install with snap on Ubuntu (just as Gparmar said): snap remove kubectl
In addition, you may need to remove the configuration files in ~/.kube.
If you exectute commands below:
kubeadm reset
sudo apt-get purge kubeadm kubectl kubelet kubernetes-cni kube*
sudo apt-get autoremove
sudo rm -rf ~/.kube
remember to restart computer.
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
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
I am trying to install kubernetes on localhost using LXD but facing issue. I am using conjure-up for this but on proceeding localhost option is not highlighted stating that LXD not found.
[Error]
I have installed LXD as per commands given. Do I need to provide path somewhere so that conjure-up finds the path or is there some other issue?
This worked for me:
sudo apt install snapd
sudo snap install lxd
sudo snap install conjure-up --classic
sudo lxd init --auto
/snap/bin/lxc network create lxdbr0 ipv4.address=auto ipv4.nat=true ipv6.address=none ipv6.nat=false
conjure-up kubernetes
Edit: I had to sudo apt purge lxd first
Then
sudo apt upgrade
After installing lxd as suggested on conjure
sudo snap install lxd
/snap/bin/lxd init
Disabled IPV6 with the wizard
And then conjure-up
Don't forget to logout and login after adding the user to the group
(I actually did a reboot)
You'll also need to create an LXD "dir" storage. Else no pods will launch correctly. This is a known issue with conjure-up. You can specify this when you run lxd init.
https://docs.conjure-up.io/stable/en/spellbooks/kubernetes#limitations