kafka

by SVTECH-NMAA

Helm chartv0.2.1App 1.16.0Verified publisher

A Helm chart for Kubernetes

About this chart

Kafka Chart

This chart defines a Kafka cluster as Kubernetes objects and it depends on the Strimzi Kafka Operator, which is available at https://strimzi.io/docs/ In detail:

  • The Kafka Object is created to define the Kafka cluster (replicas, version, listeners, config, etc.) and Zookeeper cluster (storage, resources, replicas, etc.)

Tree level

+--- Chart.yaml : Chart information and dependencies (you can use as {{ .Chart }} variable on template files )
+--- README.md
+--- templates : define your template files in this folder
|   +--- kafka.yaml
|   +--- *.tpl : define your custom template variable here, and you can create new file .tpl
+--- values.yaml : define {{ .Values }} variable to use in template files

How to use

  • Install strimzi Operator:

    wget https://github.com/strimzi/strimzi-kafka-operator/releases/download/0.45.0/strimzi-cluster-operator-0.45.0.yaml
    sed 's/myproject/netflows/' strimzi-cluster-operator-0.45.0.yaml > strimzi.yaml
    kubectl apply -f strimzi.yaml
    
  • Clone this Charts repo to /opt:

    cd /opt
    git clone https://github.com/svtechnmaa/charts.git
    
  • Edit values.yaml at /opt/charts/kubernetes/kafka/values.yaml with the pre configuration parameter is listed:

ParameterDescriptionDefault
global.kafka.topicDefine Kafka topic, must defined in global to reuse in another charts (like akvorado,...)clickhouse
kafka.config.offsets_topic_replication_factorSpecifies the replication factor for the internal __consumer_offsets topic3
kafka.config.transaction_state_log_replication_factorSets the replication factor for the internal __transaction_state topic2
kafka.config.transaction_state_log_min_isrSpecifies the minimum number of in-sync replicas (ISR) required for the __transaction_state topic before a producer can write to it2
kafka.config.socket.request.max.bytesDefines the maximum size (in bytes) of a request that the broker will accept over the network.419430400
kafka.config.default_replication_factorSets the default replication factor for new topics created without explicitly specifying a replication factor3
kafka.config.min_insync_replicaSpecifies the minimum number of in-sync replicas required for a topic’s partitions before a producer can write to them2
kafka.config.log_retention_hoursDetermines how long (hours) Kafka retains messages in topic logs before deleting them24
  • Start chart alone:

    helm install kafka /opt/charts/kubernetes/kafka \
        --namespace kafka \
        --create-namespace
    
  • Uninstallation:

    helm uninstall kafka \
        --namespace kafka
    

Deploy kafka with OpenTenant

Each tenant gets its own release of this chart, with its own namespace, secrets and domain. The builder below already has kafka 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.

  1. Pick a serverConnect Hetzner, OVHcloud or AWS. The builder starts on Hetzner, the cheapest sample rate.
  2. Place the chartkafka is pinned at v0.2.1 in opentenant.yaml. Drag more apps from the marketplace onto a rack.
  3. 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