How rafaelmnatali/kafka-k8s works
The project is a tutorial resource that demonstrates how to run Apache Kafka (v3.5.x) on a Kubernetes (Minikube) environment using different security and configuration setups. It covers various deployment configurations including a basic local Confluent installation, Kafka with SSL, Kafka with SASL authentication, and Kafka with SASL along with ACLs.
Main components
• Kubernetes Cluster (Minikube): This is the hosting environment.
• Kafka Clusters: There are multiple variants shown by the directories – confluent-local, ssl, sasl, and acls. Each variant represents a different deployment configuration.
• Configuration Resources: YAML files (e.g., 00-namespace.yaml, 01-kafka.yaml, and 02-kafka-client.yaml) that are used to provision the necessary Kubernetes objects for each Kafka variant.
• Scripts: Additional automation such as the kafka-reassign.sh script, which interacts with Kafka’s internal management (like partition reassignments).
Relationships and interactions
• The Kubernetes cluster hosts all deployments. Within this cluster, different namespaces or sets of resources are configured using the provided YAML files.
• Each deployment variant (e.g., Kafka with SSL or SASL) can be visualized as a branch that includes both Kafka server configuration and its corresponding client configuration (often separated into files like 01-kafka.yaml and 02-kafka-client.yaml).
• Security-related configurations (SSL properties, SASL properties, ACL definitions) are applied to the respective Kafka variants. For example, the “sasl” and “acls” folders show how SASL authentication and ACLs are layered on top of a basic Kafka deployment.
• The “confluent-local” directory represents a standard, non-secured deployment scenario with possible additional local configurations.
Important architectural patterns
• Configuration as Code: Using YAML files to define the namespaces and Kafka resources is a core principle here.
• Environment-specific Deployment: The separation into distinct directories indicates an architecture that is modular, allowing you to swap between different security setups (SSL, SASL, ACLs). This modularity could be represented as isolated “deployment stacks” within the same overall Kubernetes environment.
• Script-driven management: The provided shell script in the “scripts” directory demonstrates operational management (e.g., reassigning partitions), indicating a separation between deployment configuration and administrative operations.
Relevant technologies and frameworks
• Kubernetes (via Minikube) as the container orchestration platform.
• Apache Kafka (with its KRaft consensus protocol) as the messaging backbone.
• Confluent components for rapid setup in the local mode.
• Security technologies like SSL certificates and SASL mechanisms used in securing Kafka clusters.
• YAML configuration files to define runtime components.
Elements
• Clear labels for every component (e.g., “Kubernetes Cluster”, “Confluent-Local Kafka Deployment”, “Kafka with SSL”, etc.).
• Rectangles for infrastructure components (Kubernetes Cluster, Kafka brokers).
Conclusion
This detailed approach will help a principal software engineer quickly grasp the architectural layout of the repository and understand how each component fits into the overall Kafka on Kubernetes environment.