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 minikube start not working without sudo on none driver #16408

Merged
merged 6 commits into from May 8, 2023

Conversation

spowelljr
Copy link
Member

@spowelljr spowelljr commented Apr 28, 2023

Fixes #16400
Closes #16393

Discovered that the regression was caused by fd549f3

kv, err := util.ParseKubernetesVersion(cc.KubernetesConfig.KubernetesVersion)
if err == nil && kv.GTE(semver.MustParse("1.24.0-alpha.2")) {
klog.Infof("%q driver + %s runtime found, recommending bridge", cc.Driver, cc.KubernetesConfig.ContainerRuntime)
return Bridge{cc: cc}
}

Before, no CNI would be used, but now if using Docker CRI with K8s v1.24+, we default to using the bridge CNI and it's failing to chmod the bridge conflist chmod /etc/cni/net.d/1-k8s.conflist: permission denied.

The cause of the chmod permission error is we were calling os.Chmod on files in the /var/lib/minikube/binaries/<K8s_version> dir which has the ownership of root:root, causing the error.

Changed it so we chmod the file in the tmp dir before we copy them to their destination, as we may not have permission to chmod them after we copy them, like above.

Also removed sudo -E from none docs and none tests so we will catch something like this going forward.

@k8s-ci-robot k8s-ci-robot added the cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. label Apr 28, 2023
@k8s-ci-robot k8s-ci-robot added approved Indicates a PR has been approved by an approver from all required OWNERS files. size/M Denotes a PR that changes 30-99 lines, ignoring generated files. labels Apr 28, 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 Apr 28, 2023
@minikube-pr-bot

This comment has been minimized.

@minikube-pr-bot

This comment has been minimized.

@minikube-pr-bot

This comment has been minimized.

@minikube-pr-bot
Copy link

kvm2 driver with docker runtime

+----------------+----------+---------------------+
|    COMMAND     | MINIKUBE | MINIKUBE (PR 16408) |
+----------------+----------+---------------------+
| minikube start | 49.8s    | 50.5s               |
| enable ingress | 25.5s    | 26.7s               |
+----------------+----------+---------------------+

Times for minikube ingress: 25.7s 25.2s 23.7s 27.7s 25.2s
Times for minikube (PR 16408) ingress: 25.7s 27.2s 25.7s 27.2s 27.7s

Times for minikube start: 51.9s 52.9s 48.4s 47.3s 48.6s
Times for minikube (PR 16408) start: 49.2s 53.0s 47.3s 51.8s 51.0s

docker driver with docker runtime

+----------------+----------+---------------------+
|    COMMAND     | MINIKUBE | MINIKUBE (PR 16408) |
+----------------+----------+---------------------+
| minikube start | 21.9s    | 22.3s               |
| enable ingress | 33.7s    | 21.5s               |
+----------------+----------+---------------------+

Times for minikube start: 21.6s 21.8s 21.8s 22.6s 21.5s
Times for minikube (PR 16408) start: 23.2s 21.7s 22.2s 22.4s 22.3s

Times for minikube ingress: 22.0s 83.0s 22.0s 20.5s 21.0s
Times for minikube (PR 16408) ingress: 22.0s 20.0s 21.0s 22.5s 22.0s

docker driver with containerd runtime

+----------------+----------+---------------------+
|    COMMAND     | MINIKUBE | MINIKUBE (PR 16408) |
+----------------+----------+---------------------+
| minikube start | 21.2s    | 20.5s               |
| enable ingress | 39.9s    | 35.8s               |
+----------------+----------+---------------------+

Times for minikube start: 20.9s 20.9s 20.0s 23.5s 20.6s
Times for minikube (PR 16408) start: 20.0s 21.4s 20.5s 20.3s 20.3s

Times for minikube ingress: 36.5s 49.0s 31.5s 49.5s 33.0s
Times for minikube (PR 16408) ingress: 32.5s 48.0s 32.0s 33.0s 33.5s

@minikube-pr-bot
Copy link

These are the flake rates of all failed tests.

Environment Failed Tests Flake Rate (%)
Hyperkit_macOS TestNetworkPlugins/group/custom-flannel/Start (gopogh) 0.63 (chart)
KVM_Linux TestMultiNode/serial/DeleteNode (gopogh) 4.19 (chart)
KVM_Linux TestMultiNode/serial/RestartKeepsNodes (gopogh) 5.39 (chart)
Hyperkit_macOS TestPause/serial/SecondStartNoReconfiguration (gopogh) 12.03 (chart)
KVM_Linux TestMultiNode/serial/StartAfterStop (gopogh) 15.57 (chart)
Hyper-V_Windows TestNoKubernetes/serial/StartWithK8s (gopogh) 43.75 (chart)

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

@medyagh medyagh merged commit 08e42e5 into kubernetes:master May 8, 2023
23 of 38 checks passed
@k8s-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: medyagh, 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

@spowelljr spowelljr deleted the fixChmod branch May 8, 2023 20:44
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
4 participants