ches / docker-kafka

Apache Kafka on Docker
https://hub.docker.com/r/ches/kafka/
146 stars 137 forks source link

Kubernetes #34

Open xrl opened 7 years ago

xrl commented 7 years ago

Kubernetes StatefulSet support is easiest when pulling the broker id out of the hostname pattern

$HOSTNAME="kafka-1" should be broker-id 1

So the start.sh script pulls that out of there with sed. If you set $KAFKA_BROKER_ID before start.sh runs, it'll honor that value.

I upgraded the server.properties.template with the latest from the kafka tar.gz, backporting the config vars and pruning deprecated ones:

xrl commented 7 years ago

This PR has been made worse by Kafka's bug with lost+found folders -- those appear in the root of all Linux filesystems. And I am using Kubernetes for it's dynamic volume management. I get that it wants to control the data directory but it's pretty silly for it to bomb out when it sees folders it doesn't know about. See: https://issues.apache.org/jira/browse/KAFKA-742. This PR includes a work around but I fear it is not backwards compatible with people's existing volumes. Advice would be helpful!