Skip to content

Commit

Permalink
Add kafka profile
Browse files Browse the repository at this point in the history
  • Loading branch information
kahowell authored and lubosmj committed Aug 19, 2024
1 parent c43e19e commit 090a205
Show file tree
Hide file tree
Showing 3 changed files with 46 additions and 0 deletions.
23 changes: 23 additions & 0 deletions profiles/kafka/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
# kafka

## Usage

* Runs a kafka service at port 9092

You can connect external tools (e.g. PyCharm kafka plugin) to this kafka instance without authentication.

There are scripts included with kafka you can invoke via `exec` for testing, e.g.

```shell
oci-env exec -s kafka \
/opt/kafka/bin/kafka-console-consumer.sh \
--bootstrap-server=localhost:9092 \
--offset earliest \
--partition 0 \
--topic pulpcore.tasking.status \
--max-messages=1
```

## Extra Variables

None.
22 changes: 22 additions & 0 deletions profiles/kafka/compose.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
version: "3.7"

services:
kafka:
hostname: kafka
image: docker.io/apache/kafka:3.7.0
ports:
- "9092:29092"
environment:
- "KAFKA_NODE_ID=1"
- "KAFKA_LISTENER_SECURITY_PROTOCOL_MAP=CONTROLLER:PLAINTEXT,PLAINTEXT:PLAINTEXT,PLAINTEXT_HOST:PLAINTEXT"
- "KAFKA_ADVERTISED_LISTENERS=PLAINTEXT://kafka:9092,PLAINTEXT_HOST://localhost:9092"
- "KAFKA_LISTENERS=CONTROLLER://:29093,PLAINTEXT://:9092,PLAINTEXT_HOST://:29092"
- "KAFKA_PROCESS_ROLES=broker,controller"
- "KAFKA_CONTROLLER_LISTENER_NAMES=CONTROLLER"
- "KAFKA_CONTROLLER_QUORUM_VOTERS=1@localhost:29093"
volumes:
- "oci_kafka_data:/var/lib/kafka/data"

volumes:
oci_kafka_data:
name: "{COMPOSE_PROJECT_NAME}_kafka"
1 change: 1 addition & 0 deletions profiles/kafka/pulp_config.env
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
PULP_KAFKA_BOOTSTRAP_SERVERS=kafka:9092

0 comments on commit 090a205

Please sign in to comment.