/k8s-skills:k8s-aks-troubleshootingfrom k8s-skills
Investigates and proposes fixes for AKS-specific failures: cluster/node pool states, failed upgrades/scales, stuck LoadBalancer Services, PVC provisioning, workload identity errors, CoreDNS reverts, and API server access issues. Uses kubectl and read-only az commands.
Ships in k8s-skills. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
Read when SKILL.md points to them.
Find out why something that depends on Azure fails in an AKS cluster, and propose a fix.
Read first, ask before changing. Run the investigation commands freely: kubectl reads
and the read-only az commands below (show, list, get). 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.
Every az change (update, upgrade, role assignments, anything that writes) is a proposed
fix.
An AKS cluster lives in two places. Kubernetes objects are in the cluster; the cluster
itself, its node pools (virtual machine scale sets), load balancers, public IPs, disks
and identities are Azure resources. The cluster resource is in the user's resource group;
the resources AKS manages for it are in a separate node resource group (by default
MC_<resource group>_<cluster>_<region>). Many AKS failures show in Kubernetes only as a
short event, while the real error is in Azure: in the cluster's provisioningState, in
the latest operation, or in the activity log.
The commands use placeholders: my-resource-group and my-cluster (the cluster),
my-node-resource-group, my-nodepool, my-namespace, my-app, my-pvc, my-pod,
my-node and my-identity. Replace them with the real names. The az commands need an
Azure CLI login (az account show tells which subscription it uses). Never read Secrets,
and do not print tokens, keys or client secrets from any source.
Failed, or an upgrade, scale or update failed.EXTERNAL-IP, or traffic through it fails.Pending, or a pod cannot mount it.coredns ConfigMap disappears, kubectl logs or exec fail with
error dialing backend, or Azure Policy denies a pod.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:
k8s-workload-troubleshooting. A node that is NotReady or full, or pods that do not
fit: k8s-node-troubleshooting.k8s-storage-troubleshooting.k8s-network-troubleshooting. The
Corefile itself: k8s-coredns-troubleshooting.Forbidden that comes from Kubernetes RBAC (no Azure suffix):
k8s-rbac-troubleshooting. Webhook or admission errors that are not Azure Policy:
k8s-api-troubleshooting; Gatekeeper constraints themselves:
k8s-gatekeeper-troubleshooting.k8s-upgrade-readiness.1. Find the cluster and its state. If the user did not name it, list the clusters the login can see, then read the one in question:
az aks list -o table
az aks show -g my-resource-group -n my-cluster --query "{state:provisioningState, power:powerState.code, version:kubernetesVersion, nodeResourceGroup:nodeResourceGroup, network:networkProfile.networkPlugin, networkMode:networkProfile.networkPluginMode, outbound:networkProfile.outboundType, private:apiServerAccessProfile.enablePrivateCluster, authorizedIpRanges:apiServerAccessProfile.authorizedIpRanges, azureRbac:aadProfile.enableAzureRbac, localAccountsDisabled:disableLocalAccounts, oidcIssuer:oidcIssuerProfile.issuerUrl, workloadIdentity:securityProfile.workloadIdentity.enabled}" -o json
2. Node pools and recent operations. A Failed state is about the last operation, not
the running workloads:
az aks nodepool list -g my-resource-group --cluster-name my-cluster --query "[].{name:name, mode:mode, state:provisioningState, power:powerState.code, count:count, min:minCount, max:maxCount, autoscale:enableAutoScaling, vmSize:vmSize, zones:availabilityZones, version:currentOrchestratorVersion, maxSurge:upgradeSettings.maxSurge}" -o table
az monitor activity-log list -g my-resource-group --offset 3d --status Failed --query "[].{time:eventTimestamp, operation:operationName.value, status:status.value, message:properties.statusMessage}" -o json
az aks operation show-latest -g my-resource-group -n my-cluster
az aks operation show-latest needs the aks-preview extension; if it is missing, the
activity log has the same error.
3. The Kubernetes side.
kubectl get nodes -L kubernetes.azure.com/agentpool,topology.kubernetes.io/zone,node.kubernetes.io/instance-type
kubectl events -A --types=Warning
kubectl get pods -n kube-system -o wide
4. Follow the symptom to its reference, which has the commands for that area:
| Symptom | Read |
|---|---|
Cluster or node pool Failed, upgrade or scale errors, quota and VM capacity, autoscaler, node auto-repair, versions | references/nodepools-upgrades.md |
LoadBalancer Service <pending> or unreachable, SyncLoadBalancerFailed, static IPs, internal load balancers, health probes, SNAT | references/load-balancers.md |
Azure Disk or Azure Files PVC Pending or not mounting, zones, attach limits; workload identity and AADSTS errors | references/storage-identity.md |
CoreDNS customization, error dialing backend, Azure Policy, other managed add-ons; API server reachability, Entra ID login, Azure RBAC | references/addons-access.md |
provisioningState is Failed while nodes and pods run normally: the last Azure
operation on the cluster failed; the cluster itself usually keeps working. The activity
log's statusMessage names the cause, often nested: an outer code such as
ResourceOperationFailure, UpgradeVMSSAgentPoolFailed or CreateOrUpdateExtensionFailed
wraps the real one in details. Update failed for this resource, as there is a conflicting operation in progress means two operations overlapped (for example an
add-on update during a scale); nothing else needs fixing. Fix the real cause first, then
reconcile the cluster (see Proposed fix). A reconcile does not fix an unresolved quota,
policy, network or capacity error.(UpgradeFailed) Drain node ... failed when evicting pod ... Cannot evict pod as it would violate the pod's disruption budget: a PodDisruptionBudget allows 0
disruptions; see references/nodepools-upgrades.md.QuotaExceeded, AllocationFailed, ZonalAllocationFailed,
SkuNotAvailable: Azure could not create the virtual machines, the subscription's
quota or the region's capacity, not Kubernetes.<pending> with SyncLoadBalancerFailed: the event's
message is the Azure error from the cloud provider. AuthorizationFailed ... does not have authorization to perform action 'Microsoft.Network/virtualNetworks/subnets/read' over scope '.../subnets/my-subnet' or the scope is invalid on an internal load
balancer usually means that subnet does not exist (a typo in
azure-load-balancer-internal-subnet): the cluster identity can read only the subnets
it was granted, so a missing one looks like missing permission. Check the subnet exists
before granting any role.Pending with ProvisioningFailed ... RESPONSE 400 ... InvalidParameter: Azure
refused the disk itself, for example The value 40960 of parameter 'disk.diskSizeGb' is out of range. The value must be between '1' and '32767', inclusive. (an Azure Disk is
at most 32 TiB). The message after ERROR CODE is Azure's; the rest is the CSI driver.AADSTS700016: Application with identifier '<client ID>' was not found in the directory: the client ID in the ServiceAccount annotation
azure.workload.identity/client-id belongs to no identity in that tenant. AADSTS70021: No matching federated identity record found for presented assertion: the identity
exists, but no federated credential matches the token's issuer and subject
(system:serviceaccount:my-namespace:my-app). See
references/storage-identity.md.Error from server: error dialing backend: dial tcp <node ip>:10250: i/o timeout on
kubectl logs or exec, while get works: the API server cannot reach the kubelet
through the konnectivity tunnel; see
references/addons-access.md.... User does not have access to the resource in Azure. Update role assignment to allow access.: the cluster uses Azure RBAC for Kubernetes, and the caller's Azure role
assignments, not Kubernetes RoleBindings, decide.Show each fix to the user before running it: what it changes and how to undo it. Every change to an Azure resource is a proposed fix the user runs; make it in the cluster's source of truth (Bicep, Terraform, ARM templates, a pipeline) when there is one, since a later deployment would undo a change made by hand. Kubernetes objects such as Services, PVCs and ServiceAccounts belong in the workload's manifests or chart.
After the cause of a Failed state is fixed, a reconcile re-applies the cluster's current
configuration without changing it:
Proposed fix: review before running. The agent does not run this.
az aks update -g my-resource-group -n my-cluster --yes
# Undo: none needed; it re-applies the existing configuration
For a node pool in Failed:
Proposed fix: review before running. The agent does not run this.
az aks nodepool update -g my-resource-group --cluster-name my-cluster -n my-nodepool
# Undo: none needed; it re-applies the existing node pool configuration
Never start another operation while one is still running (az aks operation show-latest
shows InProgress), and never edit the scale sets, load balancers or disks in the node
resource group by hand: AKS owns them, reverts such changes, and they are not supported.
The fixes for each area, with their undo, are in the references.
Checked against AKS with Kubernetes 1.33 (a private cluster with Azure CNI, Entra ID and Azure RBAC, workload identity and the Azure Policy add-on) and the Microsoft Learn pages below, as of October 2026:
AuthorizationFailed
for a missing subnet, the Azure Disk InvalidParameter size error, AADSTS700016 from
a workload identity pod, and a Failed cluster after CreateOrUpdateExtensionFailed
with conflicting operation in progress.What SKILL.md sets; muted values are Claude Code's defaults
Three short reads, in order
npx claudepluginhub k8s-servant/k8s-skills --plugin k8s-skills31 skills in this plugin
/k8s-api-troubleshootingUse when the Kubernetes API server itself refuses or fails a request, before any controller acts on it: "failed calling webhook", "admission webhook ... denied the request", "ValidatingAdmissionPolicy ... denied request", a ReplicaSet with FailedCreate and no pods, an APIService "False (ServiceNotFound)", "FailedDiscoveryCheck" or "MissingEndpoints", "unable to retrieve the complete list of server APIs", a namespace stuck in Terminating, "no matches for kind" or "ensure CRDs are installed first", "strict decoding error: unknown field", a conversion webhook failure, "You must be logged in to the server (Unauthorized)", 429 "too many requests", "etcdserver:" errors, "Request entity too large" or "metadata.annotations: Too long". Investigates with kubectl get, describe, events and the health endpoints, and proposes fixes. Reads first and asks before changing anything./k8s-argocd-troubleshootingUse when Argo CD does not deploy or update an application in Kubernetes: an Application that is OutOfSync, Unknown, Degraded, Missing or Progressing, a ComparisonError ("app path does not exist", "unable to resolve ... to a commit SHA"), an InvalidSpecError ("do not match any of the allowed destinations in project"), a sync that fails ("one or more objects failed to apply"), auto-sync that never runs, resources that stay OutOfSync after a sync, or ApplicationSets that generate nothing. Investigates with kubectl get, describe, events and logs, and proposes fixes. Reads first and asks before changing anything./k8s-autoscaling-troubleshootingUse when Kubernetes autoscaling does not scale as expected: a HorizontalPodAutoscaler whose TARGETS show "<unknown>", "missing request for cpu", "unable to get metrics for resource cpu" or "FailedGetResourceMetric", an HPA stuck at maxReplicas ("TooManyReplicas") or not scaling down, "Metrics API not available" from kubectl top, metrics-server not Ready, a KEDA ScaledObject that is not Ready ("ScaledObjectCheckFailed") or creates no HPA, KEDA scalers failing, two autoscalers on one workload, or a VerticalPodAutoscaler without recommendations. Investigates with kubectl get, describe, events, logs and top, and proposes fixes. Reads first and asks before changing anything./k8s-cert-manager-troubleshootingUse when cert-manager does not issue or renew a certificate in Kubernetes: a Certificate that stays READY False, a CertificateRequest that is Pending, Denied or Failed, an Issuer or ClusterIssuer that is not Ready ("Error getting keypair for CA issuer"), "Referenced \"Issuer\" not found", ACME Orders or Challenges stuck pending (HTTP-01, DNS-01, rate limits), a certificate that expired or did not renew, or "failed calling webhook \"webhook.cert-manager.io\"" when applying resources. Investigates with kubectl get, describe, events and logs, and proposes fixes. Reads first and asks before changing anything./k8s-cilium-troubleshootingUse when networking fails on a Kubernetes cluster that runs Cilium as its CNI: traffic between pods dropped or timing out after a CiliumNetworkPolicy or CiliumClusterwideNetworkPolicy, "Policy denied" drops in Hubble, DNS that stops resolving after an egress policy, HTTP 403 "Access denied" from an L7 rule, toFQDNs rules that do not match, pods stuck ContainerCreating with "unable to connect to Cilium agent", Cilium agent or operator pods not ready, CiliumEndpoints not ready, or IPAM exhaustion. Investigates with kubectl get, describe, events and logs, asks before running cilium-dbg or hubble inside the agent, and proposes fixes. Reads first and asks before changing anything./k8s-cloudnative-pg-troubleshootingUse when a CloudNativePG (CNPG) PostgreSQL Cluster in Kubernetes is not healthy: a Cluster stuck in "Setting up primary", "Creating a new replica" or "Waiting for the instances to become active", fewer ready instances than requested, an initdb or join pod that is Pending or in CreateContainerConfigError, PVCs that stay Pending, a bootstrap Secret that is missing, a replica that cannot be scheduled (pod anti-affinity, nodeSelector, taints), "Not enough disk space", failing WAL archiving or backups (ContinuousArchiving, LastBackupSucceeded False), a failover or switchover that does not finish, "Invalid cluster definition" or "Cluster is unrecoverable", and operator errors. Investigates with kubectl get, describe, events and logs, never reading Secrets, and proposes fixes. Reads first and asks before changing anything.2 plugins in one repository ship this exact skill · first indexed Nov 1, 2026
Other plugins' skills for the same job