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

can not run k3s server:connection refused #398

Closed
miahwk opened this issue Apr 26, 2019 · 6 comments
Closed

can not run k3s server:connection refused #398

miahwk opened this issue Apr 26, 2019 · 6 comments

Comments

@miahwk
Copy link

miahwk commented Apr 26, 2019

when run the command, just display as follow:
INFO[0000] Preparing data dir /var/lib/rancher/k3s/data/e249e3fc5ccf8ea07732c672f3062154b47357f5c85e1735339f087752a0f3ee
INFO[2019-04-26T10:31:56.021894652+08:00] Starting k3s v0.4.0 (7822549)
INFO[2019-04-26T10:31:57.251039509+08:00] Running kube-apiserver --bind-address=127.0.0.1 --kubelet-client-certificate=/var/lib/rancher/k3s/server/tls/token-node.crt --basic-auth-file=/var/lib/rancher/k3s/server/cred/passwd --allow-privileged=true --service-account-signing-key-file=/var/lib/rancher/k3s/server/tls/service.key --advertise-port=6445 --insecure-port=0 --tls-cert-file=/var/lib/rancher/k3s/server/tls/localhost.crt --tls-private-key-file=/var/lib/rancher/k3s/server/tls/localhost.key --service-account-key-file=/var/lib/rancher/k3s/server/tls/service.key --requestheader-client-ca-file=/var/lib/rancher/k3s/server/tls/request-header-ca.crt --proxy-client-cert-file=/var/lib/rancher/k3s/server/tls/client-auth-proxy.crt --proxy-client-key-file=/var/lib/rancher/k3s/server/tls/client-auth-proxy.key --requestheader-extra-headers-prefix=X-Remote-Extra- --requestheader-group-headers=X-Remote-Group --authorization-mode=Node,RBAC --advertise-address=127.0.0.1 --secure-port=6444 --requestheader-username-headers=X-Remote-User --watch-cache=false --cert-dir=/var/lib/rancher/k3s/server/tls/temporary-certs --service-cluster-ip-range=10.43.0.0/16 --service-account-issuer=k3s --api-audiences=unknown --kubelet-client-key=/var/lib/rancher/k3s/server/tls/token-node.key --requestheader-allowed-names=kubernetes-proxy
INFO[2019-04-26T10:31:57.920254012+08:00] Running kube-controller-manager --cluster-cidr=10.42.0.0/16 --port=10252 --secure-port=0 --kubeconfig=/var/lib/rancher/k3s/server/cred/kubeconfig-system.yaml --service-account-private-key-file=/var/lib/rancher/k3s/server/tls/service.key --root-ca-file=/var/lib/rancher/k3s/server/tls/token-ca.crt --leader-elect=false --allocate-node-cidrs=true --bind-address=127.0.0.1
INFO[2019-04-26T10:31:57.925499010+08:00] Running kube-scheduler --port=10251 --bind-address=127.0.0.1 --secure-port=0 --kubeconfig=/var/lib/rancher/k3s/server/cred/kubeconfig-system.yaml --leader-elect=false
panic: creating CRD store Get https://localhost:6444/apis/apiextensions.k8s.io/v1beta1/customresourcedefinitions: dial tcp [::1]:6444: connect: connection refused

goroutine 606 [running]:
github.com/rancher/k3s/vendor/github.com/rancher/norman/store/crd.(*Factory).BatchCreateCRDs.func1(0xc001dc9d80, 0xc001961920, 0x3, 0x3, 0xc001adfae0, 0x5d1dce0, 0x3bae620, 0xc001961ad0, 0x0, 0x0)
/go/src/github.com/rancher/k3s/vendor/github.com/rancher/norman/store/crd/init.go:65 +0x2c2
created by github.com/rancher/k3s/vendor/github.com/rancher/norman/store/crd.(*Factory).BatchCreateCRDs
/go/src/github.com/rancher/k3s/vendor/github.com/rancher/norman/store/crd/init.go:50 +0xce

@erikwilson
Copy link
Contributor

Do you have any firewall running?
What is the output of iptables -L?

@wglambert
Copy link

Your dial tcp [::1]:6444: connect: connection refused error might involve the /etc/hosts file having an incorrect entry

@Aliabbask08
Copy link

@wglambert what entry is needed?
127.0.0.1 raspberrypi-node1
::1 localhost ip6-localhost ip6-loopback
ff02::1 ip6-allnodes
ff02::2 ip6-allrouters

127.0.1.1 raspberrypi

@wglambert
Copy link

Moving localhost to the 127.0.0.1 line should work
and move the raspberrypi-node1 to the 127.0.1.1 line (presuming it's the actual hostname, and that raspberrypi isn't the true hostname)

Your 6444 port might only be listening on 127.0.0.1, but when you try to connect with localhost:6444 it's translated to ::1:6444 which isn't open

$ netstat -tulpn | grep 644
(Not all processes could be identified, non-owned process info
 will not be shown, you would have to be root to see it all.)
tcp        0      0 127.0.0.1:6445          0.0.0.0:*               LISTEN      - 
tcp        0      0 127.0.0.1:6444          0.0.0.0:*               LISTEN      - 
tcp6       0      0 :::6443                 :::*                    LISTEN      -

My /etc/hosts has my hostname as the 127.0.1.1 and localhost is ipv4 only

$ cat /etc/hosts
127.0.0.1       localhost
127.0.1.1       Ayanami-Clone

# The following lines are desirable for IPv6 capable hosts
::1     ip6-localhost ip6-loopback
fe00::0 ip6-localnet
ff00::0 ip6-mcastprefix
ff02::1 ip6-allnodes
ff02::2 ip6-allrouters

@huapox
Copy link

huapox commented Oct 15, 2019

Hosts requirement should be resolved in #750, v0.9.0 Released this fix.

@davidnuzik
Copy link
Contributor

Please try the latest release v0.9.1 as the issue should be resolved. Feel free to reopen the issue if necessary (and provide details of the issue) if the latest release does not resolve this (it should).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

6 participants