Logo K8s Triage

K8s Triage

Tổ chức
k8s-servant
k8s-triage

Dùng khi có vấn đề trong cluster nhưng chưa rõ nguyên nhân: "cluster bị lỗi", "nhiều pod gặp sự cố", "người dùng báo ứng dụng ngừng hoạt động", "có gì đó bất thường sau khi nâng cấp" hoặc bất kỳ báo cáo sự cố nào không nêu workload cụ thể. Quét các node, pod trong mọi namespace, sự kiện Warning gần đây và mức sử dụng CPU, bộ nhớ; xếp hạng phát hiện theo mức độ nghiêm trọng, đề xuất cách khắc phục đầu tiên cho từng vấn đề và nêu tên kỹ năng có thể xử lý sâu hơn. Chỉ đọc trước và hỏi bạn trước khi thay đổi bất cứ điều gì.

Tổng quan

Nhà phát hànhk8s-servant
Kho mãk8s-skills
Tên kỹ năngk8s-triage
Sao
36
Bản fork
7
Tệp đi kèm
Chỉ có hướng dẫn
Giấy phépApache-2.0
Liên kết
  • Hướng dẫn bằng Markdown

    Tệp SKILL.md được mô hình tải khi cần, nên chỉ tốn token khi có yêu cầu thực sự phù hợp.

  • Dùng được với mọi LLM

    Kỹ năng AI dùng hướng dẫn viết bằng Markdown thay vì mã dành riêng cho một nhà cung cấp, nên dùng được với GPT, Claude, Gemini, Grok hoặc mô hình cục bộ.

  • Hướng dẫn có đủ mọi thứ cần thiết

    Mọi thứ mô hình cần đều nằm trong hướng dẫn — không có tệp bổ sung cần đồng bộ.

  • Mã nguồn mở

    Được k8s-servant công bố trên GitHub. Hãy đọc các tệp nguồn trước khi cài đặt.

Cài đặt

Cài đặt kỹ năng AI K8s Triage trong TypingMind để dùng với bất kỳ LLM nào, hoặc thêm vào một tác nhân AI khác có thể đọc SKILL.md.

1

Cài đặt trong TypingMind

TypingMind cài đặt kỹ năng trực tiếp từ thư mục GitHub — đọc SKILL.md, đóng gói các tệp tài nguyên và lưu kết quả trên máy.

  1. Mở ứng dụng và vào Plugin → Kỹ năng.
  2. Chọn "Cài đặt từ GitHub".
  3. Dán URL của thư mục kỹ năng được hiển thị bên dưới rồi xác nhận.
    https://github.com/k8s-servant/k8s-skills/tree/main/skills/k8s-triage
  4. Bật kỹ năng trong từng cuộc trò chuyện mà bạn muốn sử dụng kỹ năng đó.
Plugin → Kỹ năng → Thêm kỹ năng → Từ URL GitHub, sau đó dán URL thư mục và nhấn Tiếp tục.
2

Cài đặt trong tác nhân AI khác

Bất kỳ tác nhân AI nào đọc được định dạng Agent Skills đều có thể dùng kỹ năng này — hãy sao chép thư mục vào thư mục kỹ năng của tác nhân AI đó.

Claude Code — .claude/skills
git clone --depth 1 https://github.com/k8s-servant/k8s-skills.git /tmp/k8s-skills
mkdir -p .claude/skills
cp -r /tmp/k8s-skills/skills/k8s-triage .claude/skills/k8s-triage
Khởi động lại Claude Code sau khi sao chép để ứng dụng nhận kỹ năng mới.

Sử dụng trong TypingMind

Bật K8s Triage trong bất kỳ cuộc trò chuyện nào trên TypingMind, mô hình sẽ tự xử lý phần còn lại. Tên và mô tả của kỹ năng nằm trong prompt hệ thống. Ngay khi có yêu cầu phù hợp, mô hình tự tải toàn bộ hướng dẫn — bạn không cần gọi thủ công và kỹ năng không tốn token cho đến khi thực sự được dùng.

Mô hình tự nạp K8s Triage ngay khi có yêu cầu phù hợp.

Dùng được với mọi mô hình AI

Kỹ năng AI là các hướng dẫn Markdown thuần túy, không phải mã dành riêng cho một nhà cung cấp, nên bạn có thể dùng K8s Triage với cả những mô hình khác ngoài mô hình ban đầu. Chỉ cần cài đặt một lần trong TypingMind rồi dùng với GPT-5, Claude, Gemini, Grok, DeepSeek, Mistral, Llama hoặc mô hình cục bộ do bạn tự chạy — tất cả đều dùng khóa API của riêng bạn.

  • Chỉ tải khi cần

    Prompt hệ thống chỉ chứa tên và mô tả. Hướng dẫn được tải khi có yêu cầu phù hợp đầu tiên, nên khi kỹ năng chưa được dùng, bạn không tốn token cho phần hướng dẫn.

  • Đổi mô hình ngay trong cuộc trò chuyện

    Vì kỹ năng là hướng dẫn chứ không phải mã, việc đổi mô hình không làm kỹ năng ngừng hoạt động — mô hình tiếp theo vẫn đọc cùng tệp SKILL.md.

Hướng dẫn của kỹ năng

Đây là nội dung SKILL.md mà mô hình tải. Hãy đọc trước khi cài đặt — kỹ năng là những hướng dẫn mà mô hình của bạn sẽ làm theo.

Kubernetes triage

Find out where a cluster is unhealthy when nobody knows yet, rank the problems, and hand each one to the right place. Read first, ask before changing. Run the investigation commands freely. Run a command under an "Ask first" line only after the user approves that exact command; if your credentials do not allow it, give it to the user to run. Never run a "Proposed fix"; hand it to the user.

Triage is a first look, not a root-cause analysis. For each problem, report it, show the evidence, propose a first fix, and name the skill that investigates it fully. Do not dig deeper than the short first look this skill describes.

The commands use placeholders: my-namespace, my-app, my-pod and my-node. Replace them with the real names. Never read Secrets. If output contains passwords, tokens or keys, do not repeat them.

When to use

  • The user reports a problem without naming a workload: "the cluster is broken", "everything is slow", "lots of pods are failing", "users say the app is down".
  • Something changed cluster-wide (an upgrade, a new node pool, a network change) and "something is off".
  • You were asked for a general health check of a cluster.

When the user names one workload that is unhealthy, start with k8s-workload-troubleshooting instead.

Hand-offs, by skill name. For each issue you find, name the skill that goes deeper. If it is not installed, give the issue, its evidence, a first fix and the short first look below, then tell the user which skill would help, and stop there:

  • Pods crash, restart, stay Pending, fail probes, or a rollout or Job is stuck: k8s-workload-troubleshooting.
  • A node is NotReady, under memory, disk or PID pressure, cordoned, or pods are being evicted: k8s-node-troubleshooting.
  • Pods are healthy but traffic does not arrive (Service with no endpoints, DNS, NetworkPolicy, Ingress): k8s-network-troubleshooting.
  • A PersistentVolumeClaim is Pending, or volumes fail to attach or mount: k8s-storage-troubleshooting.
  • The API server refuses requests (failed calling webhook, an APIService that is not True, a namespace stuck Terminating): k8s-api-troubleshooting.
  • On AKS, the error comes from Azure (SyncLoadBalancerFailed, a ProvisioningFailed with an Azure error code, AADSTS errors, a cluster or node pool Failed): k8s-aks-troubleshooting.

Investigate

Work through the steps in order. They are cheap and cluster-wide; do all of them before you rank anything.

1. Check what you can see. A user with access to one namespace cannot list nodes or other namespaces. Know this before you read any result.

bash
kubectl auth can-i list nodes
kubectl auth can-i list pods --all-namespaces
kubectl auth can-i list events --all-namespaces

If a check says no, or a command below fails with Forbidden, say exactly what you could not see, and narrow the sweep to the namespaces you can read. Start with the namespace your kubeconfig points at: commands without -n use it, and users with access to one namespace usually have it set.

