Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

improve how CRs and k8s work with CNI plugins and cgroup drivers #15463

Merged
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
50 commits
Select commit Hold shift + click to select a range
11a8dbf
fix TestNetworkPlugins tests for Linux with Docker driver
prezha Dec 5, 2022
5d0ac9d
cleanup
prezha Dec 5, 2022
796a4b8
cleanup
prezha Dec 5, 2022
bd7efa0
fix additional issues found
prezha Dec 7, 2022
394302c
remove unrelated kvm stuff
prezha Dec 7, 2022
1a97245
increase wait timeout to mitigate ImagePullBackOff errors
prezha Dec 7, 2022
a7b6923
poc
prezha Dec 9, 2022
9ac814a
test cri-dockerd v0.2.6
prezha Dec 10, 2022
cc9efaa
lint
prezha Dec 10, 2022
670c294
debug
prezha Dec 11, 2022
19812b0
debug
prezha Dec 11, 2022
0fa75ce
use systemd
prezha Dec 11, 2022
4cd9a94
use systemd
prezha Dec 12, 2022
788a9d6
wait and log
prezha Dec 12, 2022
72c8acc
fix Docker_Linux and multinode
prezha Dec 13, 2022
7e20c16
collect debug logs
prezha Dec 13, 2022
d3bdac0
fix containerd when bound to docker
prezha Dec 13, 2022
e51fef3
prevent overlapping network segments
prezha Dec 14, 2022
4e0994c
Merge remote-tracking branch 'upstream/master' into fix-TestNetworkPl…
prezha Dec 17, 2022
167d90f
improve log collection and update flannel manifest
prezha Dec 18, 2022
9531b37
fix subnet reservation
prezha Dec 19, 2022
735ac02
get container logs
prezha Dec 19, 2022
e59d621
autoconfigure cni and cri with proper cgroup driver
prezha Dec 26, 2022
5d13061
Merge branch 'master' into fix-TestNetworkPlugins-Linux_Docker
prezha Dec 26, 2022
2a00282
work around non-linux builds for cgroups detection
prezha Dec 26, 2022
5146469
gotcha
prezha Dec 26, 2022
f3b3d4e
try to fix couple of more things
prezha Dec 27, 2022
fd549f3
fix default cni selection for cri-docker(d)
prezha Dec 28, 2022
1274f31
fix TestBinaryUpgrade on Docker_Linux_containerd and skip GCPAuth on GCE
prezha Dec 28, 2022
818a7d9
fix remaining tests and ready for k8s-1.26.0
prezha Jan 4, 2023
149e9a0
Merge branch 'master' into fix-TestNetworkPlugins-Linux_Docker
prezha Jan 4, 2023
f040f00
tweak tests
prezha Jan 5, 2023
faa909d
Merge branch 'kubernetes:master' into fix-TestNetworkPlugins-Linux_Do…
prezha Jan 5, 2023
6c98afc
cleanup and containerd systemd cgroup issue workaround
prezha Jan 9, 2023
f1b1724
address comments
prezha Jan 10, 2023
fbe2c19
Update test/integration/main_test.go
prezha Jan 10, 2023
7703fee
Update pkg/network/network.go
prezha Jan 10, 2023
da3af5a
Update pkg/minikube/node/start.go
prezha Jan 10, 2023
4a8e7ad
address comments
prezha Jan 10, 2023
24226c5
Merge branch 'master' into fix-TestNetworkPlugins-Linux_Docker
prezha Jan 10, 2023
805f7b2
lint
prezha Jan 10, 2023
a573330
fix updateContainerdBinary
prezha Jan 12, 2023
0e3ebc7
go mod tidy
prezha Jan 12, 2023
23351ba
Update pkg/kapi/kapi.go
prezha Jan 12, 2023
470e7b6
Update pkg/minikube/cruntime/cri.go
prezha Jan 12, 2023
4fbcdfc
reference follow up issue
prezha Jan 12, 2023
e2f2bc9
fix none driver
prezha Jan 13, 2023
4c18f9d
fix cri-o: work with selected cni and detected cgroup driver
prezha Jan 18, 2023
15bb620
Merge branch 'master' into fix-TestNetworkPlugins-Linux_Docker
prezha Jan 18, 2023
1eb68e8
fix cri-o: ignore disabled cnis
prezha Jan 19, 2023
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
fix none driver
  • Loading branch information
prezha committed Jan 13, 2023
commit e2f2bc923a4c1a10fb95148f79352e0aa0d7f198
5 changes: 0 additions & 5 deletions pkg/minikube/cni/cni.go
Original file line number Diff line number Diff line change
Expand Up @@ -138,11 +138,6 @@ func chooseDefault(cc config.ClusterConfig) Manager {
return Bridge{}
}

if driver.BareMetal(cc.Driver) {
klog.Infof("Driver %s used, CNI unnecessary in this configuration, recommending no CNI", cc.Driver)
return Disabled{cc: cc}
}

if len(cc.Nodes) > 1 || cc.MultiNodeRequested {
// Enables KindNet CNI in master in multi node cluster, This solves the network problem
// inside pod for multi node clusters. See https://github.com/kubernetes/minikube/issues/9838.
Expand Down
6 changes: 1 addition & 5 deletions pkg/minikube/cruntime/cruntime.go
Original file line number Diff line number Diff line change
Expand Up @@ -345,11 +345,7 @@ func ConfigureNetworkPlugin(r Manager, cr CommandRunner, networkPlugin string) e
}
return nil
}
dm, ok := r.(*Docker)
if !ok {
return fmt.Errorf("name and type mismatch")
}
return dockerConfigureNetworkPlugin(*dm, cr, networkPlugin)
return dockerConfigureNetworkPlugin(cr, networkPlugin)
}

// updateCRIDockerdBinary updates cri-dockerd to version
Expand Down
4 changes: 2 additions & 2 deletions pkg/minikube/cruntime/docker.go
Original file line number Diff line number Diff line change
Expand Up @@ -699,7 +699,7 @@ const (
CNICacheDir = "/var/lib/cni/cache"
)

func dockerConfigureNetworkPlugin(r Docker, cr CommandRunner, networkPlugin string) error {
func dockerConfigureNetworkPlugin(cr CommandRunner, networkPlugin string) error {
// $ cri-dockerd --version
// cri-dockerd 0.2.6 (d8accf7)
// $ cri-dockerd --help | grep -i cni
Expand Down Expand Up @@ -738,5 +738,5 @@ ExecStart=/usr/bin/cri-dockerd --container-runtime-endpoint fd:// --network-plug
if err := cr.Copy(svc); err != nil {
return errors.Wrap(err, "failed to copy template")
}
return r.Init.Restart("cri-docker")
return nil
}
13 changes: 5 additions & 8 deletions pkg/minikube/node/start.go
Original file line number Diff line number Diff line change
Expand Up @@ -417,9 +417,9 @@ func configureRuntimes(runner cruntime.CommandRunner, cc config.ClusterConfig, k
inUserNamespace := strings.Contains(cc.KubernetesConfig.FeatureGates, "KubeletInUserNamespace=true")
// for docker container runtime: ensure containerd is properly configured by calling Enable(), as docker could be bound to containerd
// it will also "soft" start containerd, but it will not disable others; docker will disable containerd if not used in the next step
if co.Type == "docker" {
if co.Type == constants.Docker {
containerd, err := cruntime.New(cruntime.Config{
Type: "containerd",
Type: constants.Containerd,
Socket: "", // use default
Runner: co.Runner,
ImageRepository: co.ImageRepository,
Expand All @@ -434,20 +434,17 @@ func configureRuntimes(runner cruntime.CommandRunner, cc config.ClusterConfig, k
}

disableOthers := !driver.BareMetal(cc.Driver)
err = cr.Enable(disableOthers, cgroupDriver(cc), inUserNamespace)
if err != nil {
if err = cr.Enable(disableOthers, cgroupDriver(cc), inUserNamespace); err != nil {
exit.Error(reason.RuntimeEnable, "Failed to enable container runtime", err)
}

// Wait for the CRI to be "live", before returning it
err = waitForCRISocket(runner, cr.SocketPath(), 60, 1)
if err != nil {
if err = waitForCRISocket(runner, cr.SocketPath(), 60, 1); err != nil {
exit.Error(reason.RuntimeEnable, "Failed to start container runtime", err)
}

// Wait for the CRI to actually work, before returning
err = waitForCRIVersion(runner, cr.SocketPath(), 60, 10)
if err != nil {
if err = waitForCRIVersion(runner, cr.SocketPath(), 60, 10); err != nil {
exit.Error(reason.RuntimeEnable, "Failed to start container runtime", err)
}

Expand Down