Logo K8s Storage Troubleshooting

K8s Storage Troubleshooting

Tổ chức
k8s-servant
k8s-storage-troubleshooting

Dùng khi bộ lưu trữ Kubernetes gây cản trở workload: PersistentVolumeClaim bị kẹt ở Pending; có sự kiện ProvisioningFailed; StorageClass không tồn tại hoặc provisioner không hỗ trợ access mode cần thiết; pod ở trạng thái Pending với "unbound immediate PersistentVolumeClaims"; gặp lỗi FailedAttachVolume, FailedMount hoặc Multi-Attach; PVC hoặc PV bị kẹt ở Terminating hoặc Released; hoặc volume đầy hay không thể mở rộng. Kiểm tra bằng kubectl get, describe và events, rồi đề xuất cách khắc phục. 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-storage-troubleshooting
Sao
36
Bản fork
7
Tệp đi kèm
3
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ộ.

  • 3 tệp đi kèm

    Các tập lệnh, mẫu và tài liệu tham khảo mà mô hình có thể đọc khi làm việc. Các tệp chỉ cho phép đọc và không bao giờ được thực thi.

  • 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 Storage Troubleshooting 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-storage-troubleshooting
  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-storage-troubleshooting .claude/skills/k8s-storage-troubleshooting
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 Storage Troubleshooting 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 Storage Troubleshooting 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 Storage Troubleshooting 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 storage troubleshooting

Find out why a volume does not get to a pod, or why it does not work once it is there, and propose a fix. 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.

Volumes hold data, and many storage changes cannot be undone: a volume cannot shrink, a deleted claim can take its data with it, and most of a claim's spec cannot change after it is created. So most fixes here are proposed fixes, with the reason said.

The commands use placeholders: my-namespace, my-app, my-pod, my-data (the PVC), my-pv, my-class and my-node. Replace them with the real names. Never read Secrets (a StorageClass or CSI driver may reference some; read their names only). If output contains passwords, tokens or keys, do not repeat them.

When to use

  • A PVC is Pending, or a pod is Pending because of its PVC.
  • ProvisioningFailed, FailedAttachVolume, FailedMount or Multi-Attach error events.
  • A PVC or PV is stuck Terminating, or a PV is Released and not reused.
  • A volume is full, or a PVC resize does not finish.

Hand-offs, by skill name. When the evidence points elsewhere, continue with that skill; if it is not installed, keep going with the steps here and tell the user which skill would help:

  • The pod is Pending for CPU, memory, taints or node selectors, not its volume: k8s-node-troubleshooting.
  • The volume is mounted and the app still fails (crash, permissions it logs, probes): k8s-workload-troubleshooting.
  • On AKS, Azure refuses the disk or share (an Azure error code in ProvisioningFailed or FailedAttachVolume, a disk zone conflict, Azure Files mount errors): k8s-aks-troubleshooting.
  • The PVC belongs to a CloudNativePG Cluster (named after an instance, my-db-1, with the label cnpg.io/cluster) and the Cluster's own status matters: k8s-cloudnative-pg-troubleshooting.
  • The volume data is missing after a Velero restore, or a Velero volume backup failed: k8s-velero-troubleshooting.

Investigate

Work through the steps in order. Stop when you have the cause and its evidence.

1. See the claims and their status, and which StorageClass each one asks for.

bash
kubectl get pvc -n my-namespace
kubectl describe pvc my-data -n my-namespace
kubectl events -n my-namespace --for persistentvolumeclaim/my-data

2. See the StorageClasses: which exist, which is the default, the provisioner, the binding mode and whether volumes can expand. StorageClasses and PVs are cluster-scoped, and the built-in view role cannot read them; if these commands are forbidden, say so, and read the class and the provisioner from describe pvc (its StorageClass and the volume.kubernetes.io/storage-provisioner annotation) and from the events.

bash
kubectl get storageclass
kubectl describe storageclass my-class

3. See the PersistentVolumes, if the claim is bound or should bind to an existing one.

bash
kubectl get pv
kubectl describe pv my-pv

4. See the pods that use the claim and their events. A claim waits for its first pod when the class uses WaitForFirstConsumer.

bash
kubectl get pods -n my-namespace -o wide
kubectl describe pod my-pod -n my-namespace
kubectl get deployment my-app -n my-namespace -o jsonpath='{.spec.replicas}{"\n"}{.spec.template.spec.volumes}{"\n"}'

5. For attach or mount errors, look at the CSI side: the attachment for each node, the drivers and the driver's pods.

bash
kubectl get volumeattachments
kubectl get csidrivers
kubectl get csinode my-node -o yaml
kubectl get pods -A -o wide | grep -i csi

6. Open the matching reference and follow its steps:

What you seeReference
PVC Pending, ProvisioningFailed, WaitForFirstConsumer, Released PVreferences/pending.md
FailedAttachVolume, FailedMount, Multi-Attach error, Terminatingreferences/attach-mount.md
Volume full, No space left on device, resize not finishing, evictions for ephemeral storagereferences/space-and-expansion.md

Read the results

What the common findings mean (Kubernetes 1.37):

  • PVC Pending with WaitForFirstConsumer: the class binds and provisions only when a pod that uses the claim is scheduled. With no such pod (a Deployment at 0 replicas, a claim created ahead of time), Pending is expected, not a fault.
  • PVC Pending with ProvisioningFailed: the provisioner refused. The message says why: the class does not exist (storageclass.storage.k8s.io "my-class" not found), the access mode is not supported, the size or a parameter is invalid, or a cloud quota.
  • No storageClassName gets the default class (annotation storageclass.kubernetes.io/is-default-class: "true"). If no default existed when the claim was created, the claim gets one later, when a default appears. storageClassName: "" means no provisioning: only a PV with no class can bind.
  • A pod Pending with pod has unbound immediate PersistentVolumeClaims (the scheduler's message on Kubernetes 1.37): fix the claim first; the pod follows.
  • Access modes: ReadWriteOnce (one node at a time; several pods on that node can share it), ReadOnlyMany, ReadWriteMany, ReadWriteOncePod (one pod; CSI volumes only). The driver decides which it supports; many block-storage drivers have no ReadWriteMany.
  • Most of a claim's spec cannot change after it is created: the API server rejects changes to the class or the access modes. Only the storage request (up, if the class allows expansion) and volumeAttributesClassName can change. A different class or mode means a new claim.
  • Terminating for a claim in use: deletion waits for the kubernetes.io/pvc-protection finalizer until no pod uses it. That protects the data; it is not a fault.

State the cause in one sentence, then the evidence you saw (the event and its message, the class, the access mode, the binding mode), then the proposed fix.

Proposed fix

Show each fix to the user before running it: what it changes and how to undo it. Scaling a workload is reversible, so it goes under "Ask first" and runs only after the user says yes. Deleting or recreating a claim or a PV, removing a finalizer, rebinding a PV and expanding a volume cannot be undone: never run them yourself; hand them to the user as proposed fixes and say why. Prefer fixing the source the workload is deployed from (manifest, Helm values, GitOps repository): a claim's class and access mode are set there.

Start the first pod of a claim that waits for its consumer, if the user wants it bound now (write the undo with the replicas you found):

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

bash
kubectl scale deployment/my-app --replicas=1 -n my-namespace
# Undo: kubectl scale deployment/my-app --replicas=0 -n my-namespace

Recreate a claim that asks for a class this cluster does not have. The class cannot be changed in place, and deleting a claim can delete its volume, so a human runs this, and only for a claim that never bound (no data):

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

bash
kubectl get pvc my-data -n my-namespace -o yaml > my-data-pvc.yaml
kubectl delete pvc my-data -n my-namespace
# Copy my-data-pvc.yaml to my-data-new.yaml and edit the copy: set spec.storageClassName to an
# existing class; remove status, metadata.uid, metadata.resourceVersion,
# metadata.creationTimestamp and the volume.kubernetes.io/* annotations. Then:
kubectl apply -f my-data-new.yaml
# Undo: kubectl delete pvc my-data -n my-namespace, then apply my-data-pvc.yaml with the same metadata and status fields removed

Better: fix storageClassName in the app's source and let the next deploy create the claim.

Sources

Checked against the Kubernetes 1.37 documentation:

Tệp đi kèm

Khi kỹ năng đã được tải, mô hình có thể đọc các tệp này nếu cần. Các tệp này chỉ dùng để đọc và không bao giờ được thực thi.

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

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

Dùng khi bộ lưu trữ Kubernetes gây cản trở workload: PersistentVolumeClaim bị kẹt ở Pending; có sự kiện ProvisioningFailed; StorageClass không tồn tại hoặc provisioner không hỗ trợ access mode cần thiết; pod ở trạng thái Pending với "unbound immediate PersistentVolumeClaims"; gặp lỗi FailedAttachVolume, FailedMount hoặc Multi-Attach; PVC hoặc PV bị kẹt ở Terminating hoặc Released; hoặc volume đầy hay không thể mở rộng. Kiểm tra bằng kubectl get, describe và events, rồi đề xuất cách khắc phục. 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 Storage Troubleshooting 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 Storage Troubleshooting 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 Storage Troubleshooting 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-storage-troubleshooting. TypingMind đọc tệp SKILL.md, đóng gói các tệp đi kèm rồi cài đặt cả gói dưới dạng một kỹ năng mà 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 Storage Troubleshooting?

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 Storage Troubleshooting 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 Storage Troubleshooting 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 Storage Troubleshooting 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 👇