-
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
update registry addon documentation #6982
Comments
You are saying that the registry works with From the outside, it is normally more like: https://minikube.sigs.k8s.io/docs/tasks/docker_registry/ |
Ugh, so sorry, did a wrong copy and paste. Will edit the original issue, |
Do you have the error output, like if you do a |
These are the events:
Nothing much more in describe, just the fail reason being |
There doesn't seem to be anything in the registry logs, so I guess it is getting stuck in registry-proxy It works from the outside, but just hangs from the inside. Even with The internal IP are fine:
But not the localhost.
|
Looks similar to cri-o/cri-o#1804 |
Thank you for verifying. Any ideas of a temporary workaround? |
Note that it has to be localhost, since that is the hack used to get an insecure registry...
The workaround is configuring the minikube IP as an insecure registry, in the crio.conf
EDIT: Apparently we are using /etc/containers/registry.conf for this as well, so:
This would be for the track where you use the IP instead of the localhost proxy:
Or deploy a proper https registry (left as an exercise for the reader :-) ) https://docs.docker.com/registry/deploying/#run-an-externally-accessible-registry Instead of the horrible hack, that is the kubernetes registry-proxy container...
|
Hm, so it looks like cri-o doesn't support Docker's "localhost is allowed as an insecure registry" hack? If that's the case, I think it should be documented that the registry addon doesn't work with cri-o, at least this time. |
Yeah, it seems like hostPort has some issues with cri-o and that should probably be documented... |
That part is supported just fine, since it tries to be bug-compatible at least for the docker:// protocol |
I found a simple workaround. Get the registry service's cluster IP:
And then use that address, with port 80, for the image URL, e.g.:
|
Hey @tliron awesome. We should update the documentation to include that workaround when trying to use the registry addon with cri-o. |
@priyawadhwa Thanks, but it's an awkward solution. The problem is that users would have to update all their specs to use this varying IP address. I hope we can find a way to enable |
Here is a version of my workaround above in Go code: import (
"context"
"fmt"
meta "k8s.io/apimachinery/pkg/apis/meta/v1"
"k8s.io/client-go/kubernetes" // v0.18.0
)
func GetInternalRegistryURL(kubernetesClient *kubernetes.Clientset) (string, error) {
if service, err := kubernetesClient.CoreV1().Services("kube-system").Get(context.TODO(), "registry", meta.GetOptions{}); err == nil {
return fmt.Sprintf("%s:80", service.Spec.ClusterIP), nil
} else {
return "", err
}
} |
The same thing happens with ingress addon. No go with cri-o runtime. The minikube ip does not host any loadbalancer, and it fails silently, while internally, the |
I would be happy to review any PR that fixes this for CRI-O |
Issues go stale after 90d of inactivity. If this issue is safe to close now please do so with Send feedback to sig-testing, kubernetes/test-infra and/or fejta. |
Stale issues rot after 30d of inactivity. If this issue is safe to close now please do so with Send feedback to sig-testing, kubernetes/test-infra and/or fejta. |
/remove-lifecycle rotten |
I think an acceptable solution is to document this in Minikube, probably here. To be honest, that whole page could use a rewrite, as it's more a collection of notes than a guide. As it stands right now, the only way to really learn what I'd like to help, but I'm unfamiliar with the project interactions. Could someone who knows please take responsibility for resolving this issue? |
I agree with you @tliron that page is getting very messy and hard to read, I would accept a PR that organizes that page on our webiste and makes it easier to read |
It sounds like I'm being volunteered. :) I may try to take a stab at it if I can find the time. It's all very hard, to be honest. The challenge is not just to allow Kubernetes's container runtime access to the private registry (with authentication? authorization?) but also how a user/developer can access it push images to it. After all, that is the goal of having such a built-in registry in the first place. None of this work is trivial. But at least it can be documented specifically for Minikube, which does have some advantages in that it can run in "insecure" mode (self-signed cert). On that note, I ended up creating a generic solution to the problem of handling and working with private registries, a project I call Reposure. Reposure has explicit support for Minikube's registry add-on. |
@tliron thank you That does sounds like a good idea to update our docs and maybe refactor our docs on registry addon with better examples and better categorization |
Issues go stale after 90d of inactivity. If this issue is safe to close now please do so with Send feedback to sig-contributor-experience at kubernetes/community. |
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 |
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 |
The exact command to reproduce the issue:
The full output of the command that failed:
Pods fail to pull image from the registry, e.g.:
Note that I can push to the registry from outside via
docker://$(minikube ip):5000/mycontainer
.Switching to Docker runtime allows this to work.
The operating system version:
Fedora 31
The text was updated successfully, but these errors were encountered: