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

Fix network not found not being detected on new Docker versions #17323

Merged
merged 2 commits into from Oct 3, 2023

Conversation

spowelljr
Copy link
Member

@spowelljr spowelljr commented Sep 29, 2023

Fixes #17278

Docker 20.X.X and before returns No such network when network isn't found
Docker 23.X.X and later returns network %s not found when network isn't found

We only had a check for No such network so we were outputting an error on newer versions of Docker

Before

$ docker network create --driver=bridge --subnet=192.168.49.0/24 --gateway=192.168.49.1 -o --ip-masq -o --icc -o com.docker.network.driver.mtu=65535 --label=created_by.minikube.sigs.k8s.io=true --label=name.minikube.sigs.k8s.io=minikube abcde123
2e7f334091b6401798a1449bb0aff8e793f80581fa240e1c2a8e52dba7ddbe95

$ minikube start --network abcde123 -p p2
πŸ˜„  [p2] minikube v1.31.2 on Debian 11.7 (amd64)
✨  Automatically selected the docker driver. Other choices: qemu2, ssh
πŸ“Œ  Using Docker driver with root privileges
πŸ‘  Starting control plane node p2 in cluster p2
🚜  Pulling base image ...
πŸ”₯  Creating docker container (CPUs=2, Memory=8000MB) ...
🐳  Preparing Kubernetes v1.28.2 on Docker 24.0.6 ...E0929 17:13:22.689810 2528575 start.go:131] Unable to get host IP: network inspect: docker network inspect p2 --format "{"Name": "{{.Name}}","Driver": "{{.Driver}}","Subnet": "{{range .IPAM.Config}}{{.Subnet}}{{end}}","Gateway": "{{range .IPAM.Config}}{{.Gateway}}{{end}}","MTU": {{if (index .Options "com.docker.network.driver.mtu")}}{{(index .Options "com.docker.network.driver.mtu")}}{{else}}0{{end}}, "ContainerIPs": [{{range $k,$v := .Containers }}"{{$v.IPv4Address}}",{{end}}]}": exit status 1
stdout:


stderr:
Error response from daemon: network p2 not found

    β–ͺ Generating certificates and keys ...
    β–ͺ Booting up control plane ...
    β–ͺ Configuring RBAC rules ...
πŸ”—  Configuring bridge CNI (Container Networking Interface) ...
    β–ͺ Using image gcr.io/k8s-minikube/storage-provisioner:v5
πŸ”Ž  Verifying Kubernetes components...
🌟  Enabled addons: storage-provisioner, default-storageclass
πŸ„  Done! kubectl is now configured to use "p2" cluster and "default" namespace by default

After:

$ docker network create --driver=bridge --subnet=192.168.49.0/24 --gateway=192.168.49.1 -o --ip-masq -o --icc -o com.docker.network.driver.mtu=65535 --label=created_by.minikube.sigs.k8s.io=true --label=name.minikube.sigs.k8s.io=minikube abcde123
2e7f334091b6401798a1449bb0aff8e793f80581fa240e1c2a8e52dba7ddbe95

$ minikube start --network abcde123 -p p2
πŸ˜„  [p2] minikube v1.31.2 on Debian 11.7 (amd64)
✨  Automatically selected the docker driver. Other choices: qemu2, ssh
πŸ“Œ  Using Docker driver with root privileges
πŸ‘  Starting control plane node p2 in cluster p2
🚜  Pulling base image ...
πŸ”₯  Creating docker container (CPUs=2, Memory=8000MB) ...
🐳  Preparing Kubernetes v1.28.2 on Docker 24.0.6 ...
    β–ͺ Generating certificates and keys ...
    β–ͺ Booting up control plane ...
    β–ͺ Configuring RBAC rules ...
πŸ”—  Configuring bridge CNI (Container Networking Interface) ...
πŸ”Ž  Verifying Kubernetes components...
    β–ͺ Using image gcr.io/k8s-minikube/storage-provisioner:v5
🌟  Enabled addons: storage-provisioner, default-storageclass
πŸ„  Done! kubectl is now configured to use "p2" cluster and "default" namespace by default

@k8s-ci-robot k8s-ci-robot added the cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. label Sep 29, 2023
@k8s-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: spowelljr

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@k8s-ci-robot k8s-ci-robot added approved Indicates a PR has been approved by an approver from all required OWNERS files. size/S Denotes a PR that changes 10-29 lines, ignoring generated files. labels Sep 29, 2023
@k8s-ci-robot k8s-ci-robot added size/M Denotes a PR that changes 30-99 lines, ignoring generated files. and removed size/S Denotes a PR that changes 10-29 lines, ignoring generated files. labels Sep 29, 2023
@spowelljr
Copy link
Member Author

/ok-to-test

@k8s-ci-robot k8s-ci-robot added the ok-to-test Indicates a non-member PR verified by an org member that is safe to test. label Sep 29, 2023
@medyagh
Copy link
Member

medyagh commented Oct 2, 2023

/ok-to-test

@minikube-pr-bot
Copy link

kvm2 driver with docker runtime

+----------------+----------+---------------------+
|    COMMAND     | MINIKUBE | MINIKUBE (PR 17323) |
+----------------+----------+---------------------+
| minikube start | 51.7s    | 52.0s               |
| enable ingress | 28.5s    | 27.9s               |
+----------------+----------+---------------------+

Times for minikube start: 53.0s 51.4s 52.5s 50.1s 51.7s
Times for minikube (PR 17323) start: 53.5s 52.5s 49.8s 52.8s 51.3s

