I tried kubectl get pod my-pod-id -o yaml but only see data on cpu limits/requests. How can I see how much memory is allocated? I did not specify this in my deployment yaml, so this is a default value.
resources:
limits:
cpu: "1"
requests:
cpu: 100m
1 Like
There shouldn’t be a default out of the box for resource limits, if there was a memory limit in place it would be there too.
Has someone set up a range limit for that namespace?
kubectl get limitrange
edit: assuming vanilla k8s not a managed solution like, Openshift, Rancher or GKE, etc
Thank you. OK, there is no default, but how do I see the RAM limit of this specific pod? Certainly at some point it would hit a limit?
So … I am looking for some some sort of “read configuration” command where kubectl get pod my-pod-id -o yaml did not do the trick.
(limitrange shows nothing interesting
$ kubectl get limitrange
NAME AGE
limits 125d
)
(Using GKE.)
Unless you set the memory limit explicitly then one should not exist.
My guess is the limits limitrange has the CPU limits you are seeing in it. You can take a look by running kubectl describe limitrange limits
If any RAM limits were set they would appear with the command you ran to see the CPU limits.
Given that you have a limitrange resource called limits, I agree with @macintoshprime that is adding CPU limits and requests, but not memory limits nor requests. Therefore, your pod will have all of the memory on the node not already reserved for kubernetes services or other pods (pods with memory.requests) available for its use, however it may be evicted from the node if another pod needs memory it is using because you have no memory.requests set for your pod and no priority class set to prevent it from being preempted. The scheduler may or may not be able to schedule this pod to another node if that happens.
In summary, this pod has no direct memory limits; and is able to use as much or as little memory as it wants, up to what the node can support.