CKS: nothing detects drift between a cluster's VM map, its VMs and its Kubernetes nodes
维护者通常 1 天内回复
评估
- 难度
- 4/5
- 预计耗时
- 3-5 天
- 新手友好度
- 42/100
- Issue 类型
- 功能
- 描述清晰度
- 基本清楚
- 活跃度
- 活跃
- 技术栈
- java, kubernetes
- 领域
- cloud, observability
调研方向
Start by reading the CKS cluster status scanner and its handling of cluster VMs, then trace how it can access the cluster's Kubernetes nodes and raise alerts and events. Compare the VM map, actual VMs, and Kubernetes nodes for each mismatch. Done means each mismatch produces an alert and event naming the cluster and affected VM or node once, without changing the map.
由索引模型根据 Issue 内容生成。
描述
problem
CKS keeps the list of VMs of each Kubernetes cluster in kubernetes_cluster_vm_map. Scale, upgrade, stop/start and the cluster status scanner all trust that list. Nothing checks it against the VMs that actually exist or against the nodes Kubernetes knows about, so when the two drift apart nobody is told:
- a VM that is in the map but has been destroyed or expunged, or no longer exists, keeps the cluster in Alert (the scanner compares the map's size and VM states against the expected node count), and the next scale or upgrade works from a wrong list;
- a VM that runs as a node of the cluster but is not in the map is invisible to CloudStack: it is not scaled, upgraded, stopped or deleted with the cluster;
- a Kubernetes node with no VM behind it, or a mapped running VM that is not a Kubernetes node, means the cluster Kubernetes runs is not the one CloudStack thinks it manages.
The API and UI refuse to destroy a VM that belongs to a CKS cluster, so the map does not drift through normal use. It drifts when:
- a node is rebuilt or replaced by hand (a new VM joined to the cluster, the old one removed outside CKS);
- the database is edited by hand;
- a destroy or expunge fails during a scale-down, which removed the VM from the map but could leave the VM behind. That path is fixed in #14611.
A production cluster was found sitting in Alert with one of its control nodes missing from the map. The only way to find out why was to compare the map, the VMs and kubectl get nodes by hand.
versions
4.22 and main.
The steps to reproduce the bug
- Create a CKS cluster and wait for it to be Running.
- Remove one of its rows from
kubernetes_cluster_vm_map(or replace a worker node by hand with a new VM that joins the cluster). - The cluster moves to Alert, or keeps a node CloudStack does not know about, and no alert or event says which VM or node is the cause.
What to do about it?
Have the cluster status scanner compare the map with the cluster's VMs and its Kubernetes nodes, and raise an alert and an event naming the cluster and the VM or node for each mismatch, once per mismatch. Detection only, the map is not changed.
- 主要语言
- Java
- 星标
- 3.1k
- 派生
- 1.4k
- 平均合并
- 7 天 16 小时
- 30 天内合并 PR
- 15
环境准备
- 没有 Dockerfile 或 Docker Compose 文件
- 有 Pull Request 模板
- 阅读贡献指南
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
apache/cloudstack 的其他 Issue
-
resizeVolume of a running system VM's volume is accepted but the VM never sees the new size可能已有人在做 @bhouse-nexthop 于 3 天前认领。 未关闭
难度 2/5 1-3 小时 新手友好度 72/100
apache/cloudstack#14645 · 1 条评论 ·
维护者通常 1 天内回复
-
VR reports a load balancer change as applied when haproxy.cfg cannot be replaced可能已有人在做 @bhouse-nexthop 于 4 天前认领。 未关闭
难度 2/5 1-3 小时 新手友好度 78/100
apache/cloudstack#14633 · 1 条评论 ·
维护者通常 1 天内回复
-
restartNetwork reports a ResourceUnavailableException as an unexpected error (530), unlike restartVPC (534)可能已有人在做 @bhouse-nexthop 于 4 天前认领。 未关闭
难度 2/5 1-3 小时 新手友好度 78/100
apache/cloudstack#14631 · 1 条评论 ·
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 68/100
apache/cloudstack#14625 · 1 条评论 ·
维护者通常 1 天内回复
-
Remote access VPN users are disconnected on every LB, ACL, port forward or firewall change (xl2tpd restarted on every iptables pass)可能已有人在做 @willbennett-devops 于 12 天前认领。 未关闭
难度 2/5 1-3 小时 新手友好度 72/100
apache/cloudstack#14545 · 1 条评论 ·
维护者通常 1 天内回复
查看 apache/cloudstack 的全部 Issue
相似的 Issue
-
[FEATURE] Expose external refresh, node-level translog and warmer stats可能已有人在做 关联的 PR 仍在进行中或已合并。 未关闭untriaged
难度 2/5 1-3 小时 新手友好度 68/100
opensearch-project/opensearch-prometheus-exporter#680 ·
维护者通常 2 天内回复
-
难度 2/5 1-3 小时 新手友好度 85/100
-
难度 2/5 1-3 小时 新手友好度 66/100
维护者通常 2 天内回复
-
bug
难度 1/5 1 小时以内 新手友好度 78/100
-
Good First Issue
难度 1/5 1-3 小时 新手友好度 88/100
hiero-ledger/hiero-sdk-java#3059 ·
维护者通常 1 天内回复