K8s Storage Troubleshootingのロゴ

K8s Storage Troubleshooting

組織
k8s-servant
k8s-storage-troubleshooting

Kubernetesのストレージがワークロードを妨げている場合に使用します。PersistentVolumeClaimがPendingのまま、ProvisioningFailedイベント、存在しないStorageClass、または要求されたアクセスモードを提供できないプロビジョナー、Podが「unbound immediate PersistentVolumeClaims」でPendingになる、FailedAttachVolume、FailedMount、Multi-Attachエラー、PVCまたはPVがTerminatingまたはReleasedのまま、ボリュームの容量不足、または拡張できない場合が対象です。kubectl get、describe、eventsを使って調査し、対処方法を提案します。まず読み取り専用で調査し、変更する前に確認を求めます。

概要

公開者k8s-servant
リポジトリk8s-skills
スキル名k8s-storage-troubleshooting
スター
36
フォーク
7
同梱ファイル
3
ライセンスApache-2.0
リンク
  • Markdown形式の指示

    モデルが必要に応じて読み込むSKILL.mdファイルです。関連するリクエストがあったときだけトークンを消費します。

  • どのLLMでも利用可能

    AIスキルはプロバイダー固有のコードではなく、通常のMarkdownなので、GPT、Claude、Gemini、Grok、ローカルモデルで利用できます。

  • 3個の同梱ファイル

    モデルが作業中に読み取れるスクリプト、テンプレート、参考資料です。ファイルは読み取り専用で、実行されることはありません。

  • オープンソース

    k8s-servantがGitHubで公開しています。インストールする前にソースを確認してください。

インストール

AIスキル「K8s Storage Troubleshooting」をTypingMindにインストールすれば、どのLLMでも利用できます。SKILL.mdを読み取れる別のAIエージェントに追加することもできます。

1

TypingMindにインストール

TypingMindはGitHubフォルダから直接スキルをインストールします。SKILL.mdを読み取り、リソースファイルをまとめてローカルに保存します。

  1. アプリを開き、「プラグイン」→「スキル」に移動します。
  2. 「GitHubからインストール」を選択します。
  3. 以下のスキルフォルダのURLを貼り付けて確定します。
    https://github.com/k8s-servant/k8s-skills/tree/main/skills/k8s-storage-troubleshooting
  4. スキルを利用したいチャットごとに、そのスキルを有効にしてください。
「プラグイン」→「スキル」→「スキルを追加」→「GitHubのURLから」を選択し、フォルダのURLを貼り付けて「続行」を押します。
2

別のAIエージェントにインストール

Agent Skills形式を読み取れるAIエージェントなら、このスキルを利用できます。フォルダをその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
コピー後、新しいスキルを読み込むためにClaude Codeを再起動してください。

TypingMindで使用

TypingMindのチャットでK8s Storage Troubleshootingを有効にするだけで、あとはモデルが対応します。名前と説明がシステムプロンプトに含まれ、関連するリクエストがあると、モデルが指示の全文を自動で読み込みます。手動で呼び出す必要はなく、実際に使用されるまでトークンを消費しません。

関連するリクエストがあるとすぐに、モデルが自動的にK8s Storage Troubleshootingを読み込みます。

どのAIモデルでも利用可能

AIスキルはプロバイダー固有のコードではなく、通常のMarkdownで書かれた指示です。そのため、K8s Storage Troubleshootingは作成時に想定されたモデルに縛られません。TypingMindに一度インストールすれば、ご自身のAPIキーを使って、GPT-5、Claude、Gemini、Grok、DeepSeek、Mistral、Llama、またはご自身で実行するローカルモデルで利用できます。

  • 必要なときだけ読み込み

    システムプロンプトには名前と説明だけが含まれます。関連するリクエストが初めてあったときに指示を取得するため、スキルを使わない間は指示の読み込みにトークンを消費しません。

  • チャットの途中でモデルを切り替え

    スキルはコードではなく指示なので、モデルを切り替えてもそのまま使えます。次のモデルも同じSKILL.mdを読み込みます。

スキルの指示

モデルが読み込むSKILL.mdの内容です。スキルはモデルが従う指示なので、インストールする前に確認してください。

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:

同梱ファイル

スキルが読み込まれている間、モデルは必要に応じてこれらを読み取ります。読み取り可能なファイルとして提供され、実行されることはありません。

よくある質問

AIスキル「K8s Storage Troubleshooting」では何ができますか?

Kubernetesのストレージがワークロードを妨げている場合に使用します。PersistentVolumeClaimがPendingのまま、ProvisioningFailedイベント、存在しないStorageClass、または要求されたアクセスモードを提供できないプロビジョナー、Podが「unbound immediate PersistentVolumeClaims」でPendingになる、FailedAttachVolume、FailedMount、Multi-Attachエラー、PVCまたはPVがTerminatingまたはReleasedのまま、ボリュームの容量不足、または拡張できない場合が対象です。kubectl get、describe、eventsを使って調査し、対処方法を提案します。まず読み取り専用で調査し、変更する前に確認を求めます。

TypingMindでK8s Storage Troubleshootingを使うメリットは何ですか?

一度インストールすれば、どのモデルでも使えるからです。K8s Storage Troubleshootingはプロバイダー固有のコードではなく、通常のMarkdownで記述されているため、同じスキルをGPT-5、Claude、Gemini、Grok、ローカルモデルで利用できます。チャットの途中でモデルを切り替えても、そのまま使い続けられます。TypingMindは自分のAPIキーで動作するため、シート単位のサブスクリプションではなく、プロバイダーに直接料金を支払います。スキルとチャットは自分のストレージに保持されます。

TypingMindにK8s Storage Troubleshootingをインストールするにはどうすればよいですか?

TypingMindで「プラグイン」→「スキル」→「GitHubからインストール」を開き、https://github.com/k8s-servant/k8s-skills/tree/main/skills/k8s-storage-troubleshootingを貼り付けてください。TypingMindがSKILL.mdを読み込み、関連ファイルをまとめて、チャットごとに有効にできるスキルとしてインストールします。

K8s Storage Troubleshootingを使えるAIモデルはどれですか?

TypingMindに接続したどのモデルでも利用できます。AIスキルはプロバイダー固有のコードではなく、通常のMarkdownで書かれた指示です。そのため、GPT、Claude、Gemini、Grok、ローカルモデルのいずれも、リクエストの内容がこのスキルの用途に合ったときに、このスキルを読み込めます。

K8s Storage Troubleshootingで使えるAIモデルの数に制限はありますか?

数に制限はありません。スキルに対応したモデルであれば、GPT、Claude、Gemini、Grok、DeepSeek、Mistral、Llamaなど、どのモデルでもK8s Storage Troubleshootingを利用できます。すべてTypingMind上で、自分のAPIキーを使って利用できます。

AIスキル「K8s Storage Troubleshooting」は無料ですか?

はい。k8s-servantがApache-2.0ライセンスのもとでGitHubに公開しています。ご利用のAIプロバイダーに支払うのは、使用したトークンの料金だけです。

AIスキルとは何ですか?

AIスキルは、特定のタスクの実行方法をAIモデルに教える、再利用可能な指示のセットです。オープンなAgent Skills形式に従い、名前と説明を含むSKILL.mdファイルに加え、モデルが必要とするスクリプト、テンプレート、参照ファイルで構成されます。モデルはリクエストがスキルに合致したときだけ指示を読み込むため、インストール済みのスキルも、使うまでは費用がかかりません。

AIスキルは、プラグインやMCPサーバーとどう違いますか?

プラグインやMCPサーバーは、モデルが呼び出せる新しいツールを提供します。ツールとは、どこかで実行され、結果を返すコードです。一方、AIスキルは、タスクへの取り組み方、従うべき手順、望ましい出力の例といった知識や進め方をモデルに伝えます。スキルは通常のMarkdownで記述されているため、サーバー、APIキー、実行環境は不要で、どのモデルでも利用できます。

すべて見る

今すぐ自分専用のAIワークスペースを作成

ニュースレターに登録すると、新機能や今後のプレゼント企画のお知らせが届きます👇