Replicas in Tekton

5/31/2021

I am quite new to Tekton.

I am facing an issue currently - replication of pods using tekton.

What I want to achieve?

  • I want to create a pipeline with two tasks.
  • First task creates an echo hello pod
  • Second task creates an echo goodbye pod.
  • Both pods needs to have 2 replicas.

Error - unknown field "replicas" while running the tasks or pipeline.

I have tried to add replicas in spec section for both tasks and pipeline, but it does not work. Any idea where I went wrong?

Here is my script - First task -

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

Second Task

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

Pipeline script -

kind: Pipeline
metadata:
  name: hello-goodbye
spec:
  replicas: 2
  tasks:
  - name: hello
    taskRef:
      name: hello
  - name: goodbye
    runAfter:
     - hello
    taskRef:
      name: goodbye
-- Shresth Suman
kubernetes
replicaset
replication
tekton

1 Answer

5/31/2021

There is no such thing as "replicas" in Tekton Pipelines.

A Tekton Pipeline is a pipeline of Tasks that execute in a directed acyclic graph.

-- Jonas
Source: StackOverflow