Skip to Main Content

Kafka Helm Chart: Download & Usage &Best Practices

Overview

Deploying Apache Kafka on Kubernetes can be streamlined significantly through Helm charts, which package all the necessary Kubernetes resources into reusable templates. This comprehensive guide explores the landscape of Kafka Helm charts, including options from major providers, installation procedures, configuration options, and best practices for production deployments.

Understanding Kafka Helm Charts and Deployment Options

Helm serves as a package manager for Kubernetes, similar to apt for Linux or Brew for macOS. Helm charts contain pre-configured Kubernetes resources (Deployments, Services, StatefulSets, etc.) needed to deploy applications like Kafka on Kubernetes[13]. For those deploying Kafka on Kubernetes, two primary approaches exist: Helm charts and Kubernetes operators.

Helm Charts vs. Operators

Helm charts provide a simpler, more flexible approach for deploying Kafka. You control Kafka through Helm commands and must handle day-to-day operations yourself. This offers considerable freedom in configuration but requires more manual management[12].

Operators, on the other hand, implement the Kubernetes operator pattern and provide more sophisticated automation. They not only handle installation but also manage day-2 operations like scaling, updates, and failures. As explained by Datadog, "Operators provide a more sophisticated and automated approach to managing applications by applying operational knowledge throughout their lifetime"[15].

The choice between them depends on your specific needs:

  • Helm charts are best for simple deployments where you need flexibility and are comfortable managing Kafka

  • Operators are ideal for complex environments requiring automated management and custom lifecycle operations[15]

Major Kafka Helm Chart Providers

Confluent Platform Helm Charts

Confluent, the company founded by Kafka's creators, offers Helm charts for deploying Confluent Platform components on Kubernetes. These charts enable developers to quickly provision Apache Kafka, ZooKeeper, Schema Registry, REST Proxy, and Kafka Connect[2].

Note that the original cp-helm-charts repository is now deprecated in favor of Confluent for Kubernetes (CFK), their Kubernetes operator solution. The original charts were designed for development, test, and proof of concept environments[4].

Bitnami Kafka Helm Chart

Bitnami offers a well-maintained Kafka Helm chart that follows best practices for security, efficiency, and performance. It provides comprehensive configuration options for credentials management, persistence settings, and cluster deployment[3].

Downloading and Installing Kafka Helm Charts

Adding Repositories and Basic Installation

For most Kafka Helm charts, the installation process follows a similar pattern:

  1. Add the chart repository to your Helm configuration

  2. Update repositories

  3. Install the chart with desired configurations

Confluent Platform Example:


helm repo add confluentinc <https://confluentinc.github.io/cp-helm-charts/> helm repo update helm install my-confluent confluentinc/cp-helm-charts --version 0.6.0

Note that this installs the deprecated chart version. For new deployments, Confluent recommends using their Kubernetes operator.

Bitnami Example:

To install Kafka using the Bitnami Helm chart, follow these steps:

  1. Add the Bitnami Helm Repository :

helm repo add bitnami <https://charts.bitnami.com/bitnami>

  1. Update Helm Repositories :

helm repo update

  1. Install the Kafka Chart :

helm install my-kafka bitnami/kafka

You can customize the installation by specifying additional parameters. For example, to enable external access via a NodePort service:


helm install kafka bitnami/kafka \
--set externalAccess.enabled=true \
--set externalAccess.controller.service.type=NodePort \
--set externalAccess.controller.service.ports.external=9094

This command installs Kafka with external access enabled and exposes the Kafka service on port 9094.

Common Configurations and Customizations

Persistence Configuration

Persistence configuration is crucial for Kafka deployments. Most Helm charts allow configuring:

  1. Storage class

  2. Volume size

  3. Retention policies

In Bitnami's chart, for example, you'll encounter issues if you don't properly manage storage persistence. The chart typically creates PersistentVolumeClaims (PVCs) that remain even after uninstalling the chart[3][11].

External Access Configuration

