Skip to content

Commit 5b54dd6

Browse files
afbjorklunddlorenc
authored andcommitted
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)
1 parent 60ec8bd commit 5b54dd6

File tree

2 files changed

+3
-1
lines changed

2 files changed

+3
-1
lines changed

Diff for: pkg/minikube/bootstrapper/kubeadm/kubeadm.go

+2
Original file line numberDiff line numberDiff line change
@@ -109,6 +109,8 @@ func (k *KubeadmBootstrapper) StartCluster(k8s config.KubernetesConfig) error {
109109
// that we also stick in /etc/kubernetes/manifests
110110
// We use --ignore-preflight-errors=Swap since minikube.iso allocates a swap partition.
111111
// (it should probably stop doing this, though...)
112+
// We use --ignore-preflight-errors=CRI since /var/run/dockershim.sock is not present.
113+
// (because we start kubelet with an invalid config)
112114
b := bytes.Buffer{}
113115
if err := kubeadmInitTemplate.Execute(&b, struct{ KubeadmConfigFile string }{constants.KubeadmConfigFile}); err != nil {
114116
return err

Diff for: pkg/minikube/bootstrapper/kubeadm/templates.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,7 @@ sudo /usr/bin/kubeadm alpha phase controlplane all --config {{.KubeadmConfigFile
7171
sudo /usr/bin/kubeadm alpha phase etcd local --config {{.KubeadmConfigFile}}
7272
`))
7373

74-
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"))
74+
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"))
7575

7676
// printMapInOrder sorts the keys and prints the map in order, combining key
7777
// value pairs with the separator character

0 commit comments

Comments
 (0)