Search code examples
google-cloud-platformapache-kafkagoogle-kubernetes-enginekubernetes-helm

Helm Kafka, can't change the port for Kubernetes pod


I created a kubernetes cluster (GCP GKE) with 2 nodes. I set up zookeeper for druid (port 2181) I works fine, but, I want to deploy kafka pod in the same cluster. So I use helm, but when I change the port at the end of the script values.yaml, I run helm upgrade like this

helm upgrade kafka -n gke-k8s bitnami/kafka -f values_kafka.yaml

And the pod kafka zookeeper always running in the port 2181 when I use describe pod, even if I delete it or recreate it. At the same time kafka broker pod have the status "CrashLoopBackOff" after update values.yaml

I use this file values.yaml https://github.com/bitnami/charts/blob/master/bitnami/kafka/values.yaml

And change it with

...
##
zookeeper:
  enabled: true
  port: 2180
  auth:
    ## Enable Zookeeper auth
    ##
    enabled: false
...

Solution

  • I believe the value in the ZK chart you need to set is actually service.port.

    So in your Kafka values, it should be

    ...
    ##
    zookeeper:
      enabled: true
      service:
        port: 2180
      auth:
        ## Enable Zookeeper auth
        ##
        enabled: false
    ...