导入集群

进入之后选择导入已有集群,随后进入此页面,点击创建

对于自签证书选择第二项,复制,然后在 K3s server 节点执行

问题
error: no objects passed to apply
这里的问题主要是无法连接到部署 Rancher 的主机,无法获取 yaml 文件导致的。可以将 yaml 文件直接下载到 K3s server,再手动执行
kubectl apply -f {xxx}.yaml
(针对配置了 --tls-san 参数 - 自签证书)可能会执行失败,提示域名 rancher.k3s.cn 不识别(前面的证书域名以及对应 IP)
更新资源的字段
1 | # because the cert was made by myself, so i need configured the hosts, otherwise it does not know my cert's domain name, unless you used ip instead of domain name |
(针对 Helm 安装方式)出现 [Ready False [Disconnected] Cluster agent is not connected] 问题
参考:https://github.com/rancher/rancher/issues/36589
1 | # 得到 <REPLACE_WITH_CLUSTERID> |
查看启动情况
1 | kubectl get pods -n cattle-system -o wide |
不需要被 Rancher 管理导入的集群该怎么做?
如果导入集群从 Rancher UI 删除了,这个集群就不受 Rancher 管理了。集群本身不会受到影响,并可以使用导入到 Rancher 之前的方法访问集群。
删除导入集群的步骤如下:
- 在全局视图,进入集群菜单。
- 选择需要删除的导入集群,单击更多 (...) > 删除。
- 单击删除。
结果: 导入集群从 Rancher 中删除,在 Rancher 之外集群正常运行。
本博客所有文章除特别声明外,均采用 CC BY-NC-SA 4.0 许可协议。转载请注明来源 小五的个人杂货铺!