# Event Bus

When operating Bindplane in a distributed architecture, an external event bus must be configured.

### NATS

The NATS event bus is Bindplane's embedded event bus, suitable for high availability without the need for external infrastructure.

NATS is configured by setting `eventbus.type` to `nats`.

```yaml
eventbus:
  type: nats
```

#### Resource Tuning

When using NATS, three dedicated StatefulSet pods are deployed. You can set their resource allocation by setting `nats.resources`.

```yaml
eventbus:
  type: nats

nats:
  resources:
    requests:
      memory: 1000Mi
      cpu: 1000m
    limits:
      memory: 1000Mi
```

### Google Pub/Sub

#### Automatic Authentication

Google Pub/Sub can be configured without credentials when using [Google Application Default Credentials](https://cloud.google.com/docs/authentication/application-default-credentials).

When running on a Google Kubernetes Engine cluster, Bindplane can authenticate to Pub/Sub without the use of a service account as long as the GKE node pool has the [Required Scopes](https://developers.google.com/identity/protocols/oauth2/scopes#pubsub) enabled.

```yaml
eventbus:
  type: 'pubsub'
  pubsub:
    projectid: 'my-project'
    topic: 'bindplane'
```

#### Service Account Credentials

If operating outside of Google Cloud, a service account JSON credential can be used. This example creates a secret named `bindplane-pubsub` which contains the service account JSON key.

```bash
kubectl create secret generic bindplane-pubsub \
  --from-file=credentials.json
```

```yaml
eventbus:
  type: 'pubsub'
  pubsub:
    projectid: 'my-project'
    topic: 'bindplane'
    credentials:
      secret: bindplane-pubsub
      subPath: credentials.json
```


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.bindplane.com/deployment/kubernetes/server/components/event-bus.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
