Pipeline: TaskRuns are removed immediately

Created on 2 Sep 2020  路  7Comments  路  Source: tektoncd/pipeline

Expected Behavior

taskRuns triggered by the dashboard or triggers are executed normally

Actual Behavior

taskRuns triggered by the dashboard or triggers are removed immediately

Steps to Reproduce the Problem

  1. Add a simple task like this:
apiVersion: tekton.dev/v1beta1
kind: Task
metadata:
  name: echo-hello-world
spec:
  steps:
    - name: echo
      image: ubuntu
      command:
        - echo
      args:
        - "Hello World"
    - name: wait
      image: ubuntu
      command:
        - sleep
      args:
        - "15"
    - name: echo-again
      image: ubuntu
      command:
        - echo
      args:
        - "Hello World"
  1. This can be triggered just fine using a TaskRun Resource:
apiVersion: tekton.dev/v1beta1
kind: TaskRun
metadata:
  name: echo-hello-world-task-run
spec:
  taskRef:
    name: echo-hello-world
  1. I am not able to run this task using the dashboard (or a tekton-trigger), the pod is created and immediately removed without running till successful.
    image

I once saw an error message before the pod was removed:
Error: failed to start container "step-echo-again": Error response from daemon: cannot join network of a non running container: 5962ccec46195bdedab392170bdaefc82b96a9a42a1583003b3331a8bd07b9bf

  1. Here a link to the TaskRun Resource diff between the dashboard resource and the one created by the yaml above:
    https://www.diffchecker.com/WCadAgjT

  2. The resources which were created via yaml are applied using argo-cd if this could lead to any problems??

Additional Info

  • Kubernetes version:
Client Version: version.Info{Major:"1", Minor:"16+", GitVersion:"v1.16.6-beta.0", GitCommit:"e7f962ba86f4ce7033828210ca3556393c377bcc", GitTreeState:"clean", BuildDate:"2020-01-15T08:26:26Z", GoVersion:"go1.13.5", Compiler:"gc", Platform:"linux/amd64"}
Server Version: version.Info{Major:"1", Minor:"18", GitVersion:"v1.18.3", GitCommit:"2e7996e3e2712684bc73f0dec0200d64eec7fe40", GitTreeState:"clean", BuildDate:"2020-05-20T12:43:34Z", GoVersion:"go1.13.9", Compiler:"gc", Platform:"linux/amd64"}
  • Tekton Pipeline version:
Client version: 0.12.0
Pipeline version: v0.15.2
Triggers version: v0.7.0
kinbug

All 7 comments

I have exactly the same issue, with the same versions and I also use argocd.

For me, it appears that it was argo-CD that had an auto-sync policy which was enabled on the tekton-pipelines application. Disabling auto-sync solved the issue.

Screen Shot 2020-09-02 at 10 58 47 AM

=>

Screen Shot 2020-09-02 at 11 08 48 AM

Then:

Screen Shot 2020-09-02 at 10 51 21 AM

Screen Shot 2020-09-02 at 10 58 59 AM

@idrissneumann : you are right, the problem was argocd and not tekton. Thank you!
And closing this issue as it is not related to tekton.

@idrissneumann if you add the following annotations to the task you can keep all automated including pruning and argocd will ignore the taskRuns and the appliacation will stay healthy:

    argocd.argoproj.io/sync-options: Prune=false
    argocd.argoproj.io/compare-options: IgnoreExtraneous

@sadoMasupilami Thanks, I'll try. It will probably be better than disable the auto-sync completely.

@idrissneumann and even better add this to the argocd-cm configmap:

  resource.exclusions: |-
    - apiGroups:
      - tekton.dev
      kinds:
      - TaskRun
      clusters:
      - "*"

the same should be done for pipeline runs i guess

good luck :-)

It works like a charm, thanks !

Was this page helpful?
0 / 5 - 0 ratings