rancher导入k8s/k3s集群
把k8s/k3s集群导入rancher中进行管理,步骤还是很简单的。 rancher本身也是有提示说明的。
1、登录rancher。
点击“集群”,再点击右边的“添加集群”按钮
2、点击右边的“导入”链接
3、设置集群的名称(可随意)。
也可以在这里添加对集群管理的用户(成员角色),不过一般都是在后面细分权限划分。
4、这里会根据你的rancher环境生成相应的命令。到要导入的集群系统上执行这个命令就行。
[root@master1 ~]# kubectl apply -f https://rancher.xxxxxx.net/v3/import/2cp2nlnkjv2l4d9tcwg6lbj72tfmjcxtvrndvhv6kx4tjcwppctnln.yaml
clusterrole.rbac.authorization.k8s.io/proxy-clusterrole-kubeapiserver created
clusterrolebinding.rbac.authorization.k8s.io/proxy-role-binding-kubernetes-master created
namespace/cattle-system created
serviceaccount/cattle created
Warning: rbac.authorization.k8s.io/v1beta1 ClusterRoleBinding is deprecated in v1.17+, unavailable in v1.22+; use rbac.authorization.k8s.io/v1 ClusterRoleBinding
clusterrolebinding.rbac.authorization.k8s.io/cattle-admin-binding created
secret/cattle-credentials-a7a67f0 created
clusterrole.rbac.authorization.k8s.io/cattle-admin created
deployment.apps/cattle-cluster-agent created
daemonset.apps/cattle-node-agent created