Tekton 中的副本

问题描述

我对 Tekton 很陌生。

我目前面临一个问题 - 使用 tekton 复制 pod。

我想达到什么目标?

  • 我想创建一个包含两个任务的管道。
  • 一个任务创建一个 echo hello pod
  • 第二个任务是创建一个 echo goodbye pod。
  • 两个 Pod 都需要有 2 个副本。

错误 - 运行任务或管道时未知字段“副本”。

我尝试在规范部分为任务和管道添加副本,但它不起作用。 知道我哪里出错了吗?

这是我的脚本 - 第一个任务-

kind: Task
Metadata:
  name: hello
spec:
  replicas: 2
  steps:
    - name: hello
      image: ubuntu
      command:
        - echo
      args:
        - "Hello World!"

第二个任务

kind: Task
Metadata:
  name: goodbye
spec:
  replicas: 2
  steps:
    - name: goodbye
      image: ubuntu
      script: |
        #!/bin/bash
        echo "Goodbye World!"

管道脚本-

kind: Pipeline
Metadata:
  name: hello-goodbye
spec:
  replicas: 2
  tasks:
  - name: hello
    taskRef:
      name: hello
  - name: goodbye
    runAfter:
     - hello
    taskRef:
      name: goodbye

解决方法

Tekton Pipelines 中没有“副本”这样的东西。

Tekton 管道是在 directed acyclic graph 中执行的任务管道。