-
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
Failed to pull image that is pushed with minikube image build #16036
Comments
The removing is a bug, not sure if it had a separate ticket but |
Wonder if it is a mismatch between |
It seems like both the build and the run need to use the full image, otherwise containerd can't find it.
"docker.io/library/testapp2:latest"
Otherwise buildkitd tags the image as "testapp2:latest", but containerd does a magic docker.io/library prefix. Then the prefix will be randomly hidden and added, in different kube commands, because there is no standard. Maybe it should add a fake registry, like podman ? "localhost/testapp2:latest" |
Then again, the deployment fails on podman/CRI-O too - mostly for the same reason. Magic prefixes. minikube image build -t testapp2 testbuild minikube kubectl -- run testapp2 --image=testapp2:latest --image-pull-policy=Never --restart=Never
So that is not a solution. 😭 |
Thx! @afbjorklund. You are right, using the full image worked! Then also the rm command worked. Unfortunately, I don't have the knowledge on containerd or minikube to explain why :) |
Once upon a time, everything just used docker.io and amd64 and it was the default and it was hardcoded everywhere. |
Kubernetes calls this function, on all image references: https://pkg.go.dev/github.com/distribution/distribution/reference#ParseNormalizedNamed But then it still keeps using the short name internally // applyDefaultImageTag parses a docker image string, if it doesn't contain any tag or digest,
// a default tag will be applied.
func applyDefaultImageTag(image string) (string, error) {
named, err := dockerref.ParseNormalizedNamed(image)
if err != nil {
return "", fmt.Errorf("couldn't parse image reference %q: %v", image, err)
}
_, isTagged := named.(dockerref.Tagged)
_, isDigested := named.(dockerref.Digested)
if !isTagged && !isDigested {
// we just concatenate the image name with the default tag here instead
// of using dockerref.WithTag(named, ...) because that would cause the
// image to be fully qualified as docker.io/$name if it's a short name
// (e.g. just busybox). We don't want that to happen to keep the CRI
// agnostic wrt image names and default hostnames.
image = image + ":latest"
}
return image, nil
} |
The Kubernetes project currently lacks enough contributors to adequately respond to all issues. This bot triages un-triaged issues 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. This bot triages un-triaged issues according to the following rules:
You can:
Please send feedback to sig-contributor-experience at kubernetes/community. /lifecycle rotten |
/remove-lifecycle rotten |
The Kubernetes project currently lacks enough contributors to adequately respond to all issues. This bot triages un-triaged issues according to the following rules:
You can:
Please send feedback to sig-contributor-experience at kubernetes/community. /lifecycle stale |
/remove-lifecycle stale |
What Happened?
I am running latest minikube on Ubuntu 22.04 on rootless docker started with:
I tried to push a local image to minikube with the image build command. I followed the guide: https://minikube.sigs.k8s.io/docs/handbook/pushing/
The image is built correctly and it is shown if I run:
minikube image ls
However, when trying to create a pod with it like:
minikube kubectl -- run testapp2 --image=testapp2 --image-pull-policy=Never --restart=Never
I get:
"PullImage from image service failed" err="rpc error: code = Unknown desc = failed to pull and unpack image \"docker.io/library/testapp2:latest\": failed to resolve reference \"docker.io/library/testapp2:latest\": pull access denied, repository does not exist or may require authorization: server message: insufficient_scope: authorization failed" image="testapp2:latest"
Same image, but build on the host with
docker build
and then loadedminikube image load
works exact as expected for pods started with the same command. The whole scenario is in the attached log file.An interesting thing, maybe related, is that the image pushed with
minikube image build
cannot be removed withminikube image rm
.The text was updated successfully, but these errors were encountered: