-
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
Use container IP address in server field in kubeconfig for kind cluster #111
Comments
On OSX at least, it's not possible to access the docker container network 😞 If we want to make this configurable, there's 3 options I can think of:
Not sure what's most desirable here? 😄 |
Each cluster has a different port for the API server so it should still be possible for them to talk to each other (?), the reason for localhost is that windows / mac do not support anything else as far as I know, because the container network is actually in a light VM. |
It's also possible that using a single network bridge will be problematic in the future, once we get multiple nodes. Using localhost and a random port makes things pretty portable. Can federation support keying off of the address + port instead of just the address instead? It would be quite easy to create a kubeconfig with the container IP address when on linux, but so far I've preferred keeping the environment as consistent as possible. Ideally users should be able to replicate CI very closely on their local machines, which is a major goal for kind. |
On Linux, I don't think it's possible while using
We key off of the entire server field so we include the port. It's just that using |
Ah, right. Thanks. Will think about this some more, while you can trivially get the container IP and rewrite it currently, it would be ideal to make this work portably. |
@BenTheElder @font What I'm proposing for multi-node is to
What described above is a small variation of current state, and if I got this thread right, it neither fix nor prevent fixing the above issue for federation test. is that right or do you see problems in what I'm proposing? Instead, if I can give my two cents on how to address federation requirement, I think that a possible solution is to add an option for retrieving the raw kubeconfig ( |
i think we should make the random port a UX knob. |
--raw makes sense, BUT, we need the random port outside the container to handle docker for mac / windows and I'd rather minimize code paths because CI should match local usage for reproducibility as much as possible.. |
for random port see #178, we should allow setting the address as well, we'll set a random port if you don't specify a port. |
neglected to update here: the random port is a config knob now, and it is always 6443 inside the network, we still need to add a command to export the kubeconfig, with a |
I think that as a workaround this will work |
|
…ort_deploy_tigera_operator fix: backport fix deploy_tigera_operator
When working with multiple clusters such as with https://github.com/kubernetes-sigs/federation-v2, we provide the cluster info to the federation controller running in one of the clusters, to talk to all the other clusters. That cluster info comes from the kubeconfig provided by the user. The current
kind create cluster
command will create a kubeconfig with theserver
field usinglocalhost
as shown below:This makes it problematic when one kind cluster needs to access the kube API server in another kind cluster because
localhost
for each kind cluster refers to itself. Since the kind clusters share a common docker network bridge, we can use the IP address for each container. So what is needed is for the container IP address to be used in the server field in the kubeconfig for the kind cluster as shown below:The host would still be able to talk to the kube API servers using their container IP addresses. Is this something that is desirable? Is there a reason to use
localhost
instead?The text was updated successfully, but these errors were encountered: