What happens when a pod exceeds its memory limit?

0 votes
When a pod exceeds its memory limit? What happens?
Jul 19, 2019 in Kubernetes by Athira
278 views

1 answer to this question.

0 votes
  • Whenever a pod exceeds its memory limit a signal SIGKILL is sent which  immediately terminates the container and spawns a new one with OOM(out of memory) error. 

  • The OS, if using a cgroup based containerisation (docker, rkt, etc), will do the OOM killing. 

  • Kubernetes simply sets the cgroup limits but is not ultimately responsible for killing the processes.

  • 'SIGTERM ' is sent to PID 1 and k8s waits for (default of 30 seconds) `terminationGracePeriodSeconds` before sending the `SIGKILL` or you can change that time with terminationGracePeriodSeconds in the pod.

  • As long as your container will eventually exit, it should be fine to have a long grace period. If you want a graceful restart it would have to do it inside the pod. 

  • If you don't want it killed, then you shouldn't set a memory `limit` on the pod and there's not a way to disable it for the whole node. 

  • Also, when the liveness probe fails, the container will SIGTERM and SIGKILL after some grace period.

answered Jul 19, 2019 by Sirajul
• 48,770 points

Related Questions In Kubernetes

0 votes
1 answer

How to terminate a pod when a specific event occurs?

You need to add a liveness and ...READ MORE

answered Jul 19, 2019 in Kubernetes by Sirajul
• 48,770 points
67 views
0 votes
1 answer

What is Ingress ? Is it something that runs as a pod or on a pod?

An ingress is an object that holds ...READ MORE

answered Jul 19, 2019 in Kubernetes by Sirajul
• 48,770 points
101 views
0 votes
1 answer
0 votes
1 answer
0 votes
3 answers

Error while joining cluster with node

Hi Kalgi after following above steps it ...READ MORE

answered Jan 17, 2019 in Others by anonymous
4,744 views
+4 votes
1 answer

Installing Web UI (Dashboard):kubernetes-dashboard on main Ubuntu 16.04.6 LTS (Xenial Xerus) server

Follow these steps: $ kubeadm reset $ kubeadm init ...READ MORE

answered Apr 11, 2019 in Kubernetes by Kalgi
• 51,810 points

reshown Apr 12, 2019 by Kalgi 1,300 views
0 votes
1 answer

What happens when a master or worker node fails?

Whenever master node under kubernetes fails, the ...READ MORE

answered Jul 15, 2019 in Kubernetes by Sirajul
• 48,770 points
78 views
0 votes
1 answer

Is there a way to make a pod to automatically come up when the host restarts?

Yes using replication controller but it may ...READ MORE

answered Jul 19, 2019 in Kubernetes by Sirajul
• 48,770 points
118 views