升级
- 作者仓库星标 0
- 作者仓库 skills-registry
- 领域
- 运维部署
- 作者声明的智能体
- 未找到明确声明;不据此推断已兼容或已测试
- 静态检查
- 88 / 100 · 启发式扫描,不代表运行安全
- 运行环境证据
- 未执行;当前没有隔离运行测试证据
- 作者 / 版本 / 许可证
- @tomevault-io · 未声明许可证
- 上下文用量评级
- 低消耗
- 接入复杂程度
- 需简单配置
- 是否需要外部接口密钥
- 不需要
- 兼容的系统
- Linux
- 运行环境要求
- Node.js
- 检测到的文件与系统行为
-
- 只读
- 允许写入 / 修改
- 命令执行
- 网络行为
- 仅限本地
- 安装命令数
- 无(仅作为资料)
需要注意: 未声明工具权限范围;实际权限由运行环境决定。
从用户消息中解析出目标版本;如果缺少则提示从`talos/talconfig.yaml`(`kubernetesVersion`)读取当前版本分类:次要(1.34→1.35,风险较高)或补丁(1.35.0→1.35.1)
使用`infra`模板创建 GitHub 问题,以便 SRE 代理查看维护上下文。包括: 标题:`infra(k8s): upgrade Kubernetes to v<version>` 标签:`infra` 摘要、动机(如果适用,更新 PR 参考)、计划更改、回滚计划、风险级别(补丁与次要版本) 跟踪提交参考的问题编号 (`Ref #<number>`)
有关程序请参阅`references/breaking-changes-lookup.md`。硬门:目前的发现。等待用户确认。如果删除的 API 与集群资源匹配,建议中止。
有关程序请参阅`references/api-deprecation-scanning.md`。硬门:如果已删除的 API 正在使用中,则阻止。列出需要迁移的资源。
从`talos/talconfig.yaml`(`talosVersion`)读取Talos版本查询上下文7:`query-docs(libraryId: "/siderolabs/talos", query: "supported kubernetes versions for Talos v<current>")`硬门:如果不兼容,则阻止。先推荐`talos-upgrade`代理。
动态发现 CP 节点 IP:检查 · 命令 · 通过标准节点 · `kubectl get nodes -o wide` · All Ready Talos 运行状况 · `talosctl health -n <first-cp>` · 通过 etcd · `talosctl etcd status -n <cp1>,<cp2>,<cp3>` · 3 个健康成员
硬门:必须成功。
等待所有节点显示新版本(`kubectl get nodes`)。如果 20 分钟后没有进展,请使用`talosctl dmesg` 和`kubectl describe nodes` 进行调查。
# Kubernetes Upgrade
Orchestrate safe Kubernetes version upgrades on Talos Linux. Primary value: comprehensive pre-flight safety before `talosctl upgrade-k8s`.
## Quick Reference
| Item | Value |
| --------------- | --------------------------------------------------- |
| Upgrade command | `talosctl upgrade-k8s -n <cp-node> --to v<version>` |
| Config file | `talos/talconfig.yaml` (`kubernetesVersion` field) |
| Node topology | 3 CP (e2-1/2/3), 3 workers (ms-01-1/2/3) |
| Talos OS agent | `talos-upgrade` (different from this skill) |
## Workflow
### Phase 1: Input Parsing
- Parse target version from user message; prompt if missing
- Read current version from `talos/talconfig.yaml` (`kubernetesVersion`)
- Classify: **minor** (1.34→1.35, higher risk) or **patch** (1.35.0→1.35.1)
### Phase 2: Create GitHub Issue
Create a GitHub issue using the `infra` template so SRE agents see maintenance context. Include:
- Title: `infra(k8s): upgrade Kubernetes to v<version>`
- Label: `infra`
- Summary, motivation (Renovate PR ref if applicable), planned changes, rollback plan, risk level (patch vs minor)
- Track issue number for commit references (`Ref #<number>`)
### Phase 3: Breaking Changes Research
Consult `references/breaking-changes-lookup.md` for procedures.
**HARD GATE:** Present findings. Wait for user acknowledgment. If removed APIs match cluster resources, recommend aborting.
### Phase 4: Cluster API Compatibility Scan
Consult `references/api-deprecation-scanning.md` for procedures.
**HARD GATE:** If removed APIs are in active use, BLOCK. List resources requiring migration.
### Phase 5: Talos Compatibility Check
1. Read Talos version from `talos/talconfig.yaml` (`talosVersion`)
2. Query Context7: `query-docs(libraryId: "/siderolabs/talos", query: "supported kubernetes versions for Talos v<current>")`
**HARD GATE:** If incompatible, BLOCK. Recommend `talos-upgrade` agent first.
### Phase 6: Cluster Health Gate
Discover CP node IPs dynamically:
```bash
CP_NODES=$(kubectl get nodes -l node-role.kubernetes.io/control-plane \
-o jsonpath='{.items[*].status.addresses[?(@.type=="InternalIP")].address}')
```
| Check | Command | Pass Criteria |
| ------------ | ----------------------------------------------------------------- | ----------------- |
| Nodes | `kubectl get nodes -o wide` | All Ready |
| Talos health | `talosctl health -n <first-cp>` | Passes |
| etcd | `talosctl etcd status -n <cp1>,<cp2>,<cp3>` | 3 healthy members |
| Ceph | `kubectl -n rook-ceph exec deploy/rook-ceph-tools -- ceph status` | HEALTH_OK |
| Flux ks | `flux get kustomizations -A` | All Ready |
| Flux hr | `flux get helmreleases -A` | No failures |
**HARD GATE:** All checks must pass. Report specific failures.
### Phase 7: etcd Backup
```bash
CP_NODE=$(kubectl get nodes -l node-role.kubernetes.io/control-plane \
-o jsonpath='{.items[0].status.addresses[?(@.type=="InternalIP")].address}')
talosctl -n $CP_NODE etcd snapshot /tmp/etcd-backup-$(date +%Y%m%d-%H%M%S).snapshot
```
### Phase 8: Dry Run
```bash
talosctl upgrade-k8s -n <cp-node-ip> --to v<version> --dry-run
```
**HARD GATE:** Must succeed.
### Phase 9: Execute Upgrade
```bash
talosctl upgrade-k8s -n <cp-node-ip> --to v<version>
```
Wait for all nodes to show new version (`kubectl get nodes`). If no progress after 20 min, investigate with `talosctl dmesg` and `kubectl describe nodes`.
### Phase 10: Post-Upgrade Validation
Re-run Phase 6 health checks plus `kubectl version` and `kubectl get nodes -o wide`. Confirm all nodes report new version.
### Phase 11: Roll Stale Secret Volume Mounts
K8s upgrades restart all kubelets. After restart, kubelet's `Watch`-based secret manager fails to re-establish watches for pre-existing pods' volume mounts. Secrets mounted as volumes become frozen at the pre-upgrade state.
**Detection:** For every Running pod with a secret volume (non-subPath), exec `stat -c %Y <mount>/..data` and compare against the kubelet restart time. If the `..data` symlink timestamp predates the kubelet restart, the mount is stale.
**Roll order (sequential, not parallel):**
1. **Safe tier** — stateless or independently restartable. Roll all at once:
- `kubectl rollout restart` for Deployments
- `kubectl delete pod` for StatefulSets (one at a time, wait for Ready)
- Namespaces: observability, authentik, cnpg plugins, firefly-iii, nexus, app workloads
2. **DNS tier** — technitium primary + secondary:
- Roll secondary first, wait for Ready
- Roll primary, wait for Ready
- Verify: `dig @<technitium-ip> <any-internal-record>`
3. **Storage tier** — rook-ceph (mons, mgrs, rgws, crashcollectors, exporters, tools):
- **Before each restart:** `ceph status` must show HEALTH_OK (HEALTH_WARN acceptable only for expected warnings)
- Roll one pod at a time, wait for Ready + Ceph health between each
- Order: tools → crashcollectors → exporters → rgw → mgr-b → mgr-a → mons (one at a time)
- **STOP if Ceph goes HEALTH_ERR** — investigate before continuing
4. **Skip:** Pods where stat failed (subPath mounts) — these read at pod start and don't use the `..data` symlink mechanism
**Report:** List what was rolled and current health after completion.
### Phase 12: Update Files & Report
1. Update `kubernetesVersion` in `talos/talconfig.yaml`
2. Search for **all** old version references:
- Grep tool: search `<old-version>` (no `v` prefix) in `talos/*.yaml`, `docs/*.md`, `cluster/*.yaml`
- **Grep may miss hookify-blocked files.** Fallback: `grep -r "v<old-version>" cluster/ --include="*.yaml" -l 2>/dev/null`. Files found only by bash need `sed -i` instead of Edit tool.
3. Common locations: `talos/talconfig.yaml`, `talos/README.md`, `cluster/flux/meta/cluster-settings.yaml`, `kubernetes-json-schema` URLs in 30+ manifest files
4. Update all references; verify zero remain
5. Present final report: version change, node status, health results, files changed
## Rollback
- `talosctl upgrade-k8s` is idempotent — re-run if it fails partway
- etcd backup from Phase 7 is primary recovery (**WARNING:** restore is destructive, resets to snapshot point)
- Debug: `talosctl -n <ip> logs kubelet`, `talosctl -n <ip> dmesg`
- Context7: `query-docs(libraryId: "/siderolabs/talos", query: "kubernetes upgrade rollback recovery")`
## Commit Pattern
```
infra(k8s): upgrade Kubernetes to v<version>
Ref #<issue-number>
```
---
> Source: [anthony-spruyt/spruyt-labs](https://github.com/anthony-spruyt/spruyt-labs) — distributed by [TomeVault](https://tomevault.io).
<!-- tomevault:4.0:skill_md:2026-05-22 -->
按说明文件中的顺序排列。
快速参考
第一阶段:输入解析
第 2 阶段:创建 GitHub 问题
第三阶段:突破性变革研究
第 4 阶段:集群 API 兼容性扫描
文件/命令 -> talosctl upgrade-k8s · talosctl upgrade-k8s -n <cp-node> --to v<version> · talos/talconfig.yaml · kubernetesVersion · talos-upgrade · infra · infra(k8s): upgrade Kubernetes to v<version> · Ref #<number>
内容校验值 -> c4847a477435
当前原文的自动摘译,尚未人工审校。
快速参考
项目·值升级命令·
talosctl upgrade-k8s -n <cp-node> --to v<version>配置文件·talos/talconfig.yaml(kubernetesVersion字段)节点拓扑·3个CP(e2-1/2/3),3个worker(ms-01-1/2/3)Talos OS代理·talos-upgrade(与该技能不同)第 2 阶段:创建 GitHub 问题
使用
infra模板创建 GitHub 问题,以便 SRE 代理查看维护上下文。包括: 标题:infra(k8s): upgrade Kubernetes to v<version>标签:infra摘要、动机(如果适用,更新 PR 参考)、计划更改、回滚计划、风险级别(补丁与次要版本)跟踪提交参考的问题编号 (Ref #<number>)