bash
kubectl auth can-i list pods
kubectl get pods
kubectl auth can-i list pods -n my-namespace

If none of these works and you know no namespace, ask the user which one to look at. Never report something you could not see as healthy.

2. Nodes. Look at STATUS (Ready, NotReady, and SchedulingDisabled for a cordoned node), then describe every node that is not plainly Ready, and read its Conditions, Taints and Allocated resources.

bash
kubectl get nodes -o wide
kubectl describe node my-node

3. Pods that are not running. Across every namespace you can read:

bash
kubectl get pods -A --field-selector=status.phase!=Running,status.phase!=Succeeded
kubectl get pods -A | grep -v -E "Running|Completed"
kubectl get pods -A --sort-by='.status.containerStatuses[0].restartCount'

The first command finds Pending, Failed and Unknown pods. The second also catches pods whose phase is Running but whose STATUS column says CrashLoopBackOff, ImagePullBackOff, Error or Terminating. The third puts the most restarted pods last. Also look for Running pods that are not ready, such as 0/1 in the READY column.

When a node is not Ready, list the pods on it:

bash
kubectl get pods -A --field-selector=spec.nodeName=my-node -o wide

4. Warning events. For each one, check whether the object it is about is still unhealthy now. Only those count as issues; a Warning about an object that has since recovered is history, even if it is recent (a new cluster has several from start-up).

bash
kubectl events -A --types=Warning

5. CPU and memory. kubectl top works only when metrics-server is installed and running. If it fails, write "metrics not available" in the overall status and go on; Allocated resources from step 2 still shows requests and limits against capacity.

bash
kubectl top nodes
kubectl top pods -A --sort-by=memory
kubectl top pods -A --sort-by=cpu

6. Controllers short of replicas. A Deployment, StatefulSet or DaemonSet whose ready count is below the desired count is affected even when its pods look fine one by one.

bash
kubectl get deployments -A
kubectl get statefulsets -A
kubectl get daemonsets -A

7. PersistentVolumeClaims and Services, only if steps 3 and 4 point there (pods Pending with volume events, or an app that is up but unreachable):

bash
kubectl get pvc -A
kubectl get endpointslices -n my-namespace

8. Pick the area of each issue and its next skill, from this table:

What you seeTierNext skill
Node NotReady or Unknown, a pressure condition True, NetworkUnavailable, SchedulingDisabled1k8s-node-troubleshooting
CrashLoopBackOff, OOMKilled, Error, ErrImagePull, ImagePullBackOff, CreateContainerConfigError2k8s-workload-troubleshooting
Pending, Running but not ready, a controller short of replicas3k8s-workload-troubleshooting (or k8s-storage-troubleshooting for an unbound PVC)
Warning events about objects that are still unhealthy, a node near its memory or CPU capacity, pods at their limits4the area the event belongs to
Service with no ready endpoints while its pods are healthy, DNS failures3k8s-network-troubleshooting
CoreDNS pods crashing or not Ready, CoreDNS errors in its logs2k8s-coredns-troubleshooting
FailedCreate events that name a webhook, an APIService that is not True, a namespace stuck Terminating3k8s-api-troubleshooting
On AKS: SyncLoadBalancerFailed, Azure error codes in ProvisioningFailed or FailedAttachVolume, AADSTS errors in logs3k8s-aks-troubleshooting

A short first look inside a container can confirm a network issue. Ask first: show the command, and run it only after the user agrees (pick a running pod in the namespace that has nslookup; many minimal images do not):

Ask first: the agent runs this only after the user approves it.

bash
kubectl exec my-pod -n my-namespace -- nslookup my-app.my-namespace.svc.cluster.local

Read the results

Rank by severity. Report issues in this order, most urgent first:

  1. Nodes. NotReady or Unknown, MemoryPressure, DiskPressure or PIDPressure True, NetworkUnavailable, cordoned (SchedulingDisabled).
  2. Crashing pods. CrashLoopBackOff, OOMKilled, Error, ErrImagePull or ImagePullBackOff, CreateContainerConfigError.
  3. Pods that do not become ready. Pending, Running but not ready, controllers with fewer ready replicas than desired, Services without ready endpoints.
  4. Early warnings. Warning events about objects that are still unhealthy, and resource pressure that has not broken anything yet (a node above about 90% of its memory, pods at their CPU or memory limit).

