Kubernetes : simultaneously executing two comands in kubernetes

12/4/2020

I know that it is possible to execute multiple commands simultaneously in Kubernetes. I've seen Multiple commands in kubernetes. But what I wanted to know is to execute multiple commands simultaneously.

command: ["/bin/sh","-c"]
args: ["command one; command two"]

Here both command one and command two execute parallel.

As command one starts a server instance and similarly command two start another server.

In my docker environment I have specified one command and then I exec int docker and start another command. But in k8s deployment it won't be possible. What should I do in this situation?

I will be using helm chart, so if there is any trick related to helm charts. I can use that as well.

-- Pranjal Doshi
docker
kubernetes
kubernetes-helm

1 Answer

12/6/2020

Fully agree with @David Maze and @masseyb. Writing answer as community wiki just to index this answer for future researches. You are not able to execute simultaneously multiple commands. You should create few similar but separate deployments and use there different commands.

-- Vit
Source: StackOverflow