Use the cgroup-driver from runtime for kubelet

pull/6287/head
Anders F Björklund 2020-01-12 19:29:07 +01:00
parent 27f8adf912
commit 0e83dd4b4e
3 changed files with 10 additions and 2 deletions

View File

@ -41,6 +41,11 @@ func NewKubeletConfig(k8s config.KubernetesConfig, r cruntime.Manager) ([]byte,
return nil, errors.Wrap(err, "generating extra configuration for kubelet")
}
cgroupDriver, err := r.CGroupDriver()
if err == nil {
extraOpts["cgroup-driver"] = cgroupDriver
}
for k, v := range r.KubeletOptions() {
extraOpts[k] = v
}

View File

@ -21,6 +21,7 @@ import (
"testing"
"github.com/pmezard/go-difflib/difflib"
"k8s.io/minikube/pkg/minikube/command"
"k8s.io/minikube/pkg/minikube/config"
"k8s.io/minikube/pkg/minikube/constants"
"k8s.io/minikube/pkg/minikube/cruntime"
@ -135,7 +136,8 @@ ExecStart=/var/lib/minikube/binaries/v1.17.0/kubelet --authorization-mode=Webhoo
for _, tc := range tests {
t.Run(tc.description, func(t *testing.T) {
runtime, err := cruntime.New(cruntime.Config{Type: tc.cfg.ContainerRuntime})
runtime, err := cruntime.New(cruntime.Config{Type: tc.cfg.ContainerRuntime,
Runner: command.NewFakeCommandRunner()})
if err != nil {
t.Fatalf("runtime: %v", err)
}

View File

@ -157,12 +157,13 @@ func (k *Bootstrapper) StartCluster(k8s config.KubernetesConfig) error {
return errors.Wrap(err, "parsing kubernetes version")
}
extraFlags := bsutil.CreateFlagsFromExtraArgs(k8s.ExtraOptions)
r, err := cruntime.New(cruntime.Config{Type: k8s.ContainerRuntime})
if err != nil {
return err
}
extraFlags := bsutil.CreateFlagsFromExtraArgs(k8s.ExtraOptions)
ignore := []string{
fmt.Sprintf("DirAvailable-%s", strings.Replace(vmpath.GuestManifestsDir, "/", "-", -1)),
fmt.Sprintf("DirAvailable-%s", strings.Replace(vmpath.GuestPersistentDir, "/", "-", -1)),