Within a tier, more affected nodes or pods rank higher. One cause, one issue: when a node problem explains pod symptoms (the pods on a NotReady node show Unknown, Terminating, or are being recreated elsewhere), report the node issue once and list the pods as its evidence. Do not report those pods as separate application failures.

Read nodes. Ready is Unknown when the node controller has not heard from the node within its grace period (50 seconds by default): the kubelet is down or the node is unreachable. Ready is False when the kubelet reports the node is not healthy. A pressure condition True means the kubelet may evict pods from that node. The taints node.kubernetes.io/not-ready, node.kubernetes.io/unreachable and node.kubernetes.io/unschedulable (a cordoned node) show the same state to the scheduler. By default, pods on a NotReady or unreachable node are evicted after five minutes; until then they look stuck, and pods of a StatefulSet can stay Terminating.

Read events. Typical reasons: FailedScheduling, BackOff, Failed (image pull), Unhealthy (probes), FailedMount, Evicted, NodeNotReady, OOMKilling. An event is evidence only when its object is unhealthy now: a Running, ready pod that once failed a readiness probe is not an issue.

Write the report in this shape:

  1. Overall status. Nodes (how many, how many Ready), pods (how many are not healthy, in how many namespaces), metrics (available or not), and what you could not see because of access.
  2. Issues, ranked. For each: one sentence for the issue, the evidence you saw (the status, the condition, the event reason and message, the number), the next skill, and a first fix in the format under Proposed fix.
  3. When the sweep is clean, do not invent a problem. Say what you checked and that it looked healthy from where you could see, then ask the user to narrow it down: which app, namespace or URL, what exactly they saw (an error message, a timeout, slowness), and since when.

Proposed fix

Triage proposes first fixes only. Show each one to the user first: what it changes and how to undo it. A reversible fix goes under "Ask first" and runs only after the user says yes. Anything destructive or hard to undo is never run by you; say why and hand it over. Prefer fixing the source the workload is deployed from (manifest, Helm values, GitOps repository) when there is one. Write each undo with the values you found.

Uncordon a node that was left cordoned after maintenance and is otherwise healthy:

Ask first: the agent runs this only after the user approves it.

bash
kubectl uncordon my-node
# Undo: kubectl cordon my-node

Roll back a Deployment whose pods started failing right after a rollout. First note the current revision with kubectl rollout history deployment/my-app -n my-namespace; the undo below returns to it by number (here revision 3), so it holds even if another rollout happens in between:

Ask first: the agent runs this only after the user approves it.

bash
kubectl rollout undo deployment/my-app -n my-namespace
# Undo: kubectl rollout undo deployment/my-app -n my-namespace --to-revision=3

Force-delete a pod stuck Terminating on a node that is gone for good. Never run this yourself: for a StatefulSet pod it can start a second copy while the first still runs on a node that is only unreachable. A human must first confirm the node is really gone.

Proposed fix: review before running. The agent does not run this.

bash
kubectl delete pod my-pod -n my-namespace --force --grace-period=0
# Undo: none; the pod's controller recreates it on another node

For a node that stays NotReady, a workload that keeps crashing, a Service without endpoints or a stuck volume, the fix needs the deeper skill named in the issue.

Sources

Checked against the Kubernetes 1.37 documentation:

Câu hỏi thường gặp

Kỹ năng AI K8s Triage làm được gì?

Dùng khi có vấn đề trong cluster nhưng chưa rõ nguyên nhân: "cluster bị lỗi", "nhiều pod gặp sự cố", "người dùng báo ứng dụng ngừng hoạt động", "có gì đó bất thường sau khi nâng cấp" hoặc bất kỳ báo cáo sự cố nào không nêu workload cụ thể. Quét các node, pod trong mọi namespace, sự kiện Warning gần đây và mức sử dụng CPU, bộ nhớ; xếp hạng phát hiện theo mức độ nghiêm trọng, đề xuất cách khắc phục đầu tiên cho từng vấn đề và nêu tên kỹ năng có thể xử lý sâu hơn. Chỉ đọc trước và hỏi bạn trước khi thay đổi bất cứ điều gì.

