triggers icon indicating copy to clipboard operation
triggers copied to clipboard

EventListener - unable to define NodePort (Question)

Open hcguersoy opened this issue 2 years ago • 4 comments

Expected Behavior

I expect that I'm able to configure the NodePort of an EventListener. So my main question is: how can I tell the EventListener to be exposed using NodePort on a specific port?

Actual Behavior

I was not able to configure the NodePort. Maybe this is a bug or simply missing clarification in the documentation if this feature is not available. I assume that I missed something.

Steps to Reproduce the Problem

I deploy a very simple EventListener:

apiVersion: triggers.tekton.dev/v1beta1
kind: EventListener
metadata:
  name: simple-eventlistener
spec:
  serviceAccountName:  simple-tekton-robot
  triggers:
    - name: simple-trigger
      interceptors:
        - name: "verify-gitlab-payload"
          ref:
            name: "gitlab"
            kind: ClusterInterceptor
          params:
            - name: secretRef
              value:
                secretName: "gitlab-secret"
                secretKey: "verySecretToken"
            - name: eventTypes
              value:
                - "Push Hook"
      bindings:
      - ref: simple-binding
      template:
        ref: simple-template
  resources:
    kubernetesResource:
      serviceType: NodePort
      servicePort: 38080

This results in this Service:

❯ kubectl describe service -n simple el-simple-eventlistener
Name:                     el-simple-eventlistener
Namespace:                simple
Labels:                   app.kubernetes.io/managed-by=EventListener
                          app.kubernetes.io/part-of=Triggers
                          eventlistener=simple-eventlistener
Annotations:              <none>
Selector:                 app.kubernetes.io/managed-by=EventListener,app.kubernetes.io/part-of=Triggers,eventlistener=simple-eventlistener
Type:                     NodePort
IP Family Policy:         SingleStack
IP Families:              IPv4
IP:                       10.43.38.175
IPs:                      10.43.38.175
Port:                     http-listener  38080/TCP
TargetPort:               8080/TCP
NodePort:                 http-listener  32462/TCP
Endpoints:                10.42.0.50:8080
Port:                     http-metrics  9000/TCP
TargetPort:               9000/TCP
NodePort:                 http-metrics  30353/TCP
Endpoints:                10.42.0.50:9000
Session Affinity:         None
External Traffic Policy:  Cluster
Events:                   <none>

Additional Info

  • Kubernetes version:

    ❯ kubectl version --short 
    Client Version: v1.26.3
    Kustomize Version: v4.5.7
    Server Version: v1.25.6+k3s1
    

I'm running/testing currently on a local Rancher Desktop (v1.8.1)

  • Tekton Pipeline version:
 ❯ tkn version 
Client version: 0.30.1
Pipeline version: v0.46.0
Triggers version: v0.23.1
Dashboard version: v0.33.0

hcguersoy avatar May 04 '23 10:05 hcguersoy

Issues go stale after 90d of inactivity. Mark the issue as fresh with /remove-lifecycle stale with a justification. Stale issues rot after an additional 30d of inactivity and eventually close. If this issue is safe to close now please do so with /close with a justification. If this issue should be exempted, mark the issue as frozen with /lifecycle frozen with a justification.

/lifecycle stale

Send feedback to tektoncd/plumbing.

tekton-robot avatar Aug 02 '23 11:08 tekton-robot

IMHO this should be clarified / pointed out in the documentation if this behaviour is as intended or fixed, if it is a bug.

/remove-lifecycle stale

hcguersoy avatar Aug 21 '23 05:08 hcguersoy

@hcguersoy Isn't it configured in the example that you gave? Ideally, this should work, if it doesn't, then there's a bug.

khrm avatar Aug 21 '23 06:08 khrm

@khrm I configure the NodePort in the example but as you can see in the description of the resulting service, it is not set the right way.

hcguersoy avatar Aug 21 '23 06:08 hcguersoy