Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Tkn (in POD) cannot find pipeline resources although they exist #2198

Open
johan974 opened this issue Dec 20, 2023 · 1 comment
Open

Tkn (in POD) cannot find pipeline resources although they exist #2198

johan974 opened this issue Dec 20, 2023 · 1 comment
Labels
kind/bug Categorizes issue or PR as related to a bug.

Comments

@johan974
Copy link

johan974 commented Dec 20, 2023

Expected Behavior

When starting the tkn at the command line for starting a pipeline in the test namespace, everything is ok.
The command is:

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

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

Actual Behavior

When running the tkn within a seperate POD, I get this error message:

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

What is the Deployment? Notice that I also tried the official Docker image (based on this file Dockerfile ).

apiVersion: apps/v1
kind: Deployment
metadata:
  name: tkncli
  namespace: test
spec:
  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"

OK, what about the resources, are they really in the test namespace? Yes.

$ k get pipeline -n test
NAME                AGE
postsync-pipeline   24m

$ k get task -n test
NAME            AGE
postsync-task   12m

I also tried to leave the namespace out of the Deployment. No change.

Some further info:

  • Kubernetes version: v1.28.2

  • Tekton Pipeline version: v0.53.0

  • Operating System: Win 11, Docker Desktop envir.

Steps to Reproduce the Problem

  1. k apply the 3 files: deployment (above) and the pipeline and task below.
  2. You will see in the POD log the error message.

Additional Info

The pipeline:

apiVersion: tekton.dev/v1beta1
kind: Pipeline
metadata:
  name: postsync-pipeline
spec:
  params:
    - name: pause-duration
      description: pause interval
      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/v1beta1
kind: Task
metadata:
  name: postsync-task
spec:
  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)']
@johan974 johan974 added the kind/bug Categorizes issue or PR as related to a bug. label Dec 20, 2023
@vinamra28
Copy link
Member

@johan974, was your RBAC in place?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind/bug Categorizes issue or PR as related to a bug.
Projects
None yet
Development

No branches or pull requests

2 participants