Knative - Set a Kubernetes service as sink or subscriber

76 Views Asked by At

Is it possible to set a Kubernetes service(not a knative service) as a sink or as a subscriber?

I was able to create the following subscription, which points a kubernetes service. But the service is not getting triggered.

apiVersion: messaging.knative.dev/v1
kind: Subscription
metadata:
  name: java-subscriber-k8s-service
spec:
  channel:
    apiVersion: messaging.knative.dev/v1beta1
    kind: KafkaChannel
    name: poc-channel-1
  subscriber:
    ref:
      apiVersion: v1
      kind: Service
      name: java-fake-service-service
    uri: /api/echo
1

There are 1 best solutions below

0
Sandeep On

The issue was the configuration of the service. Knative assumed the default port, whereas kubernetes service was configured for 8080.