首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >Kubernetes Argo按步骤提交参数

Kubernetes Argo按步骤提交参数
EN

Stack Overflow用户
提问于 2019-06-11 15:52:16
回答 1查看 5.1K关注 0票数 3

我正在遵循Argo GitHub上的示例,但是当我将模板移动到步骤时,我无法更改消息的参数。

代码语言:javascript
复制
apiVersion: argoproj.io/v1alpha1
kind: Workflow
metadata:
  generateName: hello-world-parameters-
spec:
 # invoke the whalesay template with
 # "hello world" as the argument
 # to the message parameter
 entrypoint: entry-point

  templates:
  - name: entry-point
  steps:
    - - name: print-message
        template: whalesay
        arguments:
          parameters:
          - name: message
            value: hello world



 - name: whalesay
   inputs:
     parameters:
     - name: message       # parameter declaration
    container:
    # run cowsay with that message input parameter as args
    image: docker/whalesay
    command: [cowsay]
    args: ["{{inputs.parameters.message}}"]

如果我使用以下命令提交工作流:

代码语言:javascript
复制
argo submit .\workflow.yml -p message="goodbye world"

它仍然打印出你的世界而不是再见的世界。不知道为什么

EN

回答 1

Stack Overflow用户

回答已采纳

发布于 2019-06-14 05:40:16

-p参数设置工作流规范的arguments字段中定义的全局工作流参数。更多信息可用这里。要使用全局参数,您的工作流应该更改如下:

代码语言:javascript
复制
apiVersion: argoproj.io/v1alpha1
kind: Workflow
metadata:
  generateName: hello-world-parameters-
spec:
  # invoke the whalesay template with
  # "hello world" as the argument
  # to the message parameter
  entrypoint: entry-point
  arguments:
    parameters:
    - name: message
      value: hello world

  templates:
  - name: entry-point
    steps:
    - - name: print-message
        template: whalesay
        arguments:
          parameters:
          - name: message
            value: "{{workflow.parameters.message}}"
  - name: whalesay
    inputs:
      parameters:
       - name: message       # parameter declaration
    container:
      # run cowsay with that message input parameter as args
      image: docker/whalesay
      command: [cowsay]
      args: ["{{inputs.parameters.message}}"]
票数 9
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/56547512

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档