0

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
Sandeep
  • 199
  • 3
  • 11
  • 1
    I don't think it's possible to do what you say. From the doc I believe you can only define the serving.knative.dev/v1 API https://github.com/knative/docs/blob/main/docs/eventing/channels/subscriptions.md ; https://knative.dev/docs/serving/reference/serving-api/ – glv Mar 27 '23 at 14:14
  • It is possible to specify a kubernetes service as a sink (you even can specify external services). At the end CloudEvents are sent to the endpoint. @Sandeep: can you check if the Subscription is setup correctly and the subscriber resolution worked? Otherwise make sure your kubernetes service listens on port 80 and that your backing service (behind the k8s service) is listening correctly (e.g. on POSTs...) – chresse Apr 14 '23 at 10:17

0 Answers0