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

The Trigger of Cloudevents-Player Can't Work #7844

Open
120L020430 opened this issue Apr 17, 2024 · 2 comments
Open

The Trigger of Cloudevents-Player Can't Work #7844

120L020430 opened this issue Apr 17, 2024 · 2 comments
Labels
kind/bug Categorizes issue or PR as related to a bug. triage/needs-user-input Issues which are waiting on a response from the reporter

Comments

@120L020430
Copy link

Describe the bug
A clear and concise description of what the bug is.
I'm new to Knative. After installing knative serving and knative eventing, I try the trigger tutorial, but the trigger doesn't work correctly. It doesn't receive the message.
The result of cloudevents player is below:
image
I find the SUBSCRIBER_URI of the trigger is different from the service.

$ kn service ls
NAME                 URL                                                         LATEST                     AGE   CONDITIONS   READY   REASON
cloudevents-player   http://cloudevents-player.default.192.168.31.206.sslip.io   cloudevents-player-00001   46m   3 OK / 3     True

$ kubectl get trigger
NAME                  BROKER    SUBSCRIBER_URI                                        AGE   READY   REASON
cloudevents-trigger   default   http://cloudevents-player.default.svc.cluster.local   32m   True

My k3s cluster has three nodes.
I use kourier+magic DNS as the networking and DNS layer, following the installing turior.
I use kafka as the channel and broker layer. It has the same three nodes.

cloudevents-player.yaml

apiVersion: serving.knative.dev/v1
kind: Service
metadata:
  name: cloudevents-player
spec:
  template:
    metadata:
      annotations:
        autoscaling.knative.dev/min-scale: "1"
    spec:
      containers:
        - image: quay.io/ruben/cloudevents-player:latest
          env:
            - name: BROKER_URL
              value: http://kafka-broker-ingress.knative-eventing.svc.cluster.local/default/default

ce-trigger.yaml

apiVersion: eventing.knative.dev/v1
kind: Trigger
metadata:
  name: cloudevents-trigger
  annotations:
    knative-eventing-injection: enabled
spec:
  broker: default
  subscriber:
    ref:
      apiVersion: serving.knative.dev/v1
      kind: Service
      name: cloudevents-player

Expected behavior
A clear and concise description of what you expected to happen.

The trigger can work correctly like the tutorial.

To Reproduce
Steps to reproduce the behavior.

Install knative following the YAML-based Installation, and use kourier, magic DNS and kafka. Finally, try the cloudevents player.

Knative release version
v1.13.1
Additional context
Add any other context about the problem here such as proposed priority

@120L020430 120L020430 added the kind/bug Categorizes issue or PR as related to a bug. label Apr 17, 2024
@120L020430
Copy link
Author

120L020430 commented May 1, 2024

Let me elaborate on the situation:

I have a local three-node k3s cluster and apply serving-crds.yaml, serving-core.yaml, kourier.yaml, serving-default-domain.yaml, serving-hpa.yaml. After deploying example Hello, I get the following result:

image-20240501080335115

watch -n 0.5 kubectl get pod -l serving.knative.dev/service=hello -owideObserving the autoscaling, everything is fine at this point

#!/bin/bash
for ((i=0;i<=10000;i++)); do {
echo `curl -s http://hello.default.192.168.31.206.sslip.io`
} & done
wait

And then I applyeventing-crds.yamleventing-core.yaml, eventing-kafka-controller.yaml, eventing-kafka-channel.yaml and eventing-kafka-broker.yaml,and connect it with my local kafka cluster.

The broker is as follows:

apiVersion: eventing.knative.dev/v1
kind: Broker
metadata:
  annotations:
    # case-sensitive
    eventing.knative.dev/broker.class: Kafka
    # Optional annotation to point to an externally managed kafka topic:
    # kafka.eventing.knative.dev/external.topic: <topic-name>
  name: default
  namespace: default
spec:
  # Configuration specific to this broker.
  config:
    apiVersion: v1
    kind: ConfigMap
    name: kafka-broker-config
    namespace: knative-eventing

After testing the issue example, the problem arises.

Later I tried to use kafkasource and deployed this example and it failed.

The log of pod/kafka-source-dispatcher is as follows:

log.json

I think the most important is "ERROR","level_value":40000,"stack_trace":"io.netty.resolver.dns.DnsResolveContext$SearchDomainUnknownHostException: Failed to resolve 'event-display.default.svc.cluster.local' [A(1)] and search domain query for configured domains failed as well: [knative-eventing.svc.cluster.local, svc.cluster.local, cluster.local]

Like the original hello, the address of event-display is actually event-display.default.192.168.31.206.sslip.io, but here it resolves event-display.default.svc.cluster.local

I don't know if I'm missing any files or if there's a mistake in the configuration somewhere.

@pierDipi
Copy link
Member

pierDipi commented May 2, 2024

@120L020430 can you show the full knative service status?

$ kubectl get ksvc hello -oyaml

if there is a URL like event-display.default.svc.cluster.local can you try to sending a request to it from a pod in the cluster?

there might be something wrong in your knative serving installation

@pierDipi pierDipi added the triage/needs-user-input Issues which are waiting on a response from the reporter label May 2, 2024
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. triage/needs-user-input Issues which are waiting on a response from the reporter
Projects
None yet
Development

No branches or pull requests

2 participants