-
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
cache reload
does not appear to be working properly
#10060
Comments
It only looks at the repo:tag, so it will only see that "alpine:test" is already there.
There is no matching "AlwaysPullImages" option (yet?), it assumes unique tags There is some old broken code to check id/digest |
I see, so even if the Image ID changes, if the repo:tag is the same, reloading won't help, and if you want to use a different image, you have to add a unique tag? So when is reload used? |
There might be a bug (change of behaviour) in the "cache" command, after adding the preload... It now checks the image list (repo:tag), even before comparing the Id and/or Digest whatsoever.
It would also add any missing images, or any that was added after the cluster was initially created |
Problem here is that an image on disk doesn't have any Id or Digest, that is added by the daemon/registry. So you need to either load it locally (eew) or talk to the registry (eeew), whichever is worst (we do both of them). There is also some compatibility issues with At the moment, we can't even agree on the name of the container image. Much less on the actual contents.
Short-term fix will probably be to re-visit the preload code and maybe add an --always flag to minikube cache. Assuming that the daemon/registry code for digest even works, I have some doubts about that: |
@afbjorklund
As you said, it's short term, but I'm going to try to implement it this way, but I've never contributed to minikube, so I don't know the difficulty level. |
Sad thing is that neither Id nor Digest will work with all container runtimes and also offline (without a registry)... I added a new feature to clean up the patched library, we can use this particular issue to go past the name only ? |
Hello @afbjorklund |
If the image already exists in the docker daemon, it will not pull anything from the registry.
It actually always checks with dockerd, even if there no such thing running on the host.
|
So the current workaround would be That will update the image in the daemon with the new one from the registry. |
@afbjorklund Thanks for the response. Btw I see a new warning message on Minikube v1.18.1
But the docs don't mention minikube image load: https://minikube.sigs.k8s.io/docs/handbook/pushing/ |
@seperman : I'm actually not sure why @priyawadhwa wrote that "cache" would be deprecated e8945f2 They don't do exactly the same thing, even if they do share some code. The "cache" command has a memory However, the "image load" and "image build" commands now have slightly better documentation (placeholders) |
@priyawadhwa Would you please explain why you committed the warning that 'cache add' would be deprecated as per the above? Your help is appreciated. |
Also if you could briefly explain the difference of |
I think Priya has handed over the feature to other members of the team, so I'm not sure if she's able to answer (but please do if you can). Both commands are using the ~/.minikube cache folder for caching images that they pull from the daemon or from remote. But they come from different backgrounds:
Available Commands:
Available Commands: So the main difference between "cache add" and "image load", is if it is added to the minikube config as a memory or not. $ minikube cache list
alpine:latest
busybox:latest
$ more /.minikube/config/config.json
{
"cache": {
"alpine:latest": null,
"busybox:latest": null
}
} |
The main problem in this issue, is that the current code only checks the name and the tag to see if it "already exists". There is no equivalent to the "pull policy" of Kubernetes, where you can choose to replace the already existing images:
And the current handling of the short names and the id/digest is also rather confusing and could be improved upon. |
@afbjorklund Thanks much for this detail; very helpful. The 'memory' attributes are the primary attraction of I agree that evolving |
We are currently discussing how to be best handle the Id and Digest discrepancies, between different methods and runtimes. This is the |
For Theoretically it could stream the images to the cluster right from the local daemon or the remote registry. |
Thanks for the clarification. |
@afbjorklund Above you said:
Can you clarify what I ask because I'm not getting any type of successful result from inside a |
Rereading, maybe I've misunderstood the context above. I'm trying to update the image in minikube but it isn't updating as detailed above. In my case, I've got an external registry. Normally for a remote k8s install I'd build the image and push it to the external registry, then deploy on k8s (which has access to talk to the registry). But to test locally on minikube, I don't want to push the untested, potentially incomplete image. I want to push it into minikube for testing first. So,
And minikube still has the prior version. I deleted the image from minikube (verified gone with cache and image commands), deleted it from my host, rebuilt it, pushed again (cache add or image load)... the old image version comes back. The only way I was able to get it to work was to do an |
@dbingham I guess it's coming from the I found that @afbjorklund Isn't it a bug that images are not removed from |
Probably ill-defined, at least. Actually I don't know why the image commands are using the cache directory at all. But now that they do, it should probably have matching semantics like you say - remove it from cache, if it adds it. |
This was for the cluster internal registry, as from the add-on. I don't think we support a host registry yet, but it would be a nice feature to have. It would be a better option, than connecting to an external host daemon or podman. Sorry for the late reply. |
The Kubernetes project currently lacks enough contributors to adequately respond to all issues and PRs. This bot triages issues and PRs according to the following rules:
You can:
Please send feedback to sig-contributor-experience at kubernetes/community. /lifecycle stale |
The Kubernetes project currently lacks enough active contributors to adequately respond to all issues and PRs. This bot triages issues and PRs according to the following rules:
You can:
Please send feedback to sig-contributor-experience at kubernetes/community. /lifecycle rotten |
Steps to reproduce the issue:
Add a cache with the following command
minikube cache add alpine:test
Enter the minikube container and check if the image exists
Reload the cache
minikube cache reload alpine:test
I check the image again, but it hasn't changed
Optional: Full output of
minikube logs
command:The text was updated successfully, but these errors were encountered: