I want to run multiple python scripts with passing arguments to the python script, how I can do that? Is it possible in Kubernetes?
Like I have multiple python scripts with different inputs: "./main.py", "1" , "./main2.py", "2", "./main3.py", "3"
I can not put all of them in one file to run need to run them separately here, is there any way to do that?
kind: Pod
metadata:
name: hello-world
spec: # specification of the pod’s contents
restartPolicy: Never
containers:
- name: hello
image: "ubuntu:14.04"
env:
- name: MESSAGE
value: "hello world"
command: [ "python" ]
args: [ "./main.py", "1" ]
2
Answers
can you try as shown below
There can only be a single entrypoint in a container… if you want to run multiple commands like that, make bash be the entry point, and make all the other commands be an argument for bash to run:
or you can run multiple containers in one pod: