Skip to content

Latest commit

 

History

History
76 lines (55 loc) · 2.67 KB

install-broker-with-pubsub-channel.md

File metadata and controls

76 lines (55 loc) · 2.67 KB

Installing Broker with Pub/Sub Channel

In Knative Eventing, a Broker represents an "event mesh". Events are sent to the Broker's ingress and are then sent to any subscribers that are interested in that event. Brokers are currently backed by a configurable Channel. In this guide, we show an example of how to configure a Broker backed by the Pub/Sub Channel.

Prerequisites

  1. Install Knative-GCP. Remember to install Knative Eventing.

  2. Create a Service Account for the Data Plane.

Deployment

  1. Verify the configmap config-br-default-channel is in the events-system namespace.

    kubectl get configmap config-br-default-channel -n events-system

    By default, it is assumed to use a default secret. Modify config-br-default-channel to use a different method and apply it. The two options are:

    1. If you are in GKE and using Workload Identity, update serviceAccountName with the Pub/Sub enabled service account you created in Create a Service Account for the Data Plane.

    2. If you are using standard Kubernetes secrets, but want to use a non-default one, update secret with your own secret.

    kubectl apply -f config-br-default-channel.yaml
  2. Patch the configmap in the knative-eventing namespace to use the Pub/Sub Channel as the default channel for Brokers with patch-config-br-defaults-with-pubsub.yaml.

    kubectl patch configmap config-br-defaults -n knative-eventing --patch "$(cat patch-config-br-defaults-with-pubsub.yaml)"
  3. Add the knative-eventing-injection label to your namespace with the following command.

    kubectl label namespace default knative-eventing-injection=enabled

    This triggers a reconciliation process that creates the default Broker in that namespace.

  4. Verify that the Broker is running

    kubectl --namespace default get broker default

    This shows the Broker that you created:

    NAME      READY   REASON   URL                                                        AGE
    default   True             http://default-broker.default.svc.cluster.local      1m

    When the Broker has the READY=True state, it can start processing any events it receives.