Times for minikube ingress: 27.7s 28.2s 29.1s 28.2s 29.6s
Times for minikube (PR 17323) ingress: 28.2s 28.7s 24.7s 28.7s 29.2s

docker driver with docker runtime

+----------------+----------+---------------------+
|    COMMAND     | MINIKUBE | MINIKUBE (PR 17323) |
+----------------+----------+---------------------+
| minikube start | 24.3s    | 23.7s               |
| enable ingress | 21.2s    | 21.0s               |
+----------------+----------+---------------------+

Times for minikube ingress: 20.8s 20.8s 22.8s 20.8s 20.8s
Times for minikube (PR 17323) ingress: 20.8s 20.8s 20.8s 21.9s 20.8s

Times for minikube start: 25.5s 22.6s 24.5s 24.0s 24.8s
Times for minikube (PR 17323) start: 25.2s 24.4s 24.3s 22.1s 22.7s

docker driver with containerd runtime

+-------------------+----------+---------------------+
|      COMMAND      | MINIKUBE | MINIKUBE (PR 17323) |
+-------------------+----------+---------------------+
| minikube start    | 20.9s    | 23.2s               |
| ⚠️  enable ingress | 29.7s    | 35.5s ⚠️             |
+-------------------+----------+---------------------+

Times for minikube start: 21.0s 20.0s 19.8s 23.9s 19.9s
Times for minikube (PR 17323) start: 23.8s 22.6s 22.9s 23.6s 22.8s

Times for minikube ingress: 19.3s 31.3s 19.3s 31.3s 47.3s
Times for minikube (PR 17323) ingress: 30.3s 19.3s 48.3s 31.4s 48.3s

@minikube-pr-bot
Copy link

These are the flake rates of all failed tests.

Environment Failed Tests Flake Rate (%)
Docker_macOS TestMountStart/serial/VerifyMountSecond (gopogh) 0.87 (chart)
Hyperkit_macOS TestJSONOutput/start/parallel/DistinctCurrentSteps (gopogh) 0.88 (chart)
Hyperkit_macOS TestJSONOutput/start/parallel/IncreasingCurrentSteps (gopogh) 0.88 (chart)
KVM_Linux TestMultiNode/serial/StartAfterStop (gopogh) 1.59 (chart)
Docker_Linux_crio_arm64 TestFunctional/parallel/MountCmd/specific-port (gopogh) 1.60 (chart)
Docker_macOS TestCertOptions (gopogh) 5.13 (chart)
Docker_macOS TestDockerFlags (gopogh) 5.13 (chart)
Docker_macOS TestForceSystemdEnv (gopogh) 5.13 (chart)
Docker_macOS TestForceSystemdFlag (gopogh) 5.13 (chart)
Docker_macOS TestInsufficientStorage (gopogh) 5.13 (chart)
Docker_macOS TestMultiNode/serial/AddNode (gopogh) 5.13 (chart)
Docker_macOS TestMultiNode/serial/CopyFile (gopogh) 5.13 (chart)
Docker_macOS TestMultiNode/serial/DeleteNode (gopogh) 5.13 (chart)
Docker_macOS TestMultiNode/serial/DeployApp2Nodes (gopogh) 5.13 (chart)
Docker_macOS TestMultiNode/serial/FreshStart2Nodes (gopogh) 5.13 (chart)
Docker_macOS TestMultiNode/serial/PingHostFrom2Pods (gopogh) 5.13 (chart)
Docker_macOS TestMultiNode/serial/ProfileList (gopogh) 5.13 (chart)
Docker_macOS TestMultiNode/serial/RestartKeepsNodes (gopogh) 5.13 (chart)
Docker_macOS TestMultiNode/serial/RestartMultiNode (gopogh) 5.13 (chart)
Docker_macOS TestMultiNode/serial/StartAfterStop (gopogh) 5.13 (chart)
Docker_macOS TestMultiNode/serial/StopMultiNode (gopogh) 5.13 (chart)
Docker_macOS TestMultiNode/serial/StopNode (gopogh) 5.13 (chart)
Docker_macOS TestOffline (gopogh) 5.13 (chart)
Docker_macOS TestScheduledStopUnix (gopogh) 5.13 (chart)
Docker_macOS TestSkaffold (gopogh) 5.13 (chart)
Hyper-V_Windows TestNoKubernetes/serial/StartWithK8s (gopogh) 6.25 (chart)
Docker_Linux_crio_arm64 TestPause/serial/SecondStartNoReconfiguration (gopogh) 8.80 (chart)
Hyperkit_macOS TestNoKubernetes/serial/StartWithK8s (gopogh) 9.65 (chart)
Hyperkit_macOS TestNoKubernetes/serial/StartWithStopK8s (gopogh) 9.65 (chart)
Hyper-V_Windows TestRunningBinaryUpgrade (gopogh) 37.50 (chart)

To see the flake rates of all tests by environment, click here.

@medyagh medyagh merged commit ada5465 into kubernetes:master Oct 3, 2023
29 of 43 checks passed
@spowelljr spowelljr deleted the fixNetworkError branch October 3, 2023 17:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
approved Indicates a PR has been approved by an approver from all required OWNERS files. cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. ok-to-test Indicates a non-member PR verified by an org member that is safe to test. size/M Denotes a PR that changes 30-99 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Error configuring minikube with docker driver and custom network
4 participants