When i did :
Kubectl top node
Cluster single node size : 4 vCPU & 16 GB Memory
in Kubernetes cluster operation logs found :
But CPU usage is 24% as showing in command output the from why am i getting this error.
above graphs showing node usage 1.5 vCPU max.
Also some of my pods continuous increasing memory and after around 24 hour time reach to memory limit and auto restart due to resource limit set.
Question :
If kubectl showing CPU usage 24% but why I am getting error in logs insufficient CPU ?
The error message you have is because there are no nodes in your cluster with enough allocatable CPU to meet the needs of the cpu request of your pod
The k8s scheduler looks at the allocatable cpu of a node minus the total cpu requested to determine if there is sufficient cpu a available to add a new pod.
Note that the allocatable or requested cpu has nothing to do with the actual amount of cpu being used on a node. The scheduler does not look at the actual node cpu usage, this is why setting accurate resource requests is important. Of your container only uses 50m cpu, don't have a request set to 200m otherwise you'll have a lot of wasted resources.
Based on the info you've provided, your cou requests are likely too high