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
7,872 views

1 answer to this question.

+1 vote
  • 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
• 59,230 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
• 59,230 points
1,180 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
• 59,230 points
1,902 views
+1 vote
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
15,477 views
+15 votes
2 answers

Git management technique when there are multiple customers and need multiple customization?

Consider this - In 'extended' Git-Flow, (Git-Multi-Flow, ...READ MORE

answered Mar 27, 2018 in DevOps & Agile by DragonLord999
• 8,450 points
4,035 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
• 59,230 points
4,374 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
• 59,230 points
2,411 views
webinar REGISTER FOR FREE WEBINAR X
REGISTER NOW
webinar_success Thank you for registering Join Edureka Meetup community for 100+ Free Webinars each month JOIN MEETUP GROUP