自建的k8s集群重新安装了一遍,重新导入,新的生效了,之前的条目删不掉.

1:kubeadm创建k8s集群 cluster-A
2:docker启动rancher-server 2.6.2
3:添加cluster-A到rancher manager 并命名为k8s-dev
4:cluster-A直接初始化到未安装k8s集群状态,然后重复步骤1,并生成cluater-A-1
5:重新添加cluster-A-1到rancher manager 命名为k8s-dev成功
6:删除cluster-A 在UI处删不掉,在k3s里也能查到该集群ID
/uploads/question/20220104/68768084a030bebe517d69391d335bdf.png

已邀请:

hailong

赞同来自: 杜润雨

通过local集群获取无法删除集群的集群ID:


c36d66baef9a:/var/lib/rancher # kubectl get clusters.management.cattle.io
NAME AGE
c-m-j4hvtgph 17m
local 30m

然后通过命令删除集群:

kubectl delete clusters.management.cattle.io c-m-j4hvtgph --force --grace-period=0

如果卡主删不掉,可以编辑clusters.management.cattle.io 删除掉metadata.finalizers

kubectl  edit clusters.management.cattle.io c-m-j4hvtgph

  /uploads/answer/20220105/049345d771a25b22ee8312a9fc7d3e11.png


然后保存,再次查看:

c36d66baef9a:/var/lib/rancher # kubectl get clusters.management.cattle.io
NAME AGE
local 46m


要回复问题请先登录注册