我有以下cluster.yml文件:
nodes:
- address: 172.16.20.22
user: rke
role:
- controlplane
- etcd
- worker在执行rke up时,我得到以下错误:
INFO[0000] Building Kubernetes cluster
INFO[0000] [dialer] Setup tunnel for host [172.16.20.22]
WARN[0000] Failed to set up SSH tunneling for host [172.16.20.22]: Can't retrieve Docker Info: error during connect: Get http://%2Fvar%2Frun%2Fdocker.sock/v1.24/info: Unable to access node with address [172.16.20.22:22] using SSH. Please check if you are able to SSH to the node using the specified SSH Private Key and if you have configured the correct SSH username. Error: ssh: handshake failed: ssh: unable to authenticate, attempted methods [none publickey], no supported methods remain
WARN[0000] Removing host [172.16.20.22] from node lists
FATA[0000] Cluster must have at least one etcd plane host: failed to connect to the following etcd host(s) [172.16.20.22]我不知道为什么SSH隧道不能工作,因为我在机器上打开了端口22。我的机器上还打开了端口80,用于http流量,在firewalld输出中可以看到:
public (active)
target: default
icmp-block-inversion: no
interfaces: ens192
sources:
services: ssh dhcpv6-client http
ports:
protocols:
masquerade: no
forward-ports:
source-ports:
icmp-blocks:
rich rules: 有人知道为什么我的cluster.yml配置不能按预期工作吗?我已经确认我的rke用户和root用户都有通过SSH工作的SSH密钥,但我不确定是否需要将它们添加到我的配置文件中,或者它是如何工作的。
发布于 2019-06-04 14:30:42
您正在使用什么样的SSH身份验证?您的SSH服务器似乎只接受SSH密钥。这很好,如果rke有一个有效的密钥,需要在配置中指定(要么是全局的,要么是基于每个节点的):
nodes:
- address: 172.16.20.22
user: rke
ssh_key_path: "/home/rke/.ssh/id_rsa"
role:
- controlplane
- etcd
- worker如果该密钥已经指定,并且仅在您在这里发布的配置中丢失,请检查该密钥是否有效。在使用SSH密钥时,需要记住一些事情。最重要的是密码许可(600在私钥上)。要检查这一点,只需在运行rke时以相同用户的身份连接并尝试。
ssh -i /home/rke/.ssh/id_rsa rke@172.16.20.22这应该有效,否则您将得到更详细的错误信息。如果它有效,请尝试执行docker ps。当用户不是docker组的成员时,我也犯了类似的错误。在这种情况下,它没有足够的权限通过Docker套接字进行连接。
https://serverfault.com/questions/959133
复制相似问题