Closed fabian4 closed 1 year ago
let me know if you need something else
What do you see with kn broker list -n knative-eventing
? (i.e. with providing the namespace)
Another question would be, why are you creating the broker in the knative-eventing namespace ? This namespace is usually reserved for the Knative eventing control-plane and data-plane, brokers CRs are typically created in the user namespace where your workload is deployed.
➜ ~ kn broker list
No brokers found.
➜ ~
➜ ~
➜ ~ kn broker list -n knative-eventing
NAME URL AGE CONDITIONS READY REASON
eventmesh http://broker-ingress.knative-eventing.svc.cluster.local/knative-eventing/eventmesh 40h 6 OK / 6 True
➜ ~
Another question would be, why are you creating the broker in the knative-eventing namespace ? This namespace is usually reserved for the Knative eventing control-plane and data-plane, brokers CRs are typically created in the user namespace where your workload is deployed.
I just create a broker for testing, and choose the namespace directlly. May that be the root cause?
The culprit is that your current namespace is probably default
, but cmd for kn
with -n
option created the broker resource in the specified namespace.
By default kn
inherits current namespace value from the active kubectl context, when not provided explicitly. Hence usually it's default
for fresh clusters, e.g. on Minikube or Kind. You can work with namespace
as with any other K8s resource though.
Note: if you look around for namespace plugins for kubectl
. There are a few options that makes switching between namespaces a bit more user-friendly.
https://github.com/ahmetb/kubectx
➜ ~ kubectl get ns
NAME STATUS AGE
default Active 3m41s
knative-eventing Active 2m56s
knative-serving Active 3m32s
kourier-system Active 3m24s
kube-node-lease Active 3m41s
kube-public Active 3m41s
kube-system Active 3m41s
local-path-storage Active 3m36s
test-ns Active 2m31s
➜ ~ kubectl create ns test-ns
# Switch active context to a different namespace
➜ ~ kubectl config set-context --current --namespace=test-ns
Context "kind-kind" modified.
# Check current namespace in the active context
➜ ~ kubectl config view --minify | grep namespace:
namespace: test-ns
See K8s docs for more: https://kubernetes.io/docs/concepts/overview/working-with-objects/namespaces/
➜ ~ kn broker list -n knative-eventing
NAME URL AGE CONDITIONS READY REASON
eventmesh http://broker-ingress.knative-eventing.svc.cluster.local/knative-eventing/eventmesh 42h 6 OK / 6 True
➜ ~
➜ ~ kn broker list
No brokers found.
➜ ~
➜ ~ kubectl config set-context --current --namespace=knative-eventing
Context "default" modified.
➜ ~
➜ ~ kn broker list
NAME URL AGE CONDITIONS READY REASON
eventmesh http://broker-ingress.knative-eventing.svc.cluster.local/knative-eventing/eventmesh 42h 6 OK / 6 True
➜ ~
Thanks a lot. It really helps me to understand it better.
Thanks a lot. It really helps me to understand it better.
You're welcome! I'm glad we could work it out together. Please don't hesitate to raise any other issues you come across when exploring Knative.
https://knative.dev/docs/eventing/brokers/create-broker/