How to create a container inside pod explicitly?

In a kubernetes cluster"s pod there are 2 container in running state and the pod is configured auto-scale. Now I want to create a another container inside the same pod with the same image that both running container have explicitly while don’t stopping the running container.

How can I acheive this?

Cluster information:

Kubernetes version: 1.14
Cloud being used: (put bare-metal if not on a public cloud) : Google
Host OS: Debian

As far as I know adding a container to a pod like that without reloading the pod is not possible. You could call on the docker daemon to run a container within the pod but I am not sure that would have the effect you are looking for (Docker in Docker).

It would be good to know more about what you are try to do to give you a better answer.

If you want to do that to scale your app, then you want to create a new pod not a new container on the running pod. If you create a new pod traffic will be load balancer by the service you use to expose them.

If you want to change the pod definition (like add a container) there is no other way that killing the old one and creating a new one (as a deployment would do). You can’t modify a running pod.