minikube start failure workaround clears any parameters passed to kubeadm init

9/14/2018

Here are the versions I'm using

Docker-ce

Client:
 Version:           17.06.1-ce

Server:
 Engine:
  Version:          17.06.1-ce

minikube:

kubectl 

Kubectl:

Client Version: version.Info{Major:"1", Minor:"11", GitVersion:"v1.11.2", GitCommit:"bb9ffb1654d4a729bb4cec18ff088eacc153c239", GitTreeState:"clean", BuildDate:"2018-08-07T23:17:28Z", GoVersion:"go1.10.3", Compiler:"gc", Platform:"linux/amd64"}
Server Version: version.Info{Major:"1", Minor:"10", GitVersion:"v1.10.0", GitCommit:"fc32d2f3698e36b93322a3465f63a14e9f0eaead", GitTreeState:"clean", BuildDate:"2018-03-26T16:44:10Z", GoVersion:"go1.9.3", Compiler:"gc", Platform:"linux/amd64"}

Kubeadm:

kubeadm version: &version.Info{Major:"1", Minor:"10", GitVersion:"v1.10.0", GitCommit:"fc32d2f3698e36b93322a3465f63a14e9f0eaead", GitTreeState:"clean", BuildDate:"2018-03-26T16:44:10Z", GoVersion:"go1.9.3", Compiler:"gc", Platform:"linux/amd64"}

VirtualBox:

Version 5.2.18 r124319 (Qt5.6.2)

I happen to need to specify the following:

kubeadm reset
kubeadm init --pod-network-cidr=192.168.0.0/16

However when I then start minikube it always fails with the following:

kubeconfig file "/etc/kubernetes/admin.conf" exists already but has got the wrong CA cert

The workaround I've been able to find is to delete all .conf files in /etc/kubernetes

  cd /etc/kubernetes/
  sudo rm *.conf
  cd
  sudo minikube delete # may also need rm -rf ~/.minikube
  sudo minikube start --vm-driver=none

However new config files are generated and so are the .yaml files under `/etc/kubernetes/manifest' thus erasing all additional attributes of the configuration

Up to that point doing kubeadm config view would show the kube init pod-network-cidr parmameter but not after deleting the .conf files and starting minikube again

First: Is this ...wrong CA cert error a bug with minikube?

Is there an alternate workaround that would maintain the extra parameters passed during kubeadm init?

I've also tried to pass the following 3 attributes that get cleared from the kube-controller-manager.yaml file as extra-config parameters on the minikube start command

The three missing attributes associated with --pod-network-cidr=192.168.0.0/16 that I've been able to ascertain are:

 --allocate-node-cidrs=true
 --cluster-cidr=192.168.0.0/16
 --node-cidr-mask-size=24

My mikikube start command looks like this:

sudo minikube start --vm-driver=none --extra-config=controller-manager.allocate-node-cidrs=true, controller-manager.cluster-cidr=192.168.0.0/16, controller-manager.node-cidr-mask-size=24

But I get further error when trying this

Any suggestions?

-- Gilles Depatie
kubeadm
kubernetes
minikube

1 Answer

9/14/2018
  • You generally use minikube to setup a mini kubernetes cluster of its own. Generally on your local machine.
  • You generally use kubeadm to setup a full blown cluster of its own.
  • You don't generally use both of them together.

Hope it helps!

-- Rico
Source: StackOverflow