Skip to content
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

Need a way to get kubeconfig with node IP #1558

Open
BenTheElder opened this issue May 4, 2020 · 9 comments
Open

Need a way to get kubeconfig with node IP #1558

BenTheElder opened this issue May 4, 2020 · 9 comments
Assignees
Labels
kind/feature Categorizes issue or PR as related to a new feature. lifecycle/frozen Indicates that an issue or PR should not be auto-closed due to staleness. priority/important-longterm Important over the long term, but may not be staffed and/or may need multiple releases to complete.

Comments

@BenTheElder
Copy link
Member

What would you like to be added:
Some way to get the kubeconfig with the server field using the node container IP rather than the port forward on the hosts loopback or the internal DNS.

Why is this needed:

You could do this in 0.7 and on Linux it works from both host and inside the node / pods

@BenTheElder BenTheElder added the kind/feature Categorizes issue or PR as related to a new feature. label May 4, 2020
@howardjohn
Copy link
Contributor

kind get kubeconfig --name "${CLUSTER_NAME}" --internal | sed "s/${CLUSTER_NAME}-control-plane/$(docker inspect "${CLUSTER_NAME}-control-plane" --format "{{ .NetworkSettings.Networks.kind.IPAddress }}")/g"

Is a workaround

@BenTheElder BenTheElder added the kind/design Categorizes issue or PR as related to design. label May 4, 2020
@aojea
Copy link
Contributor

aojea commented May 13, 2020

/assign

@BenTheElder BenTheElder added the priority/important-longterm Important over the long term, but may not be staffed and/or may need multiple releases to complete. label May 31, 2020
adrienjt added a commit to adrienjt/multicluster-scheduler that referenced this issue Jun 24, 2020
@k8s-ci-robot k8s-ci-robot added the lifecycle/stale Denotes an issue or PR has remained open with no activity and has become stale. label Aug 29, 2020
@BenTheElder BenTheElder added lifecycle/frozen Indicates that an issue or PR should not be auto-closed due to staleness. and removed lifecycle/stale Denotes an issue or PR has remained open with no activity and has become stale. labels Sep 12, 2020
@kubernetes-sigs kubernetes-sigs deleted a comment from fejta-bot Sep 12, 2020
@aojea
Copy link
Contributor

aojea commented Mar 25, 2021

/close
I can't see now the utility of having the ip, there are multiple ways to obtain it,

  • kubectl get nodes
  • nslookup

@k8s-ci-robot
Copy link
Contributor

@aojea: Closing this issue.

In response to this:

/close
I can't see now the utility of having the ip, there are multiple ways to obtain it,

  • kubectl get nodes
  • nslookup

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.

@howardjohn
Copy link
Contributor

The utility is that you can use the kubeconfig from within docker. Common in multicluster. Getting the IP is not so hard, but having to sed patch it isn't ideal

@aojea
Copy link
Contributor

aojea commented Mar 25, 2021

kubectl get nodes -o=jsonpath='{range .items[*]}{.metadata.name}{":"}{.status.addresses[?(@.type=="InternalIP")].address}{"\n"}{end}'
testapi-control-plane:172.19.0.6
testapi-control-plane2:172.19.0.5
testapi-control-plane3:172.19.0.4

@BenTheElder BenTheElder reopened this Mar 25, 2021
@aojea
Copy link
Contributor

aojea commented Mar 25, 2021

is not valid using kubectl directly?

@BenTheElder
Copy link
Member Author

/assign

@MadhavJivrajani
Copy link

/remove-kind design
/kind feature
kind/design is migrated to kind/feature, see kubernetes/community#6144 for more details

@k8s-ci-robot k8s-ci-robot removed the kind/design Categorizes issue or PR as related to design. label Oct 11, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind/feature Categorizes issue or PR as related to a new feature. lifecycle/frozen Indicates that an issue or PR should not be auto-closed due to staleness. priority/important-longterm Important over the long term, but may not be staffed and/or may need multiple releases to complete.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants