dot_config/opencode/skills/debugging-k8s-storage/SKILL.md
Debugs Kubernetes storage issues including PVC stuck in Pending, PV binding failures, volume mount errors, and StorageClass problems. Use when volumes fail to mount, PVCs not binding, or storage-related pod failures.
npx skillsauth add rio/dotfiles debugging-k8s-storageInstall this skill globally with one command. Works with Claude Code, Cursor, and Windsurf.
3 of 9 scanners reported clean
Some scanners were skipped, did not run, or reported a non-clean status. Review each row below.
Investigates PersistentVolumeClaim, PersistentVolume, and mount issues.
| Symptom | Likely Cause | First Check | |---------|-------------|-------------| | PVC Pending | No matching PV, StorageClass issue | PVC events | | Mount failed | PV not available, node issue | Pod events | | Multi-attach error | RWO volume on multiple nodes | Access mode | | Permission denied | fsGroup/runAsUser mismatch | Security context |
# List PVCs
kubectl get pvc -n <ns>
# Detailed PVC info
kubectl describe pvc <pvc> -n <ns>
PVC Pending? Check Events section for reason.
# List PVs
kubectl get pv
# Check PV details
kubectl describe pv <pv-name>
PVC binds to PV when:
# List StorageClasses
kubectl get storageclass
# Check default StorageClass
kubectl get storageclass -o jsonpath='{range .items[?(@.metadata.annotations.storageclass\.kubernetes\.io/is-default-class=="true")]}{.metadata.name}{end}'
# StorageClass details
kubectl describe storageclass <name>
# Pod events show mount failures
kubectl describe pod <pod> -n <ns> | grep -A10 "Events:"
# Events for PVC
kubectl get events -n <ns> --field-selector involvedObject.name=<pvc>
Common reasons:
# Check what the PVC is requesting
kubectl get pvc <pvc> -n <ns> -o yaml | grep -A5 "spec:"
# Check events for provisioning errors
kubectl describe pvc <pvc> -n <ns> | grep -A10 "Events:"
# Check access mode (RWO = ReadWriteOnce = single node)
kubectl get pvc <pvc> -n <ns> -o jsonpath='{.spec.accessModes}'
# Check which node has the volume
kubectl get pod -n <ns> -o wide
RWO volumes can only attach to one node. If pods are on different nodes, one will fail.
Options:
# Check node where pod is scheduled
kubectl get pod <pod> -n <ns> -o jsonpath='{.spec.nodeName}'
# Check node conditions
kubectl describe node <node> | grep -A5 "Conditions:"
May indicate:
# Check pod security context
kubectl get pod <pod> -n <ns> -o jsonpath='{.spec.securityContext}'
# Check container security context
kubectl get pod <pod> -n <ns> -o jsonpath='{.spec.containers[*].securityContext}'
Fix with fsGroup or runAsUser in pod spec.
# Overview of all PVC/PV
kubectl get pvc,pv -A
# Check CSI drivers (if using CSI)
kubectl get csidrivers
# Storage-related events
kubectl get events -A --field-selector reason=FailedMount
kubectl get events -A --field-selector reason=FailedAttachVolume
| Mode | Short | Description | |------|-------|-------------| | ReadWriteOnce | RWO | Single node read-write | | ReadOnlyMany | ROX | Multiple nodes read-only | | ReadWriteMany | RWX | Multiple nodes read-write | | ReadWriteOncePod | RWOP | Single pod read-write |
debugging-k8s-pods if pod has other issues besides storageanalyzing-k8s-events for storage event timelinedocumentation
Compact the current conversation into a handoff document for another agent to pick up.
development
Create new agent skills with proper structure, progressive disclosure, and bundled resources. Use when user wants to create, write, or build a new skill.
testing
Interview the user relentlessly about a plan or design until reaching shared understanding, resolving each branch of the decision tree. Use when user wants to stress-test a plan, get grilled on their design, or mentions "grill me".
development
Retrieves Kubernetes container logs with various patterns including multi-container pods, previous container logs, init containers, and label-based aggregation. Use when checking application logs, debugging crashes, or analyzing container output.