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

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

Open
lijingcsu opened this issue Oct 13, 2017 · 3 comments

Comments

@lijingcsu
Copy link

lijingcsu commented Oct 13, 2017

按照教程,先运行master,然后按照提示处理admin.conf,然后在另一台机器上运行node,在node机器上
[root@bigbangtest1st] /etc/kubernetes/manifests$ kubeadm join --token 863f67.19babbff7bfe8543 172.18.0.16:6443 --skip-preflight-checks
[kubeadm] WARNING: kubeadm is in beta, please do not use it for production clusters.
[preflight] Skipping pre-flight checks
[discovery] Trying to connect to API Server "172.18.0.16:6443"
[discovery] Created cluster-info discovery client, requesting info from "https://172.18.0.16:6443"
[discovery] Cluster info signature and contents are valid, will use API Server "https://172.18.0.16:6443"
[discovery] Successfully established connection with API Server "172.18.0.16:6443"
[bootstrap] Detected server version: v1.7.2
[bootstrap] The server supports the Certificates API (certificates.k8s.io/v1beta1)
[csr] Created API client to obtain unique certificate for this node, generating keys and certificate signing request
[csr] Received signed certificate from the API server, generating KubeConfig...
[kubeconfig] Wrote KubeConfig file to disk: "/etc/kubernetes/kubelet.conf"

Node join complete:

  • Certificate signing request sent to master and response
    received.
  • Kubelet informed of new secure connection details.

Run 'kubectl get nodes' on the master to see this machine join.

@zhuchuangang
Copy link
Owner

@lijingcsu 默认情况下,kubectl命令只能在master节点可以正常使用,因为master节点有$HOME/.kube/config配置,kubectl访问api-server的配置都在$HOME/.kube/config里面,包括api-server的地址、证书等等,如果想再其他节点也可以使用kubectl命令,需要将$HOME/.kube/config复制到其他节点

@lijingcsu
Copy link
Author

@zhuchuangang 嗯!关键问题是我在master节点上get node也只不能获取其它节点,只能看到master节点

@zhuchuangang
Copy link
Owner

@lijingcsu node没有加入集群是吧,之前好像有同学遇到过,不过大部分跑这个脚本都是没问题的。明天再验证一下。如果用生产环境,最好选择kuberspay安装,kubeadm目前还是beta版本,网络这块还有些问题,可能有些组件没有不能正常运行。

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

2 participants