AKHQ: 无法在您的配置文件中找到任何集群,请确保配置文件已正确加载

huangapple go评论68阅读模式
英文:

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

问题

我的Kubernetes中的Kafka引导服务器位于hm-kafka-kafka-bootstrap.hm-kafka.svc:9092

我正在尝试在我的Kubernetes集群中部署AKHQ。以下是我的步骤:

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

我创建了这个my-values.yaml基于这个。但是,我确信我正确使用它。

然后,我通过kubectl port-forward service/akhq --namespace=hm-akhq 8080:80进行了端口转发。

然而,当我打开localhost:8080时,页面显示:

{
  "message": "无法在配置文件中找到任何集群,请确保配置文件已正确加载",
  "_links": {
    "self": {
      "href": "/",
      "templated": false
    }
  }
}

我已阅读了具有相同错误的这些问题:

但是我没有找到任何解决我的问题的解决方案。任何指南将不胜感激。谢谢!

英文:

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!

答案1

得分: 0

'akhq.connections' 应该位于 'configuration' 而不是 'secrets'。以下是最终工作版本:

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
英文:

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

huangapple
  • 本文由 发表于 2023年6月1日 06:21:40
  • 转载请务必保留本文链接:https://go.coder-hub.com/76377644.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定