apache-kafkabitnamiconfluent-schema-registry

How to install Confluent Schema Registry using Bitnami helm chart for external Kafka?


I have a Kafka created by Strimzi at hm-kafka-kafka-bootstrap.hm-kafka.svc:9092.

I am trying to install Confluent Schema Registry using Bitnami helm at https://github.com/bitnami/charts/tree/main/bitnami/schema-registry

Here are my steps:

helm upgrade \
  confluent-schema-registry \
  oci://registry-1.docker.io/bitnamicharts/schema-registry \
  --install \
  --namespace=hm-confluent-schema-registry \
  --create-namespace \
  --values=my-values.yaml

my-values.yaml:

kafka:
  enabled: false
externalKafka:
  brokers:
    - PLAINTEXT://hm-kafka-kafka-bootstrap.hm-kafka.svc:9092

However, this gives me error

Error: template: schema-registry/templates/statefulset.yaml:4:95: executing "schema-registry/templates/statefulset.yaml" at <.Values.kafka.auth.clientProtocol>: nil pointer evaluating interface {}.clientProtocol

Any idea? Thanks!


Solution

  • TL;DR

    Assume the Kafka is at hm-kafka-kafka-bootstrap.hm-kafka.svc:9092, Confluent Schema Registry can be installed by

    helm upgrade \
      confluent-schema-registry \
      oci://registry-1.docker.io/bitnamicharts/schema-registry \
      --install \
      --namespace=hm-confluent-schema-registry \
      --create-namespace \
      --values=my-values.yaml
    

    my-values.yaml:

    kafka:
      enabled: false
      auth:
        protocol: {}
      service:
        ports:
          client: {}
    externalKafka:
      brokers:
        - PLAINTEXT://hm-kafka-kafka-bootstrap.hm-kafka.svc:9092
    

    How I found out

    Attempt 2 (Failed)

    I did further experiments based on the error I got in my question, I updated to

    my-values.yaml:

    kafka:
      enabled: false
      auth:
        protocol: plaintext
    externalKafka:
      brokers:
        - PLAINTEXT://hm-kafka-kafka-bootstrap.hm-kafka.svc:9092
    

    gives me error

    Error: template: schema-registry/templates/statefulset.yaml:7:29: executing "schema-registry/templates/statefulset.yaml" at <.Values.kafka.service.ports.client>: nil pointer evaluating interface {}.ports
    

    Attempt 3 (Succeed)

    my-values.yaml:

    kafka:
      enabled: false
      auth:
        protocol: plaintext
      service:
        ports:
          client: 9092
    externalKafka:
      brokers:
        - PLAINTEXT://hm-kafka-kafka-bootstrap.hm-kafka.svc:9092
    

    Now I can see default _schemas from Confluent Schema Registry got created with some messages inside:

    enter image description here

    The issue is that these two parameters currently do not exist in schema-registry/values.yaml:

    kafka:
      auth:
        protocol: plaintext
      service:
        ports:
          client: 9092
    

    I have reported the issue at https://github.com/bitnami/charts/issues/17126


    UPDATE

    @wackazong pointed out can simply use

    kafka:
      enabled: false
      auth:
        protocol: {}
      service:
        ports:
          client: {}
    externalKafka:
      brokers:
        - PLAINTEXT://hm-kafka-kafka-bootstrap.hm-kafka.svc:9092
    

    Confirmed it works. Thanks!