stackabletech / stackabletech/stackablectl
GVK resolution fails if metrics-server is unavailable
还没有人认领这个 Issue。
- 主要语言
- Rust
- 星标
- 10
- 派生
- 5
- 平均合并
- 4 小时 41 分钟
- 30 天内合并 PR
- 4
描述
Affected version
stackablectl 24.7.1
Current and expected behavior
- Run
kubectl -n kube-system delete pods -l k8s-app=metrics-server && stackablectl release install dev - Observe that
stackablectlcrashes with the following error message:
ERROR failed with status 503 Service Unavailable
at src/client/builder.rs:199
WARN Unsuccessful data error parse: service unavailable
at src/client/mod.rs:467
An unrecoverable error occured: failed to execute release (sub)command
Caused by these errors (recent errors listed first):
1: failed to create Kubernetes client
2: failed to run GVK discovery
3: ApiError: "service unavailable\n": Failed to parse error data (ErrorResponse { status: "503 Service Unavailable", message: "\"service unavailable\\n\"", reason: "Failed to parse error data", code: 503 })
4: "service unavailable\n": Failed to parse error data
- Observe that
kubectlandk9sare able to manage the cluster just fine
I suspect that this comes down to metrics-server using K8s API aggregation, which allows it to provide a fake "resource" that is stored by itself rather than in etcd. This also means that that resource can be unavailable even if the apiserver and etcd are both doing fine.
Possible solution
We could either:
- Limit GVK resolution to the apigroups we care about
- Defer apigroup-specific resolution errors until accessing the relevant apigroup
Additional context
No response
Environment
Using k3s v1.31.0+k3s1 via k3d
Would you like to work on fixing this bug?
None
贡献指南
这个仓库没有索引到贡献指南
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
调研方向
使用 kubectl -n kube-system delete pods -l k8s-app=metrics-server && stackablectl release install dev 重现失败,然后检查 src/client/builder.rs:199 中的 GVK discovery 以及 src/client/mod.rs:467 附近的错误处理。修复应当在 metrics-server 不可用时允许 release 安装继续,同时保留对 stackablectl 所需 API 组的解析。
由索引模型根据 Issue 内容生成。
评估
- 技术栈
- kubernetes, rust
- 领域
- api, cli
- Issue 类型
- 缺陷
- 难度
- 4/5
- 预计耗时
- 3-5 天
- 活跃度
- 停滞
- 描述清晰度
- 基本清楚
- 新手友好度
- 38/100