diff --git a/pkg/drivers/kic/oci/oci.go b/pkg/drivers/kic/oci/oci.go index ebc32b6af4..878189e387 100644 --- a/pkg/drivers/kic/oci/oci.go +++ b/pkg/drivers/kic/oci/oci.go @@ -145,15 +145,39 @@ func CreateContainerNode(p CreateParams) error { // label th enode wuth the node ID "--label", p.NodeLabel, } + memcgSwap := true + if runtime.GOOS == "linux" { + if _, err := os.Stat("/sys/fs/cgroup/memory/memsw.limit_in_bytes"); os.IsNotExist(err) { + // requires CONFIG_MEMCG_SWAP_ENABLED or cgroup_enable=memory in grub + glog.Warning("Your kernel does not support swap limit capabilities or the cgroup is not mounted.") + memcgSwap = false + } + } + // https://www.freedesktop.org/wiki/Software/systemd/ContainerInterface/ + var virtualization string if p.OCIBinary == Podman { // enable execing in /var // podman mounts var/lib with no-exec by default https://github.com/containers/libpod/issues/5103 runArgs = append(runArgs, "--volume", fmt.Sprintf("%s:/var:exec", p.Name)) + + if memcgSwap { + runArgs = append(runArgs, fmt.Sprintf("--memory=%s", p.Memory)) + // Disable swap by setting the value to match + runArgs = append(runArgs, fmt.Sprintf("--memory-swap=%s", p.Memory)) + } + + virtualization = "podman" // VIRTUALIZATION_PODMAN } if p.OCIBinary == Docker { runArgs = append(runArgs, "--volume", fmt.Sprintf("%s:/var", p.Name)) // ignore apparmore github actions docker: https://github.com/kubernetes/minikube/issues/7624 runArgs = append(runArgs, "--security-opt", "apparmor=unconfined") + + runArgs = append(runArgs, fmt.Sprintf("--memory=%s", p.Memory)) + // Disable swap by setting the value to match + runArgs = append(runArgs, fmt.Sprintf("--memory-swap=%s", p.Memory)) + + virtualization = "docker" // VIRTUALIZATION_DOCKER } cpuCfsPeriod := true @@ -175,35 +199,6 @@ func CreateContainerNode(p CreateParams) error { runArgs = append(runArgs, fmt.Sprintf("--cpus=%s", p.CPUs)) } - memcgSwap := true - if runtime.GOOS == "linux" { - if _, err := os.Stat("/sys/fs/cgroup/memory/memsw.limit_in_bytes"); os.IsNotExist(err) { - // requires CONFIG_MEMCG_SWAP_ENABLED or cgroup_enable=memory in grub - glog.Warning("Your kernel does not support swap limit capabilities or the cgroup is not mounted.") - memcgSwap = false - } - } - - if p.OCIBinary == Podman && memcgSwap { // swap is required for memory - runArgs = append(runArgs, fmt.Sprintf("--memory=%s", p.Memory)) - // Disable swap by setting the value to match - runArgs = append(runArgs, fmt.Sprintf("--memory-swap=%s", p.Memory)) - } - - if p.OCIBinary == Docker { - runArgs = append(runArgs, fmt.Sprintf("--memory=%s", p.Memory)) - // Disable swap by setting the value to match - runArgs = append(runArgs, fmt.Sprintf("--memory-swap=%s", p.Memory)) - } - - // https://www.freedesktop.org/wiki/Software/systemd/ContainerInterface/ - var virtualization string - if p.OCIBinary == Podman { - virtualization = "podman" // VIRTUALIZATION_PODMAN - } - if p.OCIBinary == Docker { - virtualization = "docker" // VIRTUALIZATION_DOCKER - } runArgs = append(runArgs, "-e", fmt.Sprintf("%s=%s", "container", virtualization)) for key, val := range p.Envs { diff --git a/pkg/minikube/machine/ssh.go b/pkg/minikube/machine/ssh.go index c547ed09d7..0f991e2f2c 100644 --- a/pkg/minikube/machine/ssh.go +++ b/pkg/minikube/machine/ssh.go @@ -42,14 +42,14 @@ func CreateSSHShell(api libmachine.API, cc config.ClusterConfig, n config.Node, return errors.Errorf("%q is not running", machineName) } + client, err := host.CreateSSHClient() + if native { ssh.SetDefaultClient(ssh.Native) } else { ssh.SetDefaultClient(ssh.External) } - client, err := host.CreateSSHClient() - if err != nil { return errors.Wrap(err, "Creating ssh client") } diff --git a/site/content/en/docs/contrib/releasing/binaries.md b/site/content/en/docs/contrib/releasing/binaries.md index 2a320004cd..cd0dd72056 100644 --- a/site/content/en/docs/contrib/releasing/binaries.md +++ b/site/content/en/docs/contrib/releasing/binaries.md @@ -20,13 +20,12 @@ description: > See [ISO release instructions]({{}}) -## Tag KIC base image +## Release new kicbase image -for container drivers (docker,podman), if there has been any change in Dockerfile -(and there is a -snapshot image), should tag with latest release and push to gcr and docker hub and github packages. +If there are changes to the Dockerfile for the docker and/or podman drivers +(and there is a -snapshot image), you should retag it as a new version and push it to GCR, dockerhub and github packages. -for example if you are releasing v0.0.13 and latest kicbase image is v0.0.12-snapshot -should tag v0.0.13 and change the [kic/types.go](https://github.com/medyagh/minikube/blob/635ff53a63e5bb1be4e1abb9067ebe502a16224e/pkg/drivers/kic/types.go#L29-L30) file as well. +For example, if you are releasing v0.0.13 and the current kicbase image tag is v0.0.12-snapshot, you should tag v0.0.13 and change [kic/types.go](https://github.com/medyagh/minikube/blob/635ff53a63e5bb1be4e1abb9067ebe502a16224e/pkg/drivers/kic/types.go#L29-L30) as well. ## Update Release Notes diff --git a/test/integration/functional_test.go b/test/integration/functional_test.go index baedabd59e..52d188190a 100644 --- a/test/integration/functional_test.go +++ b/test/integration/functional_test.go @@ -497,7 +497,7 @@ func validateCacheCmd(ctx context.Context, t *testing.T, profile string) { t.Run("cache", func(t *testing.T) { t.Run("add_remote", func(t *testing.T) { - for _, img := range []string{"k8s.gcr.io/pause:3.0", "k8s.gcr.io/pause:3.3", "k8s.gcr.io/pause:latest"} { + for _, img := range []string{"k8s.gcr.io/pause:3.1", "k8s.gcr.io/pause:3.3", "k8s.gcr.io/pause:latest"} { rr, err := Run(t, exec.CommandContext(ctx, Target(), "-p", profile, "cache", "add", img)) if err != nil { t.Errorf("failed to 'cache add' remote image %q. args %q err %v", img, rr.Command(), err) @@ -587,7 +587,7 @@ func validateCacheCmd(ctx context.Context, t *testing.T, profile string) { // delete will clean up the cached images since they are global and all other tests will load it for no reason t.Run("delete", func(t *testing.T) { - for _, img := range []string{"k8s.gcr.io/pause:3.0", "k8s.gcr.io/pause:latest"} { + for _, img := range []string{"k8s.gcr.io/pause:3.1", "k8s.gcr.io/pause:latest"} { rr, err := Run(t, exec.CommandContext(ctx, Target(), "cache", "delete", img)) if err != nil { t.Errorf("failed to delete %s from cache. args %q: %v", img, rr.Command(), err)