Quantcast
Channel: Active questions tagged tekton - Stack Overflow
Viewing all articles
Browse latest Browse all 53

Tekton cli (in POD): cannot find existing pipeline

$
0
0

Running a 'tkn' command in a deployed pod wil result in the error message that it cannot find the pipeline in namespace 'test'.

The deployment:

apiVersion: apps/v1kind: Deploymentmetadata:  name: tkncli  namespace: testspec:  replicas: 1  selector:    matchLabels:      app: tkncli  template:    metadata:      labels:        app: tkncli    spec:      containers:        - name: tkncli          image: quay.io/rhcanada/tkn-cli          imagePullPolicy: IfNotPresent          command:            - tkn          args:            - -n            - test            - pipeline            - start            - postsync-pipeline            - --param            - pause-duration="2"

The error message:

Error: Pipeline name postsync-pipeline does not exist in namespace test.

Are these resources really missing? Nope.

$ k get pipeline -n testNAME AGEpostsync-pipeline 24m$ k get task -n testNAME AGEpostsync-task 12m

I replaced the Docker container with a more official one using this Dockerfile. Same result.

I can start the pipeline with this command:

$ tkn -n test pipeline start postsync-pipeline --parampause-duration="2" --showlog

The result is:

PipelineRun started: postsync-pipeline-run-jzfvfWaiting for logs to be available...[first-task : say-it] Text one[second-task : say-it] Text two

How to reproduce?

  1. Add the K8s resource: deployment - see above.
  2. Add the K8s resources: pipeline and task - see below.

The pipeline:

apiVersion: tekton.dev/v1beta1kind: Pipelinemetadata:  name: postsync-pipeline  namespace: testspec:  params:    - name: pause-duration      description: uitstellen voor starten      type: string      default: "2"  tasks:    - name: first-task      taskRef:        name: postsync-task      params:        - name: pause-duration          value: $(params.pause-duration)        - name: say-what          value: "Text one"    - name: second-task      taskRef:        name: postsync-task      params:        - name: pause-duration          value: $(params.pause-duration)        - name: say-what          value: "Text two"

The Task:

apiVersion: tekton.dev/v1beta1kind: Taskmetadata:  name: postsync-task  namespace: testspec:  params:    - name: pause-duration      description: How long to wait before saying something      default: "0"      type: string    - name: say-what      description: What should I say      default: hello      type: string  steps:    - name: say-it      image: registry.access.redhat.com/ubi8/ubi      command:        - /bin/bash      args: ['-c', 'sleep $(params.pause-duration) && echo $(params.say-what)']

When even further simplifying the situation, (1) with the default namespace, (2) an rbac serviceaccount and (3) just a 'pipeline ls' I get this error:

Error: Couldn't get kubeConfiguration namespace: invalidconfiguration: no configuration has been provided, try settingKUBERNETES_MASTER environment variable


Viewing all articles
Browse latest Browse all 53

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>