From 5b54dd6e164409fd89cb618a75ef6d998cdc8746 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Anders=20F=20Bj=C3=B6rklund?= Date: Tue, 16 Jan 2018 23:26:20 +0100 Subject: [PATCH] Ignore preflight errors from CRI (dockershim.sock) kubeadm init is running `crictl -r /var/run/dockershim.sock info` before the socket actually exists (kubelet hasn't started up yet) --- pkg/minikube/bootstrapper/kubeadm/kubeadm.go | 2 ++ pkg/minikube/bootstrapper/kubeadm/templates.go | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/pkg/minikube/bootstrapper/kubeadm/kubeadm.go b/pkg/minikube/bootstrapper/kubeadm/kubeadm.go index b71af9fa4f32..407212c936ee 100644 --- a/pkg/minikube/bootstrapper/kubeadm/kubeadm.go +++ b/pkg/minikube/bootstrapper/kubeadm/kubeadm.go @@ -109,6 +109,8 @@ func (k *KubeadmBootstrapper) StartCluster(k8s config.KubernetesConfig) error { // that we also stick in /etc/kubernetes/manifests // We use --ignore-preflight-errors=Swap since minikube.iso allocates a swap partition. // (it should probably stop doing this, though...) + // We use --ignore-preflight-errors=CRI since /var/run/dockershim.sock is not present. + // (because we start kubelet with an invalid config) b := bytes.Buffer{} if err := kubeadmInitTemplate.Execute(&b, struct{ KubeadmConfigFile string }{constants.KubeadmConfigFile}); err != nil { return err diff --git a/pkg/minikube/bootstrapper/kubeadm/templates.go b/pkg/minikube/bootstrapper/kubeadm/templates.go index 67ebf0e6ebae..395f96a628ce 100644 --- a/pkg/minikube/bootstrapper/kubeadm/templates.go +++ b/pkg/minikube/bootstrapper/kubeadm/templates.go @@ -71,7 +71,7 @@ sudo /usr/bin/kubeadm alpha phase controlplane all --config {{.KubeadmConfigFile sudo /usr/bin/kubeadm alpha phase etcd local --config {{.KubeadmConfigFile}} `)) -var kubeadmInitTemplate = template.Must(template.New("kubeadmInitTemplate").Parse("sudo /usr/bin/kubeadm init --config {{.KubeadmConfigFile}} --ignore-preflight-errors=DirAvailable--etc-kubernetes-manifests --ignore-preflight-errors=Swap")) +var kubeadmInitTemplate = template.Must(template.New("kubeadmInitTemplate").Parse("sudo /usr/bin/kubeadm init --config {{.KubeadmConfigFile}} --ignore-preflight-errors=DirAvailable--etc-kubernetes-manifests --ignore-preflight-errors=Swap --ignore-preflight-errors=CRI")) // printMapInOrder sorts the keys and prints the map in order, combining key // value pairs with the separator character