This knowledge base article outlines common CPU-related issues encountered in TKG environments and provides troubleshooting steps to diagnose and resolve them.
2.x, 3.x
kubectl top pods -n <namespace>
: This command shows CPU and memory usage for pods in a specific namespace. Identify pods with consistently high CPU usage or that are experiencing throttling.
kubectl describe pod <pod-name> -n <namespace>
: Examine the pod's details, including resource requests and limits, events, and container status. Look for warnings or errors related to CPU.
kubectl top pods -n <namespace>
: Observe the CPU usage and compare it to the CPU limits defined for the pod. If the usage is consistently close to or exceeding the limit, throttling is likely occurring. kubectl describe pod <pod-name> -n <namespace>:
Look for events related to CPU throttling. Kubernetes will often log events when a pod is being throttled.kubectl exec -it <pod-name> -n <namespace> -- bash
: Enter the container and use tools like top, htop, or perf to identify the processes consuming the most CPU.kubectl describe pod <pod-name> -n <namespace>
: Review the pod's resource requests and limits in the pod specification. kubectl top nodes
: This command shows CPU and memory usage for all nodes in the cluster. Identify nodes with consistently high CPU utilization. kubectl describe resourcequota <resource-quota-name> -n <namespace>
: Check if resource quotas are in place and if they are limiting the CPU resources available to the namespace.