-
-
Notifications
You must be signed in to change notification settings - Fork 104
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Docs: Add compose example using confluent-local docker image #821
Open
scprek
wants to merge
2
commits into
kafbat:main
Choose a base branch
from
scprek:docs/compose-confluent-local-example
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from 1 commit
Commits
Show all changes
2 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,14 +1,15 @@ | ||
# Descriptions of docker-compose configurations (*.yaml) | ||
|
||
1. [kafka-ui.yaml](./kafbat-ui.yaml) - Default configuration with 2 kafka clusters with two nodes of Schema Registry, one kafka-connect and a few dummy topics. | ||
2. [kafka-ui.yaml](../../.dev/dev_arm64.yaml) - Default configuration with 1 kafka cluster without zookeeper with one node of Schema Registry, one kafka-connect and a few dummy topics. | ||
3. [kafka-ui-ssl.yml](./kafka-ssl.yml) - Connect to Kafka via TLS/SSL | ||
4. [kafka-cluster-sr-auth.yaml](./cluster-sr-auth.yaml) - Schema registry with authentication. | ||
5. [kafka-ui-auth-context.yaml](./auth-context.yaml) - Basic (username/password) authentication with custom path (URL) (issue 861). | ||
6. [e2e-tests.yaml](./e2e-tests.yaml) - Configuration with different connectors (github-source, s3, sink-activities, source-activities) and Ksql functionality. | ||
7. [kafka-ui-jmx-secured.yml](./ui-jmx-secured.yml) - Kafka’s JMX with SSL and authentication. | ||
8. [kafka-ui-reverse-proxy.yaml](./nginx-proxy.yaml) - An example for using the app behind a proxy (like nginx). | ||
9. [kafka-ui-sasl.yaml](./ui-sasl.yaml) - SASL auth for Kafka. | ||
10. [kafka-ui-traefik-proxy.yaml](./traefik-proxy.yaml) - Traefik specific proxy configuration. | ||
11. [kafka-ui-with-jmx-exporter.yaml](./ui-with-jmx-exporter.yaml) - A configuration with 2 kafka clusters with enabled prometheus jmx exporters instead of jmx. | ||
12. [kafka-with-zookeeper.yaml](./kafka-zookeeper.yaml) - An example for using kafka with zookeeper | ||
2. [kafka-ui-kraft-rest-proxy.yaml](./kafka-ui-kraft-rest-proxy.yaml) - Default configuration with 1 kafka cluster via the confluent-local docker image which autoconfigures Kraft mode and the Kafka REST proxy. | ||
3. [kafka-ui.yaml](../../.dev/dev.yaml) - Default configuration with 1 kafka cluster without zookeeper with one node of Schema Registry, one kafka-connect and a few dummy topics. | ||
4. [kafka-ui-ssl.yml](./kafka-ssl.yml) - Connect to Kafka via TLS/SSL | ||
5. [kafka-cluster-sr-auth.yaml](./cluster-sr-auth.yaml) - Schema registry with authentication. | ||
6. [kafka-ui-auth-context.yaml](./auth-context.yaml) - Basic (username/password) authentication with custom path (URL) (issue 861). | ||
7. [e2e-tests.yaml](./e2e-tests.yaml) - Configuration with different connectors (github-source, s3, sink-activities, source-activities) and Ksql functionality. | ||
8. [kafka-ui-jmx-secured.yml](./ui-jmx-secured.yml) - Kafka’s JMX with SSL and authentication. | ||
9. [kafka-ui-reverse-proxy.yaml](./nginx-proxy.yaml) - An example for using the app behind a proxy (like nginx). | ||
10. [kafka-ui-sasl.yaml](./ui-sasl.yaml) - SASL auth for Kafka. | ||
11. [kafka-ui-traefik-proxy.yaml](./traefik-proxy.yaml) - Traefik specific proxy configuration. | ||
12. [kafka-ui-with-jmx-exporter.yaml](./ui-with-jmx-exporter.yaml) - A configuration with 2 kafka clusters with enabled prometheus jmx exporters instead of jmx. | ||
13. [kafka-with-zookeeper.yaml](./kafka-zookeeper.yaml) - An example for using kafka with zookeeper |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
--- | ||
version: '3.4' | ||
services: | ||
# Based on https://github.com/confluentinc/kafka-images/blob/master/examples/confluent-local/docker-compose.yml but | ||
# removed the env var defaults that work as-is with Kafka UI. | ||
kafka0: | ||
# Pre-configured image for Kraft mode and REST Proxy | ||
# See: https://docs.confluent.io/platform/current/installation/docker/image-reference.html#ak-images | ||
image: confluentinc/confluent-local:latest | ||
hostname: kafka0 | ||
container_name: kafka0 | ||
ports: | ||
- "9092:9092" | ||
- "8082:8082" | ||
environment: | ||
# Normally you do not have to specify all these environment variables, but we are doing it to make kafka-ui work | ||
# as the defaults are all localhost instead of a docker compose service name | ||
# See: Defaults https://github.com/confluentinc/kafka-images/blob/master/local/include/etc/confluent/docker/configureDefaults | ||
KAFKA_ADVERTISED_LISTENERS: 'PLAINTEXT://kafka0:29092,PLAINTEXT_HOST://localhost:9092' | ||
KAFKA_CONTROLLER_QUORUM_VOTERS: '1@kafka0:29093' | ||
KAFKA_LISTENERS: 'PLAINTEXT://kafka0:29092,CONTROLLER://kafka0:29093,PLAINTEXT_HOST://0.0.0.0:9092' | ||
KAFKA_REST_BOOTSTRAP_SERVERS: 'kafka0:29092' | ||
kafbat-ui: | ||
container_name: kafbat-ui | ||
image: ghcr.io/kafbat/kafka-ui:latest | ||
depends_on: | ||
- kafka0 | ||
ports: | ||
- "8080:8080" | ||
environment: | ||
KAFKA_CLUSTERS_0_NAME: local | ||
KAFKA_CLUSTERS_0_BOOTSTRAPSERVERS: kafka0:29092 | ||
kafka-init-topics: | ||
# Not using confluent-local image because it doesn't have all the shell commands installed (e.g. cub and kafka-topics) | ||
image: confluentinc/cp-kafka:latest | ||
depends_on: | ||
- kafka0 | ||
command: "bash -c 'set -e && echo Waiting for Kafka to be ready... && \ | ||
cub kafka-ready -b kafka0:29092 1 30 && \ | ||
kafka-topics --create --topic second.users --partitions 3 --replication-factor 1 --if-not-exists --bootstrap-server kafka0:29092 && \ | ||
kafka-topics --create --topic second.messages --partitions 2 --replication-factor 1 --if-not-exists --bootstrap-server kafka0:29092 && \ | ||
kafka-topics --create --topic first.messages --partitions 2 --replication-factor 1 --if-not-exists --bootstrap-server kafka0:29092'" | ||
|
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I couldn't find a way to "hack" docker compose to treat kafka0 interactions from the other services as
localhost
(the default env vars in the image). So I ended up just overriding all ENV vars that had localhost in it that were required for Kafka UI and init kafka topics to work.