How to use kubernetes CMD

command: ['/bin/sh']

command:  ["rm", "-fr", "/var/lib/dbs/lost+found"]

command:
- 'sh'
- '-c'
- 'pwd'

command: ["sh", "-c", "pwd; sleep 2; pwd;"]

command: ["sh"]
args: ["-c","pwd; sleep 2; pwd;"]

If the script is very long and you want to write it into yaml file

command: ['sh']
        args:
        - "-c"
        - |
          set -ex
          if [ "$a" -eq "$b" ];then
            touch /tmp/test
          else
            echo "not eq"
          fi
Send a Message