Garbage-collect host-data resources after Kubernetes Nodes are deleted
维护者通常 1 天内回复
还没有人认领这个 Issue。
评估
- 难度
- 4/5
- 预计耗时
- 3-5 天
- 新手友好度
- 55/100
- Issue 类型
- 缺陷
- 描述清晰度
- 基本清楚
- 活跃度
- 活跃
- 技术栈
- go, kubernetes
调研方向
从 CRDClient.CreateOrUpdateHostData 和 host-sensor manager 开始,追踪 host-data resources 的创建和管理方式。然后检查 controller 端的 Node 处理逻辑和现有测试,为已删除的 Nodes、为空或失败的 Node 列表以及存在的 Node 添加覆盖。完成的标准是:仅针对缺失的 Nodes 删除过期资源,并且在列表错误或结果为空时,清理以 fail closed 方式处理。
由索引模型根据 Issue 内容生成。
描述
What happened?
Host-data custom resources created by the node agent remain after their Kubernetes Node is deleted. On clusters with node autoscaling, each scale-up creates another set of cluster-scoped resources and the stale objects accumulate indefinitely.
Why it happens
CRDClient.CreateOrUpdateHostData names each resource after the node but sets no owner reference. The host-sensor manager has no node-deletion watcher or shutdown cleanup, so nothing removes resources when a Node disappears.
This affects the resources in hostdata.kubescape.cloud, including OS release, kernel, kubelet, CNI, open-port, security-hardening, control-plane, cloud-provider, and kernel-variable data.
Requested behavior
Please garbage-collect host-data resources whose named Kubernetes Node no longer exists. Cleanup should fail closed when the Node list cannot be read or is empty, and should not remove data for a present Node.
A controller-side Node deletion watcher is likely more reliable than pod shutdown cleanup because an autoscaled node can disappear without giving its node-agent pod a clean shutdown window. Tests should cover node deletion, transient Node-list failure, and a present node.
Versions checked
- node-agent v0.3.142
- current
mainas of 2026-09-08
- 主要语言
- Go
- 星标
- 39
- 派生
- 42
- 平均合并
- 1 天 18 小时
- 30 天内合并 PR
- 40
环境准备
- 没有 Dockerfile 或 Docker Compose 文件
- 有 Pull Request 模板
- 阅读贡献指南
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
kubescape/node-agent 的其他 Issue
-
难度 1/5 1 小时以内 新手友好度 72/100
kubescape/node-agent#1099 ·
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 82/100
kubescape/node-agent#1093 ·
维护者通常 1 天内回复
-
Upgrade Inspektor Gadget to v0.57.0 via kubescape fork and preserve exec/path semantics可能已有人在做 @ANAMASGARD 于 18 天前认领。 未关闭enhancement
kubescape/node-agent#1050 · 2 条评论 · 已指派 1 人 ·
维护者通常 1 天内回复
-
难度 5/5 一周以上 新手友好度 35/100
kubescape/node-agent#1014 ·
维护者通常 1 天内回复
-
Scan container images for misplaced secrets可能重新可做 @khuswant18 于 48 天前认领,目前没有进行中的 PR。 未关闭
kubescape/node-agent#987 · 已指派 1 人 ·
维护者通常 1 天内回复
查看 kubescape/node-agent 的全部 Issue
相似的 Issue
-
难度 2/5 1-3 小时 新手友好度 62/100
-
evener-transcript-v2-upgrade tool still scans transcript files through bufio's 4 KiB default buffer未关闭
难度 1/5 1 小时以内 新手友好度 78/100
prime-radiant-inc/evener#6370 ·
维护者通常 1 天内回复
-
ManageSieve proxy: a backend's NO/BYE greeting is skipped as a capability line and reported as EOF未关闭bug
难度 2/5 1-3 小时 新手友好度 72/100
维护者通常 1 天内回复
-
Mend: dependency security vulnerability
难度 2/5 1-3 小时 新手友好度 65/100
-
Mend: dependency security vulnerability
难度 2/5 1-3 小时 新手友好度 62/100
ManageIQ/manageiq-pods#1476 ·
维护者通常 1 天内回复