如何在kubernetes中的config.yaml中设置多个命令?

时间:2019-03-07 13:36:33

标签: bash kubernetes

我尝试使用此question中接受的答案,但应用此错误时看到以下错误:

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

1 个答案:

答案 0 :(得分:0)

请尝试这样:

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;