1

PROBLEM: For some reason client pod can only resolve fully qualified fully-qualified DNS names including the cluster service suffix.

That problem is stated in this quesion: AKS, WIndows Node, dns does not resolve service until fully qualified name is used

To workaround this issue, I'm using useServiceDnsDomain flag. The documentation (https://strimzi.io/docs/operators/master/using.html#type-GenericKafkaListenerConfiguration-schema-reference ) explains it as

Configures whether the Kubernetes service DNS domain should be used or not. If set to true, the generated addresses with contain the service DNS domain suffix (by default .cluster.local, can be configured using environment variable KUBERNETES_SERVICE_DNS_DOMAIN). Defaults to false.This field can be used only with internal type listener.

Part of my yaml is as follows

apiVersion: kafka.strimzi.io/v1beta1
kind: Kafka
metadata:
  name: tt-kafka
  namespace: shared
spec:
  kafka:
    version: 2.5.0
    replicas: 3
    listeners:
      - name: local
        port: 9092
        type: internal
        tls: false
        useServiceDnsDomain: true

This didn't do anything, so I also tried adding KUBERNETES_SERVICE_DNS_DOMAIN like below

template:
  kafkaContainer:
    env:
      - name: KUBERNETES_SERVICE_DNS_DOMAIN
        value: .cluster.local

strimzi/operator:0.20.0 image is being used.

In my client (.net Confluent.Kafka 1.4.4), I used tt-kafka-kafka-bootstrap.shared.svc.cluster.local as BootstrapServers. It gives me error as

Error: GroupCoordinator: Failed to resolve 'tt-kafka-kafka-2.tt-kafka-kafka-brokers.shared.svc:9092': No such host is known.

I'm expecting the broker service to provide full names to the client but from the error it seems useServiceDnsDomain has no effect.

Any help is appreciated. Thanks.

Savin
  • 131
  • 5

1 Answers1

1

As exmaplained in https://github.com/strimzi/strimzi-kafka-operator/issues/3898, there is a typo in the docs. The right YAML is:

  listeners:
    - name: plain
      port: 9092
      type: internal
      tls: false
      configuration:
        useServiceDnsDomain: true

If your domain is different from .cluster.local, you can use the KUBERNETES_SERVICE_DNS_DOMAIN env var to override it. But you have to configure it on the Strimzi Cluster Operator pod. Not on the Kafka pods: https://strimzi.io/docs/operators/latest/full/using.html#ref-operator-cluster-str

Jakub
  • 3,506
  • 12
  • 20