Kafka 4.2.0 on Kubernetes - Complete Setup Guide - Exposed to Internet
3-broker Kafka cluster on k3s with KRaft, SASL/SCRAM, and external access via Traefik. Before you start — get your Traefik IP: kubectl get svc traefik -n kube-system Copy any IP from the EXTERNAL-I...

Source: DEV Community
3-broker Kafka cluster on k3s with KRaft, SASL/SCRAM, and external access via Traefik. Before you start — get your Traefik IP: kubectl get svc traefik -n kube-system Copy any IP from the EXTERNAL-IP column. Replace every occurrence of 192.168.1.119 in the YAMLs below with your actual IP. Stage 1 — Bootstrap Apply all of these files in order. This stage starts the cluster with port 9094 open (no auth) so you can register SCRAM credentials. 1.1 namespace.yaml apiVersion: v1 kind: Namespace metadata: name: kafka kubectl apply -f namespace.yaml 1.2 kafka-jaas.yaml apiVersion: v1 kind: ConfigMap metadata: name: kafka-jaas namespace: kafka data: jaas.conf: | KafkaServer { org.apache.kafka.common.security.scram.ScramLoginModule required username="admin" password="supersecret"; }; kubectl apply -f kafka-jaas.yaml 1.3 kafka-sasl.yaml apiVersion: v1 kind: Secret metadata: name: kafka-sasl namespace: kafka type: Opaque stringData: username: admin password: supersecret kubectl apply -f kafka-sasl.