diff --git a/pkg/minikube/bootstrapper/kubeadm/templates.go b/pkg/minikube/bootstrapper/kubeadm/templates.go index 90ff5a6a14de..b683b0e2645a 100644 --- a/pkg/minikube/bootstrapper/kubeadm/templates.go +++ b/pkg/minikube/bootstrapper/kubeadm/templates.go @@ -41,12 +41,14 @@ nodeName: {{.NodeName}} {{end}}`)) var kubeletSystemdTemplate = template.Must(template.New("kubeletSystemdTemplate").Parse(` +[Unit] +{{if or (eq .ContainerRuntime "cri-o") (eq .ContainerRuntime "cri")}}Wants=crio.service{{else}}Wants=docker.socket{{end}} + [Service] ExecStart= ExecStart=/usr/bin/kubelet {{.ExtraOptions}} {{if .FeatureGates}}--feature-gates={{.FeatureGates}}{{end}} [Install] -{{if or (eq .ContainerRuntime "cri-o") (eq .ContainerRuntime "cri")}}Wants=crio.service{{else}}Wants=docker.socket{{end}} `)) const kubeletService = ` diff --git a/pkg/minikube/bootstrapper/kubeadm/versions.go b/pkg/minikube/bootstrapper/kubeadm/versions.go index d0680ec52be0..062461055170 100644 --- a/pkg/minikube/bootstrapper/kubeadm/versions.go +++ b/pkg/minikube/bootstrapper/kubeadm/versions.go @@ -175,7 +175,7 @@ var versionSpecificOpts = []VersionedExtraOption{ NewUnversionedOption(Kubelet, "bootstrap-kubeconfig", "/etc/kubernetes/bootstrap-kubelet.conf"), { Option: util.ExtraOption{ - Component: Apiserver, + Component: Kubelet, Key: "require-kubeconfig", Value: "true", },