-
Notifications
You must be signed in to change notification settings - Fork 4.9k
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
VM drivers: Fix images getting removed on stop/start #16655
Conversation
/ok-to-test |
kvm2 driver with docker runtime
Times for minikube start: 53.9s 53.9s 54.3s 53.5s 52.6s Times for minikube ingress: 27.8s 27.8s 28.3s 29.3s 29.3s docker driver with docker runtime
Times for minikube ingress: 21.0s 21.0s 20.5s 21.0s 20.9s Times for minikube (PR 16655) start: 25.2s 26.2s 26.0s 23.4s 24.8s docker driver with containerd runtime
Times for minikube start: 24.5s 24.5s 21.4s 24.5s 23.8s Times for minikube ingress: 31.4s 21.4s 18.4s 31.4s 31.4s |
These are the flake rates of all failed tests.
To see the flake rates of all tests by environment, click here. |
klog.Infof("preload failed, will try to load cached images: %v", err) | ||
switch err.(type) { | ||
case *cruntime.ErrISOFeature: | ||
out.ErrT(style.Tip, "Existing disk is missing new features ({{.error}}). To upgrade, run 'minikube delete'", out.V{"error": err}) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If deleteOnFailure flag is specified minikube should delete and recreate
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You want that added to the message?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
hm...I was thinking maybe if the user allows us to delete minikube we just do it
if --deleteOnFailure...then recreate the cluster instead of telling the user to do it..
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I tried using --delete-on-failure
, but it seems that it only applies to creating the cluster, since the cluster is already created once we get here and this is K8s logic it doesn't retry. If we want this I'd recommend it be in a separate PR since there will have to be a lot of logic added for it.
minikube start --driver qemu --delete-on-failure=true
😄 minikube v1.30.1 on Darwin 13.4 (arm64)
✨ Using the qemu2 driver based on user configuration
🌐 Automatically selected the socket_vmnet network
👍 Starting control plane node minikube in cluster minikube
🔥 Creating qemu2 VM (CPUs=2, Memory=4000MB, Disk=20000MB) ...
🐳 Preparing Kubernetes v1.27.2 on Docker 24.0.2 ...
❌ Exiting due to K8S_INSTALL_FAILED: Failed to update cluster: this error is expected
╭───────────────────────────────────────────────────────────────────────────────────────────╮
│ │
│ 😿 If the above advice does not help, please let us know: │
│ 👉 https://github.com/kubernetes/minikube/issues/new/choose │
│ │
│ Please run `minikube logs --file=logs.txt` and attach logs.txt to the GitHub issue. │
│ │
╰───────────────────────────────────────────────────────────────────────────────────────────╯
klog.Infof("preload failed, will try to load cached images: %v", err) | ||
switch err.(type) { | ||
case *cruntime.ErrISOFeature: | ||
out.ErrT(style.Tip, "Existing disk is missing new features ({{.error}}). To upgrade, run 'minikube delete'", out.V{"error": err}) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
hm...I was thinking maybe if the user allows us to delete minikube we just do it
if --deleteOnFailure...then recreate the cluster instead of telling the user to do it..
Really good job on this PR @spowelljr
and also makes KVM Containerd test much faster |
[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 |
Fixes #12217
For full details see: #12217 (comment)
The short is that on a VM driver using the containerd or cri-o runtime, when starting after a stop, we would check for the existence of preload images prior to CRIs being configured and started, resulting in an empty image list being returned. This would then trigger to untar the preload and overwrite all the existing image on the machine. There's another preload check later on after the CRIs are configured and started, which is why the wasn't an issue with Docker driver.
Also reduces startup time on subsequent starts by 40 seconds (40%)
Before:
After: