Skip to content

Commit fe13fb6

Browse files
committed
update PLAN
1 parent c26cf8c commit fe13fb6

1 file changed

Lines changed: 39 additions & 18 deletions

File tree

PLAN

Lines changed: 39 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -53,10 +53,10 @@ oc patch noobaa noobaa --type='merge' -n openshift-storage -p '{
5353
```
5454

5555
The adapter's deployment should be configured with environment variables that
56-
identify its connection name (used as the Topic prefix in put-bucket-notification
57-
calls). When the operator calls put-bucket-notification for a bucket, it uses
58-
this connection name so that NooBaa knows to deliver notifications to the
59-
adapter's HTTP endpoint.
56+
identify its connection name (see NOOBAA_CONNECTION_NAME in the Kafka
57+
configuration section). When the operator calls put-bucket-notification for a
58+
bucket, it uses this connection name so that NooBaa knows where to deliver
59+
notifications (HTTP endpoint or Kafka topic, depending on NOTIFICATIONS_MODE).
6060

6161
Internal MCG/NooBaa trigger CRD
6262
-------------------------------
@@ -166,28 +166,36 @@ and use those connection details and keys to issue the request to noobaa using S
166166
```
167167
aws s3api put-bucket-notification --bucket "foo-bucket" --notification-configuration '{
168168
"TopicConfiguration": {
169-
"Id": "$adapter_id",
169+
"Id": "$NOOBAA_CONNECTION_NAME",
170170
"Events": ["s3:ObjectCreated:*"],
171-
"Topic": "$adapter_topic"
171+
"Topic": "$NOOBAA_CONNECTION_NAME/connect.json"
172172
}
173173
}'
174174
```
175175

176-
where adapter_id and adapter_topic would be based on env variables on the adapter deployment (setting up the adapter in noobaa would be a manual configuration step)
176+
The Topic in the S3 notification configuration is always a reference to the
177+
NooBaa connection secret: "NOOBAA_CONNECTION_NAME/connect.json". It is not the
178+
Kafka topic itself — for Kafka mode, the actual Kafka topic is the "topic" field
179+
inside the connect.json (see the NooBaa Kafka connection setup section). For HTTP
180+
mode, the connect.json contains the HTTP endpoint details instead.
177181

178-
The adapter_topic is actually "secret_name/connection.json" (relative path to the mounted secret connection.json)
182+
NOOBAA_CONNECTION_NAME is an env var on the adapter deployment that identifies
183+
which NooBaa connection was configured during the one-time setup (HTTP or Kafka,
184+
depending on NOTIFICATIONS_MODE).
179185

180186
If successful, the BucketNotificationSet condition will be marked as "True"
181187

182-
* TestEventReceived will be set to "True", once the adapter receives the TestEvent
188+
* TestEventReceived will be set to "True", once the adapter receives the TestEvent
183189

184190
The noobaa bucket notification sends a test event to the newly configured bucket notifications, e.g.:
185191

186192
```
187193
{"Records":[{"Service":"NooBaa","Event":"s3:TestEvent","Time":"2026-06-17T13:59:25.679Z","Bucket":"foo-bucket","RequestId":"mqi50jq0-bf2pdy-pbh","HostId":"ip-10-0-38-44.us-west-2.compute.internal"}]}
188194
```
189195

190-
once the adapter receives that, it will set the TestEventReceived condition to True
196+
The test event arrives via the adapter's HTTP server (in HTTP mode) or on the
197+
Kafka notifications topic (in Kafka mode). Once the adapter receives it through
198+
either path, it will set the TestEventReceived condition to True
191199

192200
Event dispatch
193201
--------------
@@ -350,7 +358,7 @@ EOF
350358
password=$(oc get secret -n kafka noobaa-notifications-user \
351359
-o jsonpath='{.data.password}' | base64 --decode)
352360

353-
name="mcg-adapter-notifications-connection"
361+
name="mcg-adapter-connection"
354362

355363
tmp=$(mktemp -d)
356364
cat > "$tmp/connect.json" <<EOF
@@ -381,7 +389,7 @@ rm -rf "$tmp"
381389
existing_connections=$(oc get noobaa noobaa -n openshift-storage -o json \
382390
| jq -c '.spec.bucketNotifications.connections // []')
383391

384-
name="mcg-adapter-notifications-connection"
392+
name="mcg-adapter-connection"
385393
updated_connections=$(echo "$existing_connections" | jq -c \
386394
--arg name "$name" \
387395
'[.[] | select(.name != $name)] + [{"name": $name, "namespace": "openshift-storage"}]')
@@ -403,9 +411,9 @@ oc patch noobaa noobaa --type='merge' -n openshift-storage -p '{
403411
aws s3api put-bucket-notification --bucket "foo-bucket" \
404412
--notification-configuration '{
405413
"TopicConfiguration": {
406-
"Id": "mcg-adapter-notifications-connection",
414+
"Id": "mcg-adapter-connection",
407415
"Events": ["s3:ObjectCreated:*"],
408-
"Topic": "mcg-adapter-notifications-connection/connect.json"
416+
"Topic": "mcg-adapter-connection/connect.json"
409417
}
410418
}'
411419
```
@@ -416,12 +424,25 @@ Kafka configuration
416424

417425
Kafka configuration is defined via env on the adapter Deployment:
418426

419-
KAFKA_BROKERS: comma-separated list of host:port
420-
KAFKA_SECRET: <name of the secret from the namespace of the adapter deployment>
427+
NOTIFICATIONS_MODE: "http" or "kafka" — selects whether the adapter
428+
receives NooBaa bucket notifications via its HTTP server or by
429+
consuming from a Kafka topic (default: "http")
430+
NOOBAA_CONNECTION_NAME: the name of the NooBaa connection configured
431+
during the one-time setup (e.g. "mcg-adapter-connection"). Used as
432+
the Id and Topic prefix in put-bucket-notification calls. The same
433+
name is used regardless of notifications mode — only one mode is
434+
active at a time.
435+
KAFKA_BROKERS: comma-separated list of host:port (required in both
436+
modes — even in HTTP mode the adapter needs Kafka to produce
437+
cloudevents to trigger Kafka topics)
438+
KAFKA_SECRET: <name of the secret from the namespace of the adapter
439+
deployment> (required in both modes, same reason as KAFKA_BROKERS)
421440
KAFKA_NOTIFICATIONS_TOPIC: the Kafka topic to consume NooBaa bucket
422-
notifications from (e.g. "mcg-adapter-notifications")
441+
notifications from (e.g. "mcg-adapter-notifications"). Only
442+
required when NOTIFICATIONS_MODE=kafka.
423443
KAFKA_NOTIFICATIONS_GROUP_ID: the consumer group ID for consuming
424-
NooBaa notifications (e.g. "mcg-adapter-notifications")
444+
NooBaa notifications (e.g. "mcg-adapter-notifications"). Only
445+
required when NOTIFICATIONS_MODE=kafka.
425446

426447
The same Kafka credentials (KAFKA_SECRET) are used for both consuming
427448
notifications from NooBaa and producing cloudevents to trigger Kafka topics.

0 commit comments

Comments
 (0)