Is it possible to place 2 Kubernetes pods in the same network namespace?

I have this problem where: If I place 2 microservices, in 2 different pod, if I am facing a significant throughput drop compared to the micro-services running on the physical server localhost. But I want to autoscale the microservices independent of each other.

I want the 2 micro-services to be on different pods for scaling but also communicate with each other on localhost to avoid any networking overhead. I have tried using the netns and IP command but I am not able to figure out how to add the pod on Kubernetes to the network namespace.

If it is possible then how?

Cluster information:

Kubernetes version: 1.26.3
Cloud being used: Bare-Metal
Installation method: kubeadm
Host OS: Ubuntu 20.02
CNI and version: Calico

No. If you are scaling the services independent of each other, then you are not guaranteed to be 1:1. If you are not 1:1, you have to handle N:1 and 0:1 cases. If you are 1:1 then you could be in the same pod.

I’d encourage you to really understand where that performance is going.