knative / knative/eventing

Kubernetes Service as Sink only works with Port 80

Open
#5,147 23 comments 0 reactions 0 assignees View on GitHub
area/api area/eventing kind/enhancement kind/feature-request priority/important-longterm triage/accepted
Dominant language
Go
Stars
1.6k
Forks
631
Avg merge
2d 1h
Merged PRs (30d)
6

Description

**Describe the bug**
When using `v1/Service` and `kind: Service` as `sink`, i.e. Kubernetes Service instead of `KService`, all eventing components using that specific `sink` will only work if the `Service` is exposed on port `80` (`targetPort` can be different).

According to @n3wscott this is due to the specific Kubernetes `Service` resolver defaulting to port `80`, ignoring the specified port on that `Service` instance.

**Expected behavior**
Use defined port on Kubernetes `Service` instead of assuming `80`.

**To Reproduce**
Create a `Broker` and `Trigger` sending events to a `sink` defined as plain Kubernetes Service. The Kubernetes `Service` should be exposed on a port != `80`, e.g. `8080`. Again, `targetPort` (pod) does not matter.

**Knative release version**
Latest and master. (all?)

**Additional context**
From a discussion with @n3wscott

> refs resolve to port 80, you could use non-:80 if you use an abs url

It would be nice to get the correct behavior out of the box as I wasted an hour troubleshooting why a trigger would not deliver to my Kubernetes `Service` exposed on `8080` :) .

Contributor guide

Open the contributing guide

Research direction

Start with the Kubernetes Service resolver mentioned in the report and trace how a plain v1/Service sink resolves its port. Reproduce the issue with a Service exposed on port 8080 and a Broker/Trigger, then verify that delivery uses the Service's defined port rather than assuming port 80.

Written by the indexing model from the issue text.

Assessment

Tech stack
go, kubernetes
Domain
networking
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.