Is it more resource efficient to have to Pods, or two containers in one Pod?

10/22/2020

I have test environment where HA is not important but rather resources efficiency, so would you recommend in that regard to create one Pod with multiple containers where it make sense of course, where containers are tight coupled or to have one Pod for every service? Does this have any impact on resources at all?

I will give an example if for instance I have php application, and then nginx proxy and then filebeat service that is listening logs, what would be better to have 3 pods for this 3 things or one pod with 3 containers. And when I say better I mean to use less memory, cpu, etc.

-- Most31
containers
kubernetes
kubernetes-pod

1 Answer

10/23/2020

The difference between both solutions should not be significant (negligible ?). However, depending on your approach, the management effort might be quite significantly different.

With one component in a dedicated pod you need to somehow synchronise live cycle of all pods (php + nginx + filebeat) whenever you spin just one, new application up.

With all of them in one pod you just need to create/delete one pod.

-- pb100
Source: StackOverflow