Vì sao nên dùng K8s Triage trên TypingMind?

Vì bạn chỉ cần cài một lần rồi dùng với bất kỳ mô hình nào. K8s Triage là nội dung Markdown chứ không phải mã dành riêng cho từng nhà cung cấp, nên cùng một kỹ năng có thể chạy trên GPT-5, Claude, Gemini, Grok hoặc mô hình trên thiết bị — và bạn có thể đổi mô hình ngay trong cuộc trò chuyện mà kỹ năng vẫn hoạt động. TypingMind dùng khóa API riêng của bạn, nên bạn thanh toán trực tiếp cho nhà cung cấp thay vì trả phí thuê bao theo suất người dùng, đồng thời kỹ năng và các cuộc trò chuyện vẫn nằm trong bộ lưu trữ của bạn.

Làm thế nào để cài K8s Triage trong TypingMind?

Mở Plugin → Kỹ năng → Cài đặt từ GitHub trong TypingMind rồi dán https://github.com/k8s-servant/k8s-skills/tree/main/skills/k8s-triage. TypingMind đọc tệp SKILL.md rồi cài đặt kỹ năng để bạn có thể bật cho từng cuộc trò chuyện.

Những mô hình AI nào có thể dùng K8s Triage?

Bất kỳ mô hình nào bạn kết nối trong TypingMind. Kỹ năng AI là các hướng dẫn bằng Markdown chứ không phải mã dành riêng cho từng nhà cung cấp, nên GPT, Claude, Gemini, Grok và các mô hình chạy trên thiết bị đều có thể tải kỹ năng này khi có yêu cầu phù hợp.

Có thể dùng K8s Triage với bao nhiêu mô hình AI?

Bao nhiêu cũng được. Miễn là mô hình hỗ trợ kỹ năng, bạn có thể dùng K8s Triage với mô hình đó — GPT, Claude, Gemini, Grok, DeepSeek, Mistral, Llama và nhiều mô hình khác — tất cả đều trên TypingMind với khóa API riêng của bạn.

Kỹ năng AI K8s Triage có miễn phí không?

Có. Kỹ năng này được k8s-servant phát hành trên GitHub theo giấy phép Apache-2.0. Bạn chỉ trả tiền cho nhà cung cấp AI của mình theo số token đã dùng.

Kỹ năng AI là gì?

Kỹ năng AI là một gói hướng dẫn có thể tái sử dụng, chỉ cho mô hình AI cách thực hiện một tác vụ cụ thể. Kỹ năng tuân theo định dạng mở Agent Skills: một tệp SKILL.md chứa tên và mô tả, cùng các tập lệnh, mẫu hoặc tệp tham khảo mà mô hình có thể cần. Mô hình chỉ đọc hướng dẫn khi yêu cầu của bạn phù hợp với kỹ năng, nên kỹ năng đã cài đặt không phát sinh chi phí cho đến khi được sử dụng.

Kỹ năng AI khác gì với plugin hoặc máy chủ MCP?

Plugin hoặc máy chủ MCP cung cấp các công cụ mới mà mô hình có thể gọi. Khi mô hình gọi một công cụ, mã của công cụ đó chạy ở đâu đó và trả về kết quả. Còn kỹ năng AI cung cấp kiến thức và quy trình: cách tiếp cận tác vụ, các bước cần thực hiện và những tiêu chí mà kết quả cần đáp ứng. Kỹ năng chỉ là nội dung Markdown, nên không cần máy chủ, khóa API hay môi trường thực thi và hoạt động với mọi mô hình.

Xem tất cả

Tạo ngay không gian làm việc AI riêng

Đăng ký bản tin của chúng tôi để nhận thông báo về tính năng mới và các đợt tặng quà sắp tới 👇