We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
bitnami/kafka:latest
arm64
Running on M1 Mac with Docker compose docker-compose.yaml
version: "3.8" networks: kafka-pipeline: driver: bridge services: kafka: image: 'bitnami/kafka:latest' restart: always healthcheck: test: ["CMD-SHELL", "nc -z localhost 9092 || exit 1"] start_period: 10s interval: 5s timeout: 10s retries: 5 networks: - kafka-pipeline ports: - '9092:9092' - '9093:9093' environment: - KAFKA_ENABLE_KRAFT=yes - KAFKA_CFG_NODE_ID=1 - KAFKA_CFG_PROCESS_ROLES=broker,controller - KAFKA_CFG_CONTROLLER_LISTENER_NAMES=CONTROLLER - KAFKA_CFG_INTER_BROKER_LISTENER_NAME=PLAINTEXT - KAFKA_CFG_LISTENER_SECURITY_PROTOCOL_MAP=CONTROLLER:PLAINTEXT,PLAINTEXT:PLAINTEXT - KAFKA_CFG_LISTENERS=PLAINTEXT://kafka:9092,CONTROLLER://kafka:9093 - KAFKA_CFG_ADVERTISED_LISTENERS=PLAINTEXT://kafka:9092 - KAFKA_CFG_CONTROLLER_QUORUM_VOTERS=1@kafka:9093 - ALLOW_PLAINTEXT_LISTENER=yes - KAFKA_CFG_AUTO_CREATE_TOPICS_ENABLE=true - BITNAMI_DEBUG=TRUE producer: build: context: ./Producer dockerfile: dockerfile container_name: python-producer depends_on: kafka: condition: service_healthy ports: - 8001:8001 networks: - kafka-pipeline environment: - KAFKA_TOPIC_NAME=topic - KAFKA_SERVER=kafka - KAFKA_PORT=9092
python producer to run when docker-compose health check dependency returns service_healthy
dependency failed to start: container kafka is unhealthy
Does not appear that the health check runs at all probably an issue with configuration?
The text was updated successfully, but these errors were encountered:
Hi @justjooste,
The bitnami/kafka image does not have the netcat package installed. That is why the healthcheck will fail:
bitnami/kafka
I have no name!@cc9e95cdd14d:/$ nc -z localhost 9092 bash: nc: command not found
In case it helps, maybe the following command helps you perform a healthcheck, although it is more complex than checking the port is open:
kafka-topics.sh --bootstrap-server kafka:9092 --topic hc --create --if-not-exists && kafka-topics .sh --bootstrap-server kafka:9092 --topic hc --describe
Sorry, something went wrong.
I have used something similar to the above command provided by @migruiz4 and the health check is now working as intended. Thanks!
migruiz4
No branches or pull requests
Name and Version
bitnami/kafka:latest
What architecture are you using?
arm64
What steps will reproduce the bug?
Running on M1 Mac with Docker compose
docker-compose.yaml
What is the expected behavior?
python producer to run when docker-compose health check dependency returns service_healthy
What do you see instead?
Additional information
Does not appear that the health check runs at all
probably an issue with configuration?
The text was updated successfully, but these errors were encountered: