karmada
karmada copied to clipboard
karmada member cluster status Unknown
有没有什么正确姿势删除成员cluster 我通过命令删除的时候,会长时间卡在delete哪里 如果我用接口的方式,有可能一段时间它就自动删除了,我昨天刚删的一个操作,现在都没有删掉
请问你用的哪个版本?
删除命令执行时显示什么?
我昨天刚删的一个操作,现在都没有删掉
有可能的话提供一下karmada-controller-manager的日志?
@RainbowMango v0.8.0
如下图,会一直卡在这里
karmada-controller-manager log
I1126 02:33:59.426742 1 cluster_controller.go:374] cluster 1658a712-53d2-409f-97ca-4a6ccc1a1dab hasn't been updated for 17h24m17.612795895s. Last Ready is: &Condition{Type:Ready,Status:Unknown,ObservedGeneration:0,LastTransitionTime:2021-11-25 09:10:21 +0000 UTC,Reason:ClusterStatusUnknown,Message:Cluster status controller stopped posting cluster status.,}
I1126 02:33:59.974037 1 reflector.go:530] k8s.io/client-go/dynamic/dynamicinformer/informer.go:91: Watch close - *unstructured.Unstructured total 0 items received
I1126 02:34:01.341297 1 reflector.go:530] k8s.io/client-go/dynamic/dynamicinformer/informer.go:91: Watch close - *unstructured.Unstructured total 0 items received
I1126 02:34:04.428048 1 cluster_controller.go:374] cluster 1658a712-53d2-409f-97ca-4a6ccc1a1dab hasn't been updated for 17h24m22.614102247s. Last Ready is: &Condition{Type:Ready,Status:Unknown,ObservedGeneration:0,LastTransitionTime:2021-11-25 09:10:21 +0000 UTC,Reason:ClusterStatusUnknown,Message:Cluster status controller stopped posting cluster status.,}
I1126 02:34:08.392798 1 reflector.go:530] k8s.io/client-go/dynamic/dynamicinformer/informer.go:91: Watch close - *unstructured.Unstructured total 0 items received
I1126 02:34:09.428592 1 cluster_controller.go:374] cluster 1658a712-53d2-409f-97ca-4a6ccc1a1dab hasn't been updated for 17h24m27.614645921s. Last Ready is: &Condition{Type:Ready,Status:Unknown,ObservedGeneration:0,LastTransitionTime:2021-11-25 09:10:21 +0000 UTC,Reason:ClusterStatusUnknown,Message:Cluster status controller stopped posting cluster status.,}
I1126 02:34:14.429123 1 cluster_controller.go:374] cluster 1658a712-53d2-409f-97ca-4a6ccc1a1dab hasn't been updated for 17h24m32.61515452s. Last Ready is: &Condition{Type:Ready,Status:Unknown,ObservedGeneration:0,LastTransitionTime:2021-11-25 09:10:21 +0000 UTC,Reason:ClusterStatusUnknown,Message:Cluster status controller stopped posting cluster status.,}
I1126 02:33:58.542682 1 reflector.go:530] sigs.k8s.io/controller-runtime/pkg/cac/informers_map.go:245: Watch close - *v1alpha1.Cluster total 0 items received
I1126 02:33:59.426742 1 cluster_controller.go:374] cluster 1658a712-53d2-409f-971dab hasn't been updated for 17h24m17.612795895s. Last Ready is: &Condition{Type:Readynown,ObservedGeneration:0,LastTransitionTime:2021-11-25 09:10:21 +0000 UTC,Reason:Clus
I1126 02:34:14.461490 1 reflector.go:530] sigs.k8s.io/controller-runtime/pkg/cache/internal/informers_map.go:245: Watch close - *v1alpha1.PropagationPolicy total 0 items received
I1126 02:34:14.783012 1 reflector.go:255] Listing and watching *unstructured.Unstructured from k8s.io/client-go/dynamic/dynamicinformer/informer.go:91
E1126 02:34:14.786392 1 reflector.go:138] k8s.io/client-go/dynamic/dynamicinformer/informer.go:91: Failed to watch *unstructured.Unstructured: failed to list *unstructured.Unstructured: nodes is forbidden: User "system:serviceaccount:default:default" cannot list resource "nodes" in API group "" at the cluster scope
I1126 02:34:19.430222 1 cluster_controller.go:374] cluster 1658a712-53d2-409f-97ca-4a6ccc1a1dab hasn't been updated for 17h24m37.616274425s. Last Ready is: &Condition{Type:Ready,Status:Unknown,ObservedGeneration:0,LastTransitionTime:2021-11-25 09:10:21 +0000 UTC,Reason:ClusterStatusUnknown,Message:Cluster status controller stopped posting cluster status.,}
I1126 02:34:20.380458 1 reflector.go:530] k8s.io/client-go/dynamic/dynamicinformer/informer.go:91: Watch close - *unstructured.Unstructured total 0 items received
I1126 02:34:20.517639 1 reflector.go:255] Listing and watching *unstructured.Unstructured from k8s.io/client-go/dynamic/dynamicinformer/informer.go:91
不应该使用kubectl
来直接删除集群,应该使用kubectl karmada unjoin
命令:
# kubectl karmada unjoin --help
Unjoin removes the registration of a cluster from control plane.
Usage:
karmada unjoin CLUSTER_NAME --cluster-kubeconfig=<KUBECONFIG> [flags]
Examples:
# Unjoin cluster from karamada control plane
kubectl karmada unjoin CLUSTER_NAME --cluster-kubeconfig=<KUBECONFIG>
# Unjoin cluster from karamada control plane with timeout
kubectl karmada unjoin CLUSTER_NAME --cluster-kubeconfig=<KUBECONFIG> --wait 2m
哦,那我需要通过unjoin那块代码去实现,而不能直接delete
我的agent方式是Pull,并不会依赖到karmadactl,也必须用这种方式剔除么
@lfbear @lonelyCZ 两位可以给点意见
我的agent方式是Pull,并不会依赖到karmadactl,也必须用这种方式剔除么
删除karmada控制面上的cluster,用karmadactl unjoin是比较安全的,pull模式的也需要通过这个命令来删除控制面上的cluster对象。可以直接通过karmadactl unjoin <cluster_name>
来删除,不用带后面的--cluster-kubeconfig
@lonelyCZ 我使用 unjoin 过了一段时间后,显示超时
谢谢反馈,@yanlingsishao
如果k8s中某个资源用kubectl delete
都删不掉的话,可以查看一个这个资源的finalizers
字段是否为空,如果不为空的话可以用kubectl edit
手动清空掉试试。
Cluster的状态为Unknown的话,可以重启一下karmada-controller-manager
和karmada-agent
试试。
推荐用karmada最新版本,功能更丰富。
unjoin 可用吗? 也遇到相同问题
@zhoulouzi 你现在用的什么版本,执行了具体什么操作,出现了什么非预期的现象?
unjoin 可用吗? 也遇到相同问题
对于PULL模式的子集群,如果状态为Unknown
, 这时候必须要手动把所有分发给该集群的Work
资源先删掉(通过kubectl edit
每个Work
,删掉以下内容)
finalizers:
- karmada.io/execution-controller
/close
@RainbowMango: Closing this issue.
In response to this:
/close
Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository.