一键导入
k8s-work
Manage the Kubernetes development cluster — health checks, continuous monitoring, kubectl/helm operations, and troubleshooting.
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
菜单
Manage the Kubernetes development cluster — health checks, continuous monitoring, kubectl/helm operations, and troubleshooting.
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
基于 SOC 职业分类
Reference and coding guide for DataHub integration in backend development. Use when implementing or debugging code that touches DataHub — entities (datasets, dashboards, charts), aspects (ownership, tags, domains, glossary terms, structured properties), lineage, assertions, URNs, ingestion/emission, GraphQL, REST, or the acryl-datahub Python SDK. Also answers data-modeling questions and helps choose native DataHub features vs custom extensions. Trigger this skill whenever a task involves DataHub metadata, lineage, ingestion, or any DataHub API surface, even without explicit mention of "API".
Drive the helm-charts/bin/ install/uninstall/build/health scripts for both dev and prod profiles — configure, install, reinstall, uninstall, health-check, and rebuild-the-API / rebuild-the-frontend. The dev profile installs umbrella chart + peripherals (nginx-ingress, DataHub, Langfuse, dummy data, dev-lock) and auto-seeds peripheral connection config via the admin API. The prod profile installs the umbrella chart only; operator wires peripherals via /api/v1/admin/peripherals/*.
Walk a single api-wired UC scenario through the browser UI manually: for each step in the source test file, print the UI gesture (page + action), ask you to perform it and report what you observed, then independently probe the backend (REST read-back, DB rows, DataHub aspects, k8s secrets) to confirm the side effect fired. The human-driven sibling of the automated `tests/e2e/` use-case group — same scenarios, with a human at the browser. Optional argument `scope` selects the case (free-form: "UC1", "UC1 Case 2", "passive kafka", filename fragment, etc.).
Bidirectional sync between DataSpoke specs and implementation. Accepts a preset scope (prauto, ai-scaffold, k8s-deploy, helm-charts, api, ref, backend, frontend, all) or a free-form description of an area (e.g., "recently developed backend ingestion secret resolution"). Audits the scope, reports the gaps, asks the user which direction to resolve each gap (spec→impl, impl→spec, or leave-as-flagged), then applies the chosen edits. Trigger when specs and code may have drifted apart and the user wants them reconciled.
Download AI reference materials (external source code for AI assistant reference). Offers individual or all references.
Author timeless specification documents under spec/ (top-level or spec/feature/<FEATURE>.md) following the project hierarchy, naming conventions, and templates. Use when the user asks to write, design, or document a DataSpoke feature, component, or architectural decision as a reference spec. Do NOT use for implementation plans — those live in GitHub issues/PRs and are produced by native Plan mode or PRauto.
| name | k8s-work |
| description | Manage the Kubernetes development cluster — health checks, continuous monitoring, kubectl/helm operations, and troubleshooting. |
| argument-hint | [status|monitor|<kubectl/helm operation>] |
| context | fork |
| agent | general-purpose |
| allowed-tools | Bash(kubectl *), Bash(helm *), Bash(minikube *), Bash(sleep *), Bash(date *), Read |
Read cluster config: Read helm-charts/.env.dev (dev) or helm-charts/.env.prod (prod) to get:
DATASPOKE_KUBE_CLUSTER — kube context (e.g., docker-desktop)DATASPOKE_DEV_KUBE_DATAHUB_NAMESPACE — DataHub namespace (e.g., datahub-01)DATASPOKE_KUBE_DATASPOKE_NAMESPACE — DataSpoke namespace (e.g., dataspoke-01)DATASPOKE_DEV_KUBE_DUMMY_DATA_NAMESPACE — Example sources namespace (e.g., dataspoke-dummy-data-01)Use these variable values in all kubectl/helm commands. Do NOT hardcode namespace names.
Verify prerequisites:
kubectl version --client
kubectl config current-context # confirm correct context
kubectl get nodes # confirm cluster access
If tools are missing or cluster is unreachable, stop and inform the user.
Parse $ARGUMENTS and the user's request to determine the action:
| Action | Trigger keywords |
|---|---|
| status | status, health, check — or no arguments |
| monitor | monitor, watch, poll, track |
| operation | Any kubectl/helm command or resource management request |
Run a full cluster health snapshot and produce a formatted report.
Substitute $NS_DH, $NS_DS, $NS_EX with the namespace names from .env. Collect, per namespace where applicable:
kubectl get nodes (name, status, CPU, memory); kubectl top nodes if metrics-server present.kubectl get pods -n <ns> -o wide for all three namespaces (tolerate empty/missing namespaces).kubectl get pvc -n <ns>.kubectl top pods -n <ns> --sort-by=cpu.helm list -n <ns>; plus helm list --all-namespaces --failed.kubectl get events -n <ns> --field-selector type=Warning --sort-by='.lastTimestamp' (last ~20).If $ARGUMENTS specifies a focus area (pod, release, component), run the troubleshooting workflow in troubleshooting.md: describe the resource, tail logs (last 100 lines), and for Helm releases show history + values.
Produce a Markdown report titled ## Cluster Health Report — <timestamp> with the current kube context, then sections for Nodes, each namespace's Pods, Helm Releases, Warnings, Resource Pressure, and a final one-line Summary (✅ / ⚠️ / ❌ with brief notes and suggested next steps). Use tables for tabular data (nodes, pods, releases).
Use this during installations, upgrades, or any cluster modification. When any pod is not fully ready (e.g., 0/1 Running, Init, Pending, CrashLoopBackOff) or any Helm release is in pending-install/pending-upgrade, poll repeatedly. Do NOT just collect a one-time snapshot and return.
Polling procedure — repeat up to 15 iterations (total ~5 minutes):
a. sleep 20 (wait 20 seconds between checks)
b. kubectl get pods -n $NS_DH to get current pod status (repeat for $NS_DS and $NS_EX)
c. For each pod that is NOT ready (Ready != True, or status != Running/Completed):
kubectl logs <pod-name> -n <namespace> --tail=15 to see latest log outputPending or Init*, run kubectl describe pod <pod-name> -n <namespace> | tail -20 for events
d. helm list -n $NS_DH --all to check release status
e. Note the progress since last check (e.g., "system-update: now loading plugins...", "GMS: readiness probe passing")Stop conditions — exit the loop early when ANY of these are true:
Ready and all jobs show CompletedCrashLoopBackOff with 3+ restarts (report the error and stop)Error or OOMKilled (report and stop)IMPORTANT: Each iteration must sleep ≤25 seconds and make at least one kubectl call — the user expects incremental progress updates, not a single final report.
After monitoring completes, output the full health report (same format as the status action).
For any kubectl or helm operation requested by the user.
Classify the operation before acting:
kubectl get/describe/logs/events, helm status/history/get values.kubectl apply --dry-run=server first, then apply.kubectl config current-context), describe the resource, delete, verify. Never delete namespaces. Confirm with the user before any namespace-level or scale-to-zero destructive operation.After every operation, summarize:
For errors, consult reference.md for common causes and resolutions.
See reference.md for helm chart management, resource creation patterns, capacity planning, and error reference. See troubleshooting.md for deep-dive workflows and error reference.