Skip to content

Commit 4e1d4ae

Browse files
committed
rename to objectbucket-notifications-adapter
1 parent eec606b commit 4e1d4ae

30 files changed

Lines changed: 77 additions & 77 deletions

Makefile

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -28,8 +28,8 @@ BUNDLE_METADATA_OPTS ?= $(BUNDLE_CHANNELS) $(BUNDLE_DEFAULT_CHANNEL)
2828
# This variable is used to construct full image tags for bundle and catalog images.
2929
#
3030
# For example, running 'make bundle-build bundle-push catalog-build catalog-push' will build and push both
31-
# functions.dev/mcg-adapter-bundle:$VERSION and functions.dev/mcg-adapter-catalog:$VERSION.
32-
IMAGE_TAG_BASE ?= functions.dev/mcg-adapter
31+
# functions.dev/objectbucket-notifications-adapter-bundle:$VERSION and functions.dev/objectbucket-notifications-adapter-catalog:$VERSION.
32+
IMAGE_TAG_BASE ?= functions.dev/objectbucket-notifications-adapter
3333

3434
# BUNDLE_IMG defines the image:tag used for the bundle.
3535
# You can use it as an arg. (E.g make bundle-build BUNDLE_IMG=<some-registry>/<project-name-bundle>:<tag>)
@@ -116,7 +116,7 @@ test: manifests generate fmt vet setup-envtest ## Run tests.
116116
# The default setup assumes Kind is pre-installed and builds/loads the Manager Docker image locally.
117117
# CertManager is installed by default; skip with:
118118
# - CERT_MANAGER_INSTALL_SKIP=true
119-
KIND_CLUSTER ?= mcg-adapter-test-e2e
119+
KIND_CLUSTER ?= objectbucket-notifications-adapter-test-e2e
120120

121121
.PHONY: setup-test-e2e
122122
setup-test-e2e: ## Set up a Kind cluster for e2e tests if it does not exist
@@ -185,10 +185,10 @@ PLATFORMS ?= linux/arm64,linux/amd64,linux/s390x,linux/ppc64le
185185
docker-buildx: ## Build and push docker image for the manager for cross-platform support
186186
# copy existing Dockerfile and insert --platform=${BUILDPLATFORM} into Dockerfile.cross, and preserve the original Dockerfile
187187
sed -e '1 s/\(^FROM\)/FROM --platform=\$$\{BUILDPLATFORM\}/; t' -e ' 1,// s//FROM --platform=\$$\{BUILDPLATFORM\}/' Dockerfile > Dockerfile.cross
188-
- $(CONTAINER_TOOL) buildx create --name mcg-adapter-builder
189-
$(CONTAINER_TOOL) buildx use mcg-adapter-builder
188+
- $(CONTAINER_TOOL) buildx create --name objectbucket-notifications-adapter-builder
189+
$(CONTAINER_TOOL) buildx use objectbucket-notifications-adapter-builder
190190
- $(CONTAINER_TOOL) buildx build --push --platform=$(PLATFORMS) --tag ${IMG} -f Dockerfile.cross .
191-
- $(CONTAINER_TOOL) buildx rm mcg-adapter-builder
191+
- $(CONTAINER_TOOL) buildx rm objectbucket-notifications-adapter-builder
192192
rm Dockerfile.cross
193193

194194
.PHONY: build-installer

PLAN

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
1-
Multicloud Object Gateway Adapter (NooNaa)
2-
==========================================
1+
ObjectBucket Notifications Adapter
2+
==================================
33

44
The adapter will be an HTTP server and/or Kafka consumer running in a pod inside a k8s cluster, configured in noobaa as "bucketNotifications" connection (either as HTTP notifications, or Kafka notifications)
5-
It will distribute the notifications received from NooBaa to individual triggers, according to the configuration specified by OBCSource custom resources.
5+
It will distribute the notifications received from NooBaa to individual triggers, according to the configuration specified by ObjectBucketSource custom resources.
66
The notifications to individual triggers will be sent as cloudevents via HTTP or Kafka
77
It will be implemented in go, using k8s client libraries, the cloudevents k8s libraries, aws s3 client library, https://github.com/IBM/sarama, and the operator sdk (https://sdk.operatorframework.io)
88

README.md

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
1-
# MCG Adapter
1+
# ObjectBucket Notifications Adapter
22

33
A Kubernetes operator that receives S3 bucket notifications from NooBaa (Multicloud Object Gateway) and dispatches them as CloudEvents to configured sink endpoints.
44

55
## Description
66

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 `ObjectBucketSource` 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 sources and dispatches CloudEvents via HTTP or Kafka to the matching sinks.
7+
The ObjectBucket Notifications 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 `ObjectBucketSource` 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 sources and dispatches CloudEvents via HTTP or Kafka to the matching sinks.
88

99
## Custom Resource: ObjectBucketSource
1010

@@ -50,8 +50,8 @@ The adapter is configured via environment variables:
5050

5151
| Variable | Default | Description |
5252
|---|---|---|
53-
| `ADAPTER_ID` | `mcg-adapter` | Identifier used in the S3 bucket notification configuration |
54-
| `ADAPTER_TOPIC` | `mcg-adapter-connection/connect.json` | NooBaa connection secret reference used as TopicArn in put-bucket-notification calls |
53+
| `ADAPTER_ID` | `objectbucket-notifications-adapter` | Identifier used in the S3 bucket notification configuration |
54+
| `ADAPTER_TOPIC` | `objectbucket-notifications-adapter-connection/connect.json` | NooBaa connection secret reference used as TopicArn in put-bucket-notification calls |
5555
| `ADAPTER_PORT` | `8888` | Port the notification HTTP server listens on (HTTP mode only) |
5656
| `NOTIFICATIONS_MODE` | `http` | `http` or `kafka` — selects how the adapter receives NooBaa notifications |
5757
| `KAFKA_BROKERS` | _(none)_ | Comma-separated list of Kafka broker addresses. Required for Kafka sinks and when `NOTIFICATIONS_MODE=kafka`. |
@@ -66,10 +66,10 @@ Before the adapter can receive notifications via HTTP, register it as an HTTP co
6666
1. Create the connection secret:
6767

6868
```sh
69-
oc create secret generic mcg-adapter-connection \
69+
oc create secret generic objectbucket-notifications-adapter-connection \
7070
--from-file=connect.json=/dev/stdin -n openshift-storage <<EOF
7171
{
72-
"name": "mcg-adapter-connection",
72+
"name": "objectbucket-notifications-adapter-connection",
7373
"notification_protocol": "http",
7474
"agent_request_object": {
7575
"host": "<adapter-service>.<adapter-namespace>.svc.cluster.local",
@@ -86,7 +86,7 @@ existing_connections=$(oc get noobaa noobaa -n openshift-storage -o json \
8686
| jq -c '.spec.bucketNotifications.connections // []')
8787
8888
updated_connections=$(echo "$existing_connections" | jq -c \
89-
--arg name "mcg-adapter-connection" \
89+
--arg name "objectbucket-notifications-adapter-connection" \
9090
'[.[] | select(.name != $name)] + [{"name": $name, "namespace": "openshift-storage"}]')
9191
9292
oc patch noobaa noobaa --type='merge' -n openshift-storage -p '{
@@ -105,23 +105,23 @@ As an alternative to HTTP, the adapter can consume NooBaa notifications from a K
105105

106106
Summary of the one-time setup:
107107

108-
1. Create a `KafkaTopic` (e.g. `mcg-adapter-notifications`) and `KafkaUser` resources in Strimzi
108+
1. Create a `KafkaTopic` (e.g. `objectbucket-notifications-adapter-notifications`) and `KafkaUser` resources in Strimzi
109109
2. Create a NooBaa connection secret with `notification_protocol: kafka` pointing to the Kafka bootstrap and topic
110110
3. Patch the NooBaa CR to register the Kafka connection
111111
4. Create a Kubernetes Secret in the adapter's namespace with the adapter's Kafka credentials (see `kafka-secret-format.md`)
112112

113113
### Deploy
114114

115115
```sh
116-
make docker-build docker-push IMG=<some-registry>/mcg-adapter:tag
116+
make docker-build docker-push IMG=<some-registry>/objectbucket-notifications-adapter:tag
117117
make install
118-
make deploy IMG=<some-registry>/mcg-adapter:tag
118+
make deploy IMG=<some-registry>/objectbucket-notifications-adapter:tag
119119
```
120120

121121
To deploy in Kafka notifications mode (using default values from the PLAN):
122122

123123
```sh
124-
make deploy-kafka IMG=<some-registry>/mcg-adapter:tag
124+
make deploy-kafka IMG=<some-registry>/objectbucket-notifications-adapter:tag
125125
```
126126

127127
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.

cmd/main.go

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -45,10 +45,10 @@ import (
4545

4646
"github.com/IBM/sarama"
4747

48-
sourcesv1alpha1 "github.com/functions-dev/mcg-adapter/api/v1alpha1"
49-
"github.com/functions-dev/mcg-adapter/internal/controller"
50-
kafkaconfig "github.com/functions-dev/mcg-adapter/internal/kafka"
51-
"github.com/functions-dev/mcg-adapter/internal/notificationserver"
48+
sourcesv1alpha1 "github.com/functions-dev/objectbucket-notifications-adapter/api/v1alpha1"
49+
"github.com/functions-dev/objectbucket-notifications-adapter/internal/controller"
50+
kafkaconfig "github.com/functions-dev/objectbucket-notifications-adapter/internal/kafka"
51+
"github.com/functions-dev/objectbucket-notifications-adapter/internal/notificationserver"
5252
// +kubebuilder:scaffold:imports
5353
)
5454

@@ -214,11 +214,11 @@ func main() {
214214

215215
adapterID := os.Getenv("ADAPTER_ID")
216216
if adapterID == "" {
217-
adapterID = "mcg-adapter"
217+
adapterID = "objectbucket-notifications-adapter"
218218
}
219219
adapterTopic := os.Getenv("ADAPTER_TOPIC")
220220
if adapterTopic == "" {
221-
adapterTopic = "mcg-adapter-connection/connect.json"
221+
adapterTopic = "objectbucket-notifications-adapter-connection/connect.json"
222222
}
223223
adapterPort := 8888
224224
if portStr := os.Getenv("ADAPTER_PORT"); portStr != "" {

config/default/kustomization.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
11
# Adds namespace to all resources.
2-
namespace: mcg-adapter-system
2+
namespace: objectbucket-notifications-adapter-system
33

44
# Value of this field is prepended to the
55
# names of all resources, e.g. a deployment named
66
# "wordpress" becomes "alices-wordpress".
77
# Note that it should also match with the prefix (text before '-') of the namespace
88
# field above.
9-
namePrefix: mcg-adapter-
9+
namePrefix: objectbucket-notifications-adapter-
1010

1111
# Labels to add to all resources and selectors.
1212
#labels:

config/default/metrics_service.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ kind: Service
33
metadata:
44
labels:
55
control-plane: controller-manager
6-
app.kubernetes.io/name: mcg-adapter
6+
app.kubernetes.io/name: objectbucket-notifications-adapter
77
app.kubernetes.io/managed-by: kustomize
88
name: controller-manager-metrics-service
99
namespace: system
@@ -15,4 +15,4 @@ spec:
1515
targetPort: 8443
1616
selector:
1717
control-plane: controller-manager
18-
app.kubernetes.io/name: mcg-adapter
18+
app.kubernetes.io/name: objectbucket-notifications-adapter

config/kafka/kafka_env_patch.yaml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,8 @@ spec:
1313
- name: KAFKA_BROKERS
1414
value: "my-cluster-kafka-bootstrap.kafka.svc:9095"
1515
- name: KAFKA_SECRET
16-
value: "mcg-adapter-user"
16+
value: "objectbucket-notifications-adapter-user"
1717
- name: KAFKA_NOTIFICATIONS_TOPIC
18-
value: "mcg-adapter-notifications"
18+
value: "objectbucket-notifications-adapter-notifications"
1919
- name: KAFKA_NOTIFICATIONS_GROUP_ID
20-
value: "mcg-adapter-notifications"
20+
value: "objectbucket-notifications-adapter-notifications"

config/manager/kustomization.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,5 +5,5 @@ apiVersion: kustomize.config.k8s.io/v1beta1
55
kind: Kustomization
66
images:
77
- name: controller
8-
newName: example.com/mcg-adapter
8+
newName: example.com/objectbucket-notifications-adapter
99
newTag: v0.0.1

config/manager/manager.yaml

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ kind: Namespace
33
metadata:
44
labels:
55
control-plane: controller-manager
6-
app.kubernetes.io/name: mcg-adapter
6+
app.kubernetes.io/name: objectbucket-notifications-adapter
77
app.kubernetes.io/managed-by: kustomize
88
name: system
99
---
@@ -14,21 +14,21 @@ metadata:
1414
namespace: system
1515
labels:
1616
control-plane: controller-manager
17-
app.kubernetes.io/name: mcg-adapter
17+
app.kubernetes.io/name: objectbucket-notifications-adapter
1818
app.kubernetes.io/managed-by: kustomize
1919
spec:
2020
selector:
2121
matchLabels:
2222
control-plane: controller-manager
23-
app.kubernetes.io/name: mcg-adapter
23+
app.kubernetes.io/name: objectbucket-notifications-adapter
2424
replicas: 1
2525
template:
2626
metadata:
2727
annotations:
2828
kubectl.kubernetes.io/default-container: manager
2929
labels:
3030
control-plane: controller-manager
31-
app.kubernetes.io/name: mcg-adapter
31+
app.kubernetes.io/name: objectbucket-notifications-adapter
3232
spec:
3333
# TODO(user): Uncomment the following code to configure the nodeAffinity expression
3434
# according to the platforms which are supported by your solution.
@@ -67,9 +67,9 @@ spec:
6767
name: manager
6868
env:
6969
- name: ADAPTER_ID
70-
value: "mcg-adapter"
70+
value: "objectbucket-notifications-adapter"
7171
- name: ADAPTER_TOPIC
72-
value: "mcg-adapter-connection/connect.json"
72+
value: "objectbucket-notifications-adapter-connection/connect.json"
7373
- name: ADAPTER_PORT
7474
value: "8888"
7575
- name: NOTIFICATIONS_MODE

config/manager/service.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,12 +3,12 @@ kind: Service
33
metadata:
44
name: controller-manager-notifications
55
labels:
6-
app.kubernetes.io/name: mcg-adapter
6+
app.kubernetes.io/name: objectbucket-notifications-adapter
77
app.kubernetes.io/managed-by: kustomize
88
spec:
99
selector:
1010
control-plane: controller-manager
11-
app.kubernetes.io/name: mcg-adapter
11+
app.kubernetes.io/name: objectbucket-notifications-adapter
1212
ports:
1313
- port: 8888
1414
targetPort: 8888

0 commit comments

Comments
 (0)