Providing external access to Kafka requires specific configuration. In the Redpanda Helm chart, you can set external.type to either "NodePort" or "LoadBalancer" depending on your infrastructure needs[9].

ZooKeeper Configuration

Many Kafka charts deploy ZooKeeper by default, but allow disabling it if you want to use an existing ZooKeeper ensemble:


helm install kafka rhcharts/kafka --set zookeeper.enabled=false --set zookeeper.url="your-zookeeper:2181"

Broker Configuration

You can customize broker settings through the values file. Common configurations include:

  • Replica count

  • Resource limits (CPU, memory)

  • Log retention policies

  • Authentication settings

Best Practices for Kafka Helm Chart Deployment

Using Separated Storage and Compute in Kafka for Better Operations and Scaling

Kubernetes is primarily designed for cloud-native stateless applications. The main challenge of running Kafka on Kubernetes lies in its architecture that couples compute and storage, with strong dependency on local disks. This makes Kafka difficult to manage and scale on Kubernetes. With the continuous evolution of the Kafka ecosystem, you can now choose next-generation storage-compute separated Kafka solutions like AutoMQ. AutoMQ is built entirely on S3, with complete separation of compute and storage. The stateless Broker significantly reduces the management complexity of Kafka on Kubernetes.

Topic Configuration

For optimal Kafka performance, consider these topic best practices[13]:

  1. Partition Replication : Maintain 2+ replicas for each partition to ensure fault tolerance

  2. Partition Count : Keep total partitions for a topic below 10 and cluster-wide below 10,000

  3. Message Size Control : Messages should not exceed 1GB to avoid increased seek time

  4. Mission-Critical Topics : Isolate high-throughput topics to the most performant brokers

  5. Cleanup Policy : Establish clear policies for deleting unused topics

Resource Allocation

Properly allocate resources to ensure Kafka performs optimally:

  1. CPU and Memory : Allocate sufficient resources based on expected throughput

  2. Storage : Provision adequate persistent storage for logs and data

  3. Network : Ensure network policies allow required communication

Monitoring and Metrics

Most Kafka charts support exposing metrics for monitoring. For example, the Conduktor Helm chart includes options for Prometheus metrics integration[17]:

textmetrics: enabled: true serviceMonitor: enabled: true interval: 30s

This configuration creates a ServiceMonitor resource for Prometheus to scrape metrics from Conduktor[17].

Upgrade Considerations

When upgrading Kafka versions through Helm, follow a staged approach as demonstrated in Axual's documentation[10]:

  1. Update configuration values first

  2. Perform the Helm upgrade

  3. Verify services are running correctly before proceeding

  4. For major version upgrades, consider updating inter-broker protocol version in a separate step

Troubleshooting Common Issues

Persistence and Storage Issues

Storage issues are among the most common problems with Kafka on Kubernetes. If you're experiencing issues with the Bitnami Kafka chart:

  1. Check storage provisioning and ensure PVCs are correctly bound

  2. Monitor disk usage to avoid running out of space

  3. Consider implementing proper log retention policies

  4. For log persistence, use the logPersistence.size parameter to adjust the volume size[11]

Configuration Errors During Upgrades

When upgrading Helm chart releases with stateful applications like Kafka, credential errors can occur if you relied on Helm to generate random passwords. Best practices include:

  1. Explicitly setting credentials in your values file

  2. Using existing Secrets (created before installation)

  3. Never relying on random generation for production environments[3]

Scaling and Performance Problems

If experiencing performance issues:

  1. Check broker resource utilization

  2. Monitor network throughput

  3. Analyze topic partitioning strategy

  4. Consider using a Kafka operator for complex scaling scenarios

Debugging Tools

For troubleshooting Kafka issues, consider deploying auxiliary tools:

Kafkacat for Event Viewing

The OpenCORD guide suggests deploying a kafkacat container for diagnostic purposes:


helm install -n kafkacat cord/kafkacat

Once deployed, you can exec into the pod to run commands like:


