-
Notifications
You must be signed in to change notification settings - Fork 1.6k
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
Kind local registry: Error response from daemon: endpoint with name kind-registry already exists in network kind #2600
Comments
most probably you already have a container running as registry |
@aojea seems like you are right. However, it's quite interesting: I delete the cluster by running Here is the full console output:
What I expect is by deleting the cluster container would be stopped and deleted as well. |
The registry isn't part of the cluster, so when you delete the cluster the registry is not affected. This is the desired behavior in a lot of cases because you don't want to have to rebuild that local cache every time. This is also the reason why there is the script to create the cluster with a registry versus just being able to call If your desired behavior is to have the registry removed along with the cluster, one option would be to create a |
Thanks Sean for the great answer, I think that we can close it now |
@aojea: Closing this issue. In response to this:
Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository. |
@stmcginnis @aojea thank you for your answer! |
@steffengy @aojea |
Feel free to ask, no problem, this is a helper script for users that want to have a local registry to test their images in the cluster, if you don't create the cluster it means you only wants a local registry, then this doc is not the best place for this informations.
keep adding information to the page may end in a "supported feature" and supporting this "hacky script" is not something maintainer have time :) |
@aojea got you :)
In case I want my cluster to communicate with a private local registry I need to run it from the kind cluster, the script I found, right? Perhaps I was confused cause I run 2 clusters eventually: one for the private local registry and one for the application itself. Taking into consideration I require a particular version of k8s shall I add the flag |
@aojea got you :)
In case I want my cluster to communicate with a private local registry I need to run it from the kind cluster, the script I found, right? Perhaps I was confused cause I run 2 clusters eventually: one for the private local registry and one for the application itself. Taking into consideration I require a particular version of k8s shall I add the flag |
You should not be running a cluster just for the local registry. Unless your intention is to have the registry pod managed by kubernetes. Otherwise, the registry is just a container run on your local docker engine, and you would have one cluster that would be configured to pull from it. That is what the script provides you. |
Echoing previous comment from Sean, I feel that you are thinking that the registry runs inside the kind cluster, but the script automates the steps you find in the article that you linked: it creates a cluster, a docker with local register, and makes them work together |
@stmcginnis @aojea got you guys, thanks! |
You can do what is in the sample script at https://kind.sigs.k8s.io/docs/user/local-registry/#create-a-cluster-and-registry again, it is re-entrant with respect to the registry and can be safely run again without affecting a running registry. |
@BenTheElder thank you for your answer! To be honest, now I totally lost.. If I got your right: I need to delete the cluster by |
I am able to reproduce that error message: I think things are working fine though. Have you confirmed it is not using the local registry after recreating your cluster? It may just be an error that can be ignored. Reopening though since we should probably understand why it is giving the error. /reopen |
@stmcginnis: Reopened this issue. In response to this:
Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository. |
@stmcginnis |
Great, thanks for verifying that. So this may just be a case where there is an error that doesn't really mean anything, and we should maybe just swallow that message or something. |
That is probably just a log message from this script line: # connect the registry to the cluster network
# (the network may already be connected)
docker network connect "kind" "${reg_name}" || true The We could instead attempt to detect if it is currently attached to the network or not before attempting to connect (and make the sample script more complex). |
Basically, this is a harmless error message that just confirms that the system is already in the desired state. Everything should continue and work fine despite the logged message. |
Yeah, my first thought was to just pipe the output to Though... if we are we are ignoring failures there anyway with |
If we do this, then if a real error happens, no one will be able to see it and debugging will be "fun", which is pretty different from the script opting to continue on. A patch to detect the situation and avoid producing the error might be nice, except I'm not sure you can do so in a reliable way without introducing a dependency like Also, to attach more clusters you just need the containerd config patch, not the whole script: # create a cluster with the local registry enabled in containerd
cat <<EOF | kind create cluster --config=-
kind: Cluster
apiVersion: kind.x-k8s.io/v1alpha4
containerdConfigPatches:
- |-
[plugins."io.containerd.grpc.v1.cri".registry.mirrors."localhost:${reg_port}"]
endpoint = ["http://${reg_name}:5000"]
EOF And that would be better done by including the configuration snippet in whatever you choose to manage your kind cluster configs with. |
Perhaps we can just echo in script something like |
|
One possible solution proposed in #2601. Would love to hear feedback. |
@BenTheElder |
I wasn't saying that adding an echo increased the complexity notably, I was saying that because the complexity is low, this note could just be inserted as comment, because if something goes wrong there is not much to inspect when looking at the script, but the current comment is terse. As in, the low length and complexity of the script means that having the note as a comment would not bury it. I think echo-ing a comment about a possible benign log on every run is log-noise, and I would prohibit this in most scripts, that effort is better spent detecting / handling the issue or documenting. The approach in #2601 resolves this, anyhow, thankfully 🙏 |
Hello,
I run the script from the page https://kind.sigs.k8s.io/docs/user/local-registry/ here is the console output:
And it says to me the error:
Error response from daemon: endpoint with name kind-registry already exists in network kind
. What should I do to handle it properly? I've searched google for this kind of issue but no luck.I've walked thru #1213 but there is no mention regarding my topic.
If I miss something or any other details has to be provided from my side please let me know
The text was updated successfully, but these errors were encountered: