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

kubectl cannot retrieve info from local cluster #378

Closed
ThomasSchoenbeck opened this issue Apr 19, 2019 · 4 comments
Closed

kubectl cannot retrieve info from local cluster #378

ThomasSchoenbeck opened this issue Apr 19, 2019 · 4 comments
Assignees
Labels
kind/bug Something isn't working
Milestone

Comments

@ThomasSchoenbeck
Copy link

ThomasSchoenbeck commented Apr 19, 2019

Describe the bug
k3s kubectl cannot connect to the cluster as connection is refused

To Reproduce
start k3s server via docker (self build image) and run a shell inside it using the command k3s kubectl get node

Expected behavior
cluster node info appears

Screenshots
image
image
image

Additional context

@galal-hussein
Copy link
Contributor

I was able to reproduce the issue by using the following steps:

  • start k3s server with env K3S_KUBECONFIG_OUTPUT=/tmp/kubeconfig.yml
  • try k3s kubectl get nodes

result:

The connection to the server localhost:8080 was refused - did you specify the right host or port?

Apparently when placing the kubeconfig in a non-default directory k3s kubectl try to get /etc/rancher/k3s/k3s.yaml

@galal-hussein galal-hussein added the kind/bug Something isn't working label Apr 19, 2019
@ThomasSchoenbeck
Copy link
Author

removing K3S_KUBECONFIG_OUTPUT did fix the issue.

I got the idea of using this variable from the docker-compose example file.

@galal-hussein galal-hussein self-assigned this Apr 24, 2019
@ibuildthecloud
Copy link
Contributor

What if we make it so that if the user changes the location of the k3s.yml we put it in the custom location and then also create a symlink at /etc/rancher/k3s/k3s.yml that points to the custom location.

@tfiduccia
Copy link

Version - v0.6.0-rc3
Verified fixed

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind/bug Something isn't working
Projects
None yet
Development

No branches or pull requests

5 participants