Search code examples
kubernetesapache-kafkakubernetes-helmakhq

AKHQ: Couldn't find any clusters on your configuration file, please ensure that the configuration file is loaded correctly


My Kafka bootstrap server in Kubernetes is at hm-kafka-kafka-bootstrap.hm-kafka.svc:9092.

I am trying to deploy AKHQ in my Kubernetes cluster. Here are my steps:

helm upgrade \
  akhq \
  akhq \
  --install \
  --repo=https://akhq.io \
  --namespace=hm-akhq \
  --create-namespace \
  --values=my-values.yaml

my-values.yaml

akhq:
  connections:
    hm-kafka:
      properties:
        bootstrap.servers: hm-kafka-kafka-bootstrap.hm-kafka.svc:9092

I created this my-values.yaml is based on this. However, I am sure I use it correctly.

Then I port forwarded by kubectl port-forward service/akhq --namespace=hm-akhq 8080:80

However, when I open localhost:8080, the page shows

{
  "message": "Couldn't find any clusters on your configuration file, please ensure that the configuration file is loaded correctly",
  "_links": {
    "self": {
      "href": "/",
      "templated": false
    }
  }
}

I have read these tickets with same error

But I didn't find any solution inside to solve my issue. Any guide would be appreciate. Thanks!


Solution

  • Thanks @OneCrckerteer help! The comments inside this section of values.yaml and akhq.connections under secrets originally confused me:

    ## You can put directly your configuration here... or add java opts or any other env vars
    extraEnv: []
    # - name: AKHQ_CONFIGURATION
    #   value: |
    #       akhq:
    #         secrets:
    #           docker-kafka-server:
    #             properties:
    #               bootstrap.servers: "kafka:9092"
    # - name: JAVA_OPTS
    #   value: "-Djavax.net.ssl.trustStore=/opt/java/openjdk/lib/security/cacerts -Djavax.net.ssl.trustStorePassword=password"
    # - name: CLASSPATH
    #   value: "/any/additional/jars/desired.jar:/go/here.jar"
    
    ## Or you can also use configmap for the configuration...
    configuration:
      akhq:
        server:
          access-log:
            enabled: false
            name: org.akhq.log.access
    
    ##... and secret for connection information
    existingSecrets: ""
    # name of the existingSecret
    secrets: {}
    #  akhq:
    #    connections:
    #      my-cluster-plain-text:
    #        properties:
    #          bootstrap.servers: "kafka:9092"
    #        schema-registry:
    #          url: "http://schema-registry:8085"
    #          type: "confluent"
    #          basic-auth-username: basic-auth-user
    #          basic-auth-password: basic-auth-pass
    #        connect:
    #          - name: "my-connect"
    #            url: "http://connect:8083"
    #            basic-auth-username: basic-auth-user
    #            basic-auth-password: basic-auth-pass
    

    akhq.connections should be under configuration instead of secrets. And here is the final working version:

    helm upgrade \
      akhq \
      akhq \
      --install \
      --repo=https://akhq.io \
      --namespace=hm-akhq \
      --create-namespace \
      --values=my-values.yaml
    

    my-values.yaml

    configuration:
      akhq:
        connections:
          hm-kafka:
            properties:
              bootstrap.servers: hm-kafka-kafka-bootstrap.hm-kafka.svc:9092
            schema-registry:
              type: confluent
              url: http://confluent-schema-registry.hm-confluent-schema-registry.svc:8081