You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
undeploy: kustomize ## Undeploy controller from the K8s cluster specified in ~/.kube/config. Call with ignore-not-found=true to ignore resource not found errors during deletion.
Copy file name to clipboardExpand all lines: README.md
+29-6Lines changed: 29 additions & 6 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -4,7 +4,7 @@ A Kubernetes operator that receives S3 bucket notifications from NooBaa (Multicl
4
4
5
5
## Description
6
6
7
-
The MCG Adapter runs as an HTTP server inside a Kubernetes cluster, registered as a `bucketNotifications` connection in NooBaa. It watches `MCGOBCTrigger` custom resources to determine which S3 events from which buckets should be forwarded to which endpoints. When NooBaa delivers a notification, the adapter matches the event against all configured triggers and dispatches CloudEvents via HTTP or Kafka to the matching endpoints.
7
+
The MCG Adapter runs inside a Kubernetes cluster, registered as a `bucketNotifications` connection in NooBaa. It can receive notifications via HTTP (default) or by consuming from a Kafka topic. It watches `MCGOBCTrigger` custom resources to determine which S3 events from which buckets should be forwarded to which endpoints. When NooBaa delivers a notification, the adapter matches the event against all configured triggers and dispatches CloudEvents via HTTP or Kafka to the matching endpoints.
8
8
9
9
## Custom Resource: MCGOBCTrigger
10
10
@@ -54,13 +54,17 @@ The adapter is configured via environment variables:
54
54
| Variable | Default | Description |
55
55
|---|---|---|
56
56
| `ADAPTER_ID` | `mcg-adapter` | Identifier used in the S3 bucket notification configuration |
57
-
| `ADAPTER_TOPIC` | `mcg-adapter-connection` | Topic/connection name registered in NooBaa |
58
-
| `ADAPTER_PORT` | `8888` | Port the notification HTTP server listens on |
59
-
| `KAFKA_BROKERS` | _(none)_ | Comma-separated list of Kafka broker addresses (e.g. `broker1:9092,broker2:9092`). Required when using Kafka triggers. |
57
+
| `ADAPTER_TOPIC` | `mcg-adapter-connection/connect.json` | NooBaa connection secret reference used as TopicArn in put-bucket-notification calls |
58
+
| `ADAPTER_PORT` | `8888` | Port the notification HTTP server listens on (HTTP mode only) |
59
+
| `NOTIFICATIONS_MODE` | `http` | `http` or `kafka` — selects how the adapter receives NooBaa notifications |
60
+
| `KAFKA_BROKERS` | _(none)_ | Comma-separated list of Kafka broker addresses. Required for Kafka triggers and when `NOTIFICATIONS_MODE=kafka`. |
61
+
| `KAFKA_SECRET` | _(none)_ | Name of a Kubernetes Secret (in the adapter's namespace) containing Kafka credentials. See `kafka-secret-format.md`. |
62
+
| `KAFKA_NOTIFICATIONS_TOPIC` | _(none)_ | Kafka topic to consume NooBaa notifications from. Required when `NOTIFICATIONS_MODE=kafka`. |
63
+
| `KAFKA_NOTIFICATIONS_GROUP_ID` | _(none)_ | Consumer group ID for consuming NooBaa notifications. Required when `NOTIFICATIONS_MODE=kafka`. |
60
64
61
-
### NooBaa Connection Setup
65
+
### NooBaa Connection Setup (HTTP mode)
62
66
63
-
Before the adapter can receive notifications, register it as an HTTP connection in NooBaa (one-time setup):
67
+
Before the adapter can receive notifications via HTTP, register it as an HTTP connection in NooBaa (one-time setup):
As an alternative to HTTP, the adapter can consume NooBaa notifications from a Kafka topic. This requires a Strimzi-managed Kafka cluster. See the `PLAN` file for detailed setup steps, including creating the KafkaTopic, KafkaUsers, and the NooBaa Kafka connection secret.
108
+
109
+
Summary of the one-time setup:
110
+
111
+
1. Create a `KafkaTopic` (e.g. `mcg-adapter-notifications`) and `KafkaUser` resources in Strimzi
112
+
2. Create a NooBaa connection secret with `notification_protocol: kafka` pointing to the Kafka bootstrap and topic
113
+
3. Patch the NooBaa CR to register the Kafka connection
114
+
4. Create a Kubernetes Secret in the adapter’s namespace with the adapter’s Kafka credentials (see `kafka-secret-format.md`)
115
+
101
116
### Deploy
102
117
103
118
```sh
@@ -106,6 +121,14 @@ make install
106
121
make deploy IMG=<some-registry>/mcg-adapter:tag
107
122
```
108
123
124
+
To deploy in Kafka notifications mode (using default values from the PLAN):
125
+
126
+
```sh
127
+
make deploy-kafka IMG=<some-registry>/mcg-adapter:tag
128
+
```
129
+
130
+
The `deploy-kafka` target uses the kustomize overlay in `config/kafka/` which sets `NOTIFICATIONS_MODE=kafka` along with default Kafka broker, topic, and secret values. Edit `config/kafka/kafka_env_patch.yaml` to customize these for your cluster.
0 commit comments