CodexBloom - Programming Q&A Platform

Azure Kubernetes Service (AKS) - Pods implementing in Pending State Due to Resource Quota Issues

👀 Views: 98 đŸ’Ŧ Answers: 1 📅 Created: 2025-06-26
azure kubernetes aks resource-management yaml

I'm having a hard time understanding I'm sure I'm missing something obvious here, but After trying multiple solutions online, I still can't figure this out. I'm running an Azure Kubernetes Service (AKS) cluster and recently deployed a new application, but the pods are exploring in a 'Pending' state. Upon checking the status with `kubectl get pods`, I see that the output indicates insufficient resource availability. The specific behavior message states: `0/3 nodes are available: 3 Insufficient cpu, 3 Insufficient memory.` My AKS cluster has three nodes each with 2 CPUs and 8 GB of RAM. The deployment YAML file specifies resource requests and limits as follows: ```yaml apiVersion: apps/v1 kind: Deployment metadata: name: my-app spec: replicas: 3 selector: matchLabels: app: my-app template: metadata: labels: app: my-app spec: containers: - name: my-app image: myregistry.azurecr.io/my-app:latest resources: requests: memory: "4Gi" cpu: "2" limits: memory: "6Gi" cpu: "2" ``` Given that each pod requests 4Gi of memory and 2 CPUs, I suspect that the total resource requests exceed what the nodes can provide, especially since I have three replicas. I've tried scaling down the number of replicas and adjusting the memory requests to see if that would allow the pods to start, but nothing seems to work. Additionally, I checked the resource quotas applied to the namespace using `kubectl get resourcequota`, but it shows that I am well below the limits. I also verified that no other high-resource-consuming pods are running that would exhaust the cluster's capacity. How can I resolve this scenario? Are there any best practices for optimizing resource requests in AKS to prevent such situations? Any help would be greatly appreciated! Has anyone else encountered this? I've been using Yaml for about a year now. What am I doing wrong?