How do I set multiple commands in config.yaml in kubernetes?

3/7/2019

I tried to use the accepted answer from this question, but I see the following error when I apply it:

containers:
  - name: service
    command: ["/bin/sh", "-c"]
    args: ["echo 123; my_executable_binary"]
/bin/sh: 0: -c requires an argument
-- Alex
bash
kubernetes

1 Answer

3/7/2019

Please try like this:

containers:
  - name: appname-service
    image: path/to/registry/image-name
    ports:
        - containerPort: 1234
    command: ["/bin/sh", "-c"]
    args:
      - source /env/db_cred.env;
        application-command;
-- Nepomucen
Source: StackOverflow