kafka-dev
A Helm chart for installing a single node Kafka (and Zookeeper) pod for development and testing purposes.
About this chart
kafka-single-node
This chart should only be used for local development of charts that require a running Kafka cluster. It will create single node Zookeeper and single broker Kafka pods, and expose the Kafka cluster via a nodePort.
Note: As of Kubernetes v1.16 (July 2019), deployments have been removed from the
extensions/v1beta1, apps/v1beta1, and apps/v1beta2 APIs. See the
Kubernetes Blog announcement
for more details. Use kafka-dev chart >= 0.0.5 if you are using a newer
Kubernetes version.
Internal Kafka Clients
Internal (kubernetes) cluster Kafka clients should connect to Kafka at kafka.default.svc.cluster.local:<kafka_internal_port> (default 31092).
External Kafka Clients
In docker-desktop
docker-desktop routes nodePorts through 'localhost'. Set
kafka_advertised_host: '127.0.0.1'
in values.yaml.
External Kafka clients will need to connect to 127.0.0.1:<kafka_external_port>.
Or helm install this chart with --set kafka.advertised_host_name=127.0.0.1
In minikube
Minikube has it's own node IP that should be used to connect to Kafka. Get the value of $(minikube ip), and set it Set
kafka_advertised_host: <minikube ip here>
in values.yaml.
Or helm install this chart with --set kafka.advertised_host_name=$(minikube ip)
External Kafka clients will need to connect to $(minikube ip):<kafka_external_port>.
NOTE: To get Kafka to work in recent versions of minikube, you need to run
minikube ssh
sudo ip link set docker0 promisc on
See Stack Overflow: Kafka inaccessible once inside Kubernetes/Minikube for more info.
This chart uses the wurtmeister zookeeper and kafka docker images.
In minikube on MacOS with Docker Desktop
On MacOS, minikube runs in a docker container of its own. We need to port forward to reach this host.
Set
kafka_advertised_host: '127.0.0.1'
in values.yaml.
Run
kubectl port-forward svc/kafka-external <kafka_external_port>
External Kafka clients will need to connect to 127.0.0.1:<kafka_external_port>.
Deploy kafka-dev with OpenTenant
Each tenant gets its own release of this chart, with its own namespace, secrets and domain. The builder below already has kafka-dev on a Hetzner server. Change the host, add apps from the marketplace, then copy the generated files. Providers and prices are samples, and nothing here is sent anywhere.
- Pick a serverConnect Hetzner, OVHcloud or AWS. The builder starts on Hetzner, the cheapest sample rate.
- Place the chartkafka-dev is pinned at v0.2.0 in opentenant.yaml. Drag more apps from the marketplace onto a rack.
- ApplySave opentenant.yaml and main.tf from the console, then run the commands below.
# opentenant.yaml, main.tf and dns.tf come from the builder below opentenant validate opentenant.yaml terraform init && terraform apply