Jan 12, 2019

[k8s][patch] minikube start --vm-driver=none failed with latest docker runtime

With my SuSE having latest docker runtime installed(v18.09.0),
which, has not been verified by kubeadm (Major:"1", Minor:"13", GitVersion:"v1.13.2") yet,
causing minicube (v0.32.0) to fail passing the kubeadm step during install:

$ minikube start --vm-driver=none --kubernetes-version v1.13.2


If you are using minikube inside a VM, it would be fine,
but if you want to utilize minikube to install local kubernetes,
you need to patch minikube with this argument passing to kubeadm:

--ignore-preflight-errors=SystemVerification


Steps:
  1. Clone minikube source code to your local repository
    $ git clone https://github.com/kubernetes/minikube.git $GOPATH/src/k8s.io/minikube
  2. Patch pkg/minikube/constants/constants.go adding 'SystemVerification' to the Preflights slice data structure:
    https://github.com/kubernetes/minikube/blob/master/pkg/minikube/constants/constants.go#L155
    src:
    var Preflights = []string{
    // We use --ignore-preflight-errors=DirAvailable since we have our own custom addons
    // that we also stick in /etc/kubernetes/manifests
     "DirAvailable--etc-kubernetes-manifests",
      "DirAvailable--data-minikube",
      "Port-10250",
      "FileAvailable--etc-kubernetes-manifests-kube-scheduler.yaml",
      "FileAvailable--etc-kubernetes-manifests-kube-apiserver.yaml",
      "FileAvailable--etc-kubernetes-manifests-kube-controller-manager.yaml",
      "FileAvailable--etc-kubernetes-manifests-etcd.yaml",
      // We use --ignore-preflight-errors=Swap since minikube.iso allocates a swap partition.
      // (it should probably stop doing this, though...)
      "Swap",
      // We use --ignore-preflight-errors=CRI since /var/run/dockershim.sock is not present.
      // (because we start kubelet with an invalid config)
      "CRI",
      "SystemVerification",   // <- Patch here
    }
  3. build binary
    $ make out/minikube-linux-amd64  
Enjoy.

No comments:

Post a Comment

Note: Only a member of this blog may post a comment.