kafkacat -b kafka -L # List topics kafkacat -b kafka -C -t your-topic # Listen for events

This helps in debugging Kafka event flow issues[8].

Conclusion

Helm charts provide a powerful way to deploy and manage Kafka on Kubernetes, offering flexibility and consistency across environments. While several options exist—from Confluent's platform to Bitnami's chart to newer alternatives like Redpanda—the choice depends on your specific requirements and comfort with Kubernetes operations.

For simpler deployments where customization is important, Helm charts offer an excellent solution. For complex, production-grade deployments requiring sophisticated automation, consider Kubernetes operators like Confluent for Kubernetes or Strimzi.

Regardless of your choice, following best practices for topic configuration, resource allocation, and monitoring will help ensure a stable, performant Kafka deployment on Kubernetes. Always consider your specific use case, expected throughput, and operational capabilities when choosing between deployment options.

If you find this content helpful, you might also be interested in our product AutoMQ. AutoMQ is a cloud-native alternative to Kafka by decoupling durability to S3 and EBS. 10x Cost-Effective. No Cross-AZ Traffic Cost. Autoscale in seconds. Single-digit ms latency. AutoMQ now is source code available on github. Big Companies Worldwide are Using AutoMQ. Check the following case studies to learn more:

References:

  1. Kafka Helm Chart by Ricardo Aires

  2. Getting Started with Apache Kafka on Kubernetes

  3. Bitnami Helm Chart Troubleshooting Guide

  4. Confluent Platform Helm Charts

  5. Redpanda Kubernetes Deployment Guide

  6. Conductor OSS for DPG Payment Hub

  7. Confluent Platform Kafka Chart Documentation

  8. CORD Kafka Chart Guide

  9. Redpanda Helm Chart Reference

  10. Axual Helm Chart Upgrade Guide

  11. Managing Bitnami Kafka Storage Persistence

  12. Kafka Operator vs Helm Chart Comparison

  13. Expert's Guide to Kafka on Kubernetes

  14. Conduktor Public Helm Charts

  15. Datadog Operator and Helm Guide

  16. Conduktor Kubernetes Installation Guide

  17. Conduktor Console Values Configuration

  18. Top 3 Challenges with Helm Charts

  19. Confluent Platform External Kafka Configuration

  20. Redpanda Helm Charts Repository

  21. Using Helm with Strimzi

  22. Bitnami Kafka Chart Documentation

  23. OpenShift Confluent External Connection Guide

  24. Confluent for Kubernetes Deployment Guide

  25. Configuring Redpanda Helm Chart

  26. Deploying Kafka UI with Helm Charts

  27. Kafka on Kubernetes Best Practices

  28. Conduktor Helm Repository

  29. Bitnami Kafka Helm Package

  30. AWS Marketplace Kafka Solutions

  31. Troubleshooting Confluent Platform Download Issues

  32. Exposing Redpanda Kafka Externally

  33. Deploying Kafka on Kubernetes Guide

  34. Confluent Operator Troubleshooting Guide

  35. Getting Started with Redpanda in Kubernetes

  36. Common Kafka Problems Discussion

  37. Confluent Platform Chart Issues

  38. Redpanda Cloud Guide

  39. Bitnami Charts Issue Tracker

  40. Setting Kafka ZooKeeper Volume Sizes

  41. Scaling Kafka Streams Applications

  42. Kubernetes Operators vs Helm Comparison

  43. Bitnami Charts Discussion

  44. Bitnami Charts Recent Issues

  45. Why Use Kubernetes Operators

  46. Kafka on Kubernetes Video Guide

  47. Dapr Kubernetes Deployment Guide

  48. Troubleshooting Kafka-ZooKeeper Communication

  49. Debugging Kafka Message Reading Issues

  50. Schema Registry WakeupException Solutions

  51. VMware Tanzu Best Practices Guide

  52. Kafka Local Persistent Volume Guide

  53. Apache Airflow Production Guide

  54. Confluent Operator Overview