Appendix B: Compose to Kubernetes
The effective settings of Kafka and PostgreSQL read from a fresh compose stack and from fresh Kubernetes namespaces, compared against a list of expected differences.
examples/ab-compose-to-kubernetes/ has no Java. It starts the Kafka and PostgreSQL of examples/_infra on compose, then the Kafka resource and the CloudNativePG Cluster of examples/_k8s on minikube, reads 13 broker settings and 5 PostgreSQL settings from each, and compares them. It accompanies Appendix B.
It uses docker compose, minikube, Strimzi, CloudNativePG and kubectl, with the files of _infra and _k8s as they are.
cd examples/ab-compose-to-kubernetes
./verify.sh compose
./verify.sh k8s
./verify.sh compare
What to observe
- Files agree with the running systems. Every setting a compose file, the Kafka resource or the postgres command line sets is what the system reports; every setting left unset is the documented default.
- An empty capture fails. A node id that is not a broker prints nothing; the capture check rejects it.
- Four listed differences. The
shareprotocol, the share state topicβs two settings andmax_replication_slotsdiffer, and the comparison names them. - Any other difference fails. With
DRIFT=partitions, the compose broker reports 6 partitions and the comparison fails on it.
Infrastructure
The compose half runs Kafka and PostgreSQL only. The Kubernetes half runs the Strimzi operator, one Kafka cluster with two node pools and one CloudNativePG Cluster on the edp profile; no application and no LGTM.