云服务器,使用k3s单节点运行了很久,现需要再加入一台服务器作为agent,但是k3s-agent一直运行不起来。
master的信息
NAME STATUS ROLES AGE VERSION INTERNAL-IP EXTERNAL-IP OS-IMAGE KERNEL-VERSION CONTAINER-RUNTIME
vm-12-4-centos Ready control-plane,master 205d v1.28.4+k3s2 10.0.A.A 139.199.A.A CentOS Linux 7 (Core) 3.10.0-1160.105.1.el7.x86_64 containerd://1.7.7-k3s1
在agent节点上:
使用的加入命令为
curl -sfL https://rancher-mirror.rancher.cn/k3s/k3s-install.sh | INSTALL_K3S_MIRROR=cn K3S_URL=https://139.199.175.A:6443 K3S_TOKEN= K102eef22db6a33221727f3c1f19bf0296bf0a350fba5e5c0cxxxxxxxxxxxxxxxx::server:6466110axxxxxxxxxx INSTALL_K3S_VERSION=v1.28.4+k3s2 sh -
使用curl -vk 的结果如下
[root@VM_0_3_centos bin]# curl -vk https://139.199.A.A:6443
{
“kind”: “Status”,
“apiVersion”: “v1”,
“metadata”: {},
“status”: “Failure”,
“message”: “Unauthorized”,
“reason”: “Unauthorized”,
“code”: 401
- Connection #0 to host 139.199.A.A left intact
}[root@VM_0_3_centos bin]#
日志报错信息
7月 19 18:50:11 VM_0_3_centos systemd[1]: k3s.service: main process exited, code=exited, status=1/FAILURE
7月 19 18:50:11 VM_0_3_centos systemd[1]: Failed to start Lightweight Kubernetes.
7月 19 18:50:11 VM_0_3_centos systemd[1]: Unit k3s.service entered failed state.
7月 19 18:50:11 VM_0_3_centos systemd[1]: k3s.service failed.
7月 19 18:50:16 VM_0_3_centos systemd[1]: k3s.service holdoff time over, scheduling restart.
7月 19 18:50:16 VM_0_3_centos systemd[1]: Stopped Lightweight Kubernetes.
7月 19 18:50:16 VM_0_3_centos systemd[1]: Starting Lightweight Kubernetes…
7月 19 18:50:16 VM_0_3_centos sh[23291]: + /usr/bin/systemctl is-enabled --quiet nm-cloud-setup.service
7月 19 18:50:16 VM_0_3_centos k3s[23299]: time=“2024-07-19T18:50:16+08:00” level=info msg=“Starting k3s v1.29.6+k3s2 (b4b156d9)”
7月 19 18:50:16 VM_0_3_centos k3s[23299]: time=“2024-07-19T18:50:16+08:00” level=warning msg=“Cluster CA certificate is not trusted by the host CA bundle, but the token does not include a CA hash. Use the full token from the server’s node-token file to enable Cluster CA validation.”
7月 19 18:50:16 VM_0_3_centos k3s[23299]: time=“2024-07-19T18:50:16+08:00” level=info msg=“Managed etcd cluster not yet initialized”
7月 19 18:50:17 VM_0_3_centos k3s[23299]: time=“2024-07-19T18:50:17+08:00” level=warning msg=“Cluster CA certificate is not trusted by the host CA bundle, but the token does not include a CA hash. Use the full token from the server’s node-token file to enable Cluster CA validation.”
7月 19 18:50:17 VM_0_3_centos k3s[23299]: time=“2024-07-19T18:50:17+08:00” level=fatal msg=“starting kubernetes: preparing server: failed to validate server configuration: not authorized”
第一次用k3s,要什么东西再说哈,真不懂啊啊啊啊啊