knative / eventing

Event-driven application platform for Kubernetes
https://knative.dev/docs/eventing
Apache License 2.0
1.42k stars 598 forks source link

the default broker not ready #3090

Closed zqzzq closed 4 years ago

zqzzq commented 4 years ago

Describe the bug A clear and concise description of what the bug is. label the ns:

kubectl label namespace test knative-eventing-injection=enabled

but the broker is not ready:

# kubectl -n test get broker
NAME      READY   REASON   URL   AGE
default                          5d5h

# kubectl -n test describe broker default
Name:         default
Namespace:    test
Labels:       eventing.knative.dev/namespaceInjected=true
Annotations:  eventing.knative.dev/broker.class: ChannelBasedBroker
              eventing.knative.dev/creator: system:serviceaccount:knative-eventing:eventing-controller
              eventing.knative.dev/lastModifier: system:serviceaccount:knative-eventing:eventing-controller
API Version:  eventing.knative.dev/v1beta1
Kind:         Broker
Metadata:
  Creation Timestamp:  2020-05-01T01:20:40Z
  Generation:          1
  Owner References:
    API Version:           v1
    Block Owner Deletion:  true
    Controller:            true
    Kind:                  Namespace
    Name:                  test
    UID:                   edc1c494-2b95-4c1e-8521-6b19c26f4991
  Resource Version:        1081860
  Self Link:               /apis/eventing.knative.dev/v1beta1/namespaces/test/brokers/default
  UID:                     6380b41e-efba-49ce-88c2-9a512a59ad5a
Spec:
  Config:
    API Version:  v1
    Kind:         ConfigMap
    Name:         config-br-default-channel
    Namespace:    knative-eventing
Status:
  Address:
Events:  <none>

my pod in knative-eventing:

# kubectl -n knative-eventing get po -owide
broker-filter-67ccc8bd94-nzw7g          1/1     Running             0          5d21h   10.151.194.37   slave3   <none>           <none>
broker-ingress-7f57789d87-w74n9         1/1     Running             0          5d21h   10.151.194.36   slave3   <none>           <none>
eventing-controller-5c47c48478-98cms    1/1     Running             0          9m28s   10.151.194.86   slave3   <none>           <none>
eventing-webhook-5b9785d8dc-779wb       1/1     Running             0          9m2s    10.151.194.87   slave3   <none>           <none>
imc-controller-85d945dfdd-fk5zf         1/1     Running             0          8m25s   10.151.51.8     slave1   <none>           <none>
imc-dispatcher-7b8cd588-bw6l8           1/1     Running             0          8m9s    10.151.194.88   slave3   <none>           <none>
mt-broker-controller-7f697b9b96-8qs6x   1/1     Running             0          5d21h   10.151.49.15    slave2   <none>           <none>

Expected behavior A clear and concise description of what you expected to happen. the default broker becomes ready To Reproduce Steps to reproduce the behavior.

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

grantr commented 4 years ago

@zqzzq Thanks for the report. Do you have any pods in the test namespace?

vaikas commented 4 years ago

From a quick look my guess is that you have installed the MT Broker but the default broker is configured to use ChannelBroker: See the default broker annotation: eventing.knative.dev/broker.class: ChannelBasedBroker

And I don't see 'broker-controller' running in knative-eventing. So, for this particular broker you can change the BrokerClass to MTChannelBasedBroker So, if you do kubectl -n test edit broker default

And change this annotation: eventing.knative.dev/broker.class: ChannelBasedBroker

to this: eventing.knative.dev/broker.class: ChannelBasedBroker

it should work.

And for any future brokers, you should probably update your ConfigMap to something like this so that they will get the correct BrokerClass annotation: https://knative.dev/docs/eventing/mt-channel-based-broker/

kind: ConfigMap
apiVersion: v1
metadata:
  name: config-br-defaults
  namespace: knative-eventing
data:
  default-br-config: |
    clusterDefault:
      brokerClass: MTChannelBasedBroker
      apiVersion: v1
      kind: ConfigMap
      name: imc-channel
      namespace: knative-eventing
zqzzq commented 4 years ago

@vaikas thank you very much! The default broker becomes ready according to your suggestion, closing this.

vaikas commented 4 years ago

Great to hear!! 👍

vaikas commented 4 years ago

sigh, I had made a typo in the original instructions, but looks like despite this oversight you figured it out :) For future references it should have said:

And change this annotation:

eventing.knative.dev/broker.class: ChannelBasedBroker

to this:

eventing.knative.dev/broker.class: MTChannelBasedBroker