Skip to content
This repository has been archived by the owner on Jun 19, 2022. It is now read-only.

Latest commit

 

History

History
76 lines (55 loc) · 2.66 KB

install-broker-with-pubsub-channel.md

File metadata and controls

76 lines (55 loc) · 2.66 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 Pub/Sub enabled Service Account.

Deployment

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

    kubectl get configmap config-br-default-channel -n cloud-run-events

    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 serviceAccount with the Pub/Sub enabled service account you created in Create a Pub/Sub enabled Service Account.

    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.