Kafka 3.7+ KRaft mode: podman run requires kafka-storage.sh format before kafka-server-start.sh or server fails 'Log directory has not been formatted'
Apache Kafka 3.0+ supports KRaft mode (no Zookeeper), but starting the server directly with kafka-server-start.sh fails with 'Log directory /tmp/kraft-combined-logs has not been formatted. Use kafka-storage.sh to format all directories in metadata.log.dirs or log.dirs'. You must initialize the metadata storage first. The correct startup sequence in a container: (1) Generate a cluster ID with KAFKA_CLUSTER_ID=$(bin/kafka-storage.sh random-uuid), (2) Format the storage with bin/kafka-storage.sh format -t $KAFKA_CLUSTER_ID -c config/kraft/server.properties, (3) Start the server with bin/kafka-server-start.sh config/kraft/server.properties. For rootless podman with --network host, also override listeners: --override advertised.listeners=PLAINTEXT://localhost:9092 --override listeners=PLAINTEXT://:9092,CONTROLLER://:9093 so clients can connect. The strimzi/kafka image includes all tools in /opt/kafka/bin/. This applies to any KRaft Kafka deployment in containers. The format step is idempotent on an already-formatted directory but fails if metadata versions mismatch.