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

Replicas field is misleading while using customresource(knative) #1019

Closed
praveen4g0 opened this issue Mar 26, 2021 · 2 comments · Fixed by #1021
Closed

Replicas field is misleading while using customresource(knative) #1019

praveen4g0 opened this issue Mar 26, 2021 · 2 comments · Fixed by #1021
Assignees
Labels
kind/bug Categorizes issue or PR as related to a bug.

Comments

@praveen4g0
Copy link

Expected Behavior

  • When user provides replicas as 3 part of event listener, expected to create 3 pods of event listener.

Actual Behavior

  • But it just creates one pod when user chooses custom resource type as knative instead of native k8s resources.
    Seems it's misleading to use replicas in this scenario.
    (may be a webhook validation error/warning would help 🤔 )

Steps to Reproduce the Problem

 cat << EOF| oc apply -f -
 ---
 apiVersion: triggers.tekton.dev/v1alpha1
 kind: EventListener
 metadata:
   name: github-knative-listener
 spec:
   triggers:
     - name: github-listener
       interceptors:
         - github:
             secretRef:
               secretName: github-secret
               secretKey: secretToken
             eventTypes:
               - pull_request
         - cel:
             filter: "body.action in ['opened', 'synchronize', 'reopened']"
       bindings:
         - ref: github-pr-binding
       template:
         ref: github-template
   replicas: 3      
   resources:
     customResource:
       apiVersion: serving.knative.dev/v1
       kind: Service
       spec:
         template:
           spec:
             serviceAccountName: pipeline
             containers:
             - resources:
                 requests:
                   memory: "64Mi"
                   cpu: "250m"
                 limits:
                   memory: "128Mi"
                   cpu: "500m"
 ---
 apiVersion: triggers.tekton.dev/v1alpha1
 kind: TriggerBinding
 metadata:
   name: github-pr-binding
 spec:
   params:
     - name: gitrevision
       value: $(body.pull_request.head.sha)
     - name: gitrepositoryurl
       value: $(body.repository.clone_url)
 
 ---
 apiVersion: triggers.tekton.dev/v1alpha1
 kind: TriggerTemplate
 metadata:
   name: github-template
 spec:
   params:
     - name: gitrevision
     - name: gitrepositoryurl
   resourcetemplates:
     - apiVersion: tekton.dev/v1alpha1
       kind: TaskRun
       metadata:
         generateName: github-run-
       spec:
         taskSpec:
           inputs:
             resources:
               - name: source
                 type: git
           steps:
             - image: ubuntu
               script: |
                 #! /bin/bash
                 ls -al $(inputs.resources.source.path)
         inputs:
           resources:
             - name: source
               resourceSpec:
                 type: git
                 params:
                   - name: revision
                     value: $(tt.params.gitrevision)
                   - name: url
                     value: $(tt.params.gitrepositoryurl)
 EOF  
  1. Verify number of pods (you will just see one pod)

Additional Info

  • Kubernetes version: v1.20.0+5fbfd19

    Output of oc version:

     oc version                                                                                                        
      Client Version: 4.7.0-202103010125.p0-c66c03f
      Server Version: 4.7.1
      Kubernetes Version: v1.20.0+5fbfd19
    
  • Tekton Pipeline version:

    Output of tkn version or kubectl get pods -n tekton-pipelines -l app=tekton-pipelines-controller -o=jsonpath='{.items[0].metadata.labels.version}'

 tkn version
  Client version: 0.17.0
  Pipeline version: v0.22.0
  Triggers version: v0.12.1
@praveen4g0 praveen4g0 added the kind/bug Categorizes issue or PR as related to a bug. label Mar 26, 2021
@savitaashture
Copy link
Contributor

/assign

@savitaashture
Copy link
Contributor

Planning to deprecate replicas from el spec and move under kubernetesResource

Because replicas will be useful incase of kubernetesResource.

Earlier it was added to el spec assuming Triggers EL support only k8s deployment

cc @dibyom

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

Successfully merging a pull request may close this issue.

2 participants