Cp-docker-images: Remove deprecation-as-error to make it Kubernetes friendly

Created on 13 Dec 2017  路  4Comments  路  Source: confluentinc/cp-docker-images

On the following line, Kafka fails to start if there is a Kubernetes service called "kafka". This is because Kubernetes creates env variables for each service, one of them being KAFKA_PORT.

https://github.com/confluentinc/cp-docker-images/blob/9a169e84974c8d8a1ce22bb85d7b2d430b6cb37b/debian/kafka/include/etc/confluent/docker/configure#L61

The startup script should not exit when KAFKA_PORT exists, if advertised listeners are otherwise valid.

Most helpful comment

As a workaround you can unset KAFKA_PORT and execute /etc/confluent/docker/run. This works OK for me (it's a part of StatefulSet manifest):

        command:
        - sh
        - -exc
        - |
          unset KAFKA_PORT && \
          export KAFKA_BROKER_ID=${HOSTNAME##*-} && \
          export KAFKA_ADVERTISED_LISTENERS=PLAINTEXT://${POD_IP}:9092 && \
          exec /etc/confluent/docker/run

All 4 comments

@analytik do you have a workaround or suggested solution what would be backward compatible?

Would turning this fatal error into a warning be sufficient? This crashing behavior is somehow intentionally backwards incompatible as it is.

Sorry for the delay; yes, downgrading it from a fatal error to a warning would fix this particular case.

Again, please note that this only happens if there is a kubernetes service called "kafka", which I'm not sure is a best practice. We have services for individual nodes, e.g. kafka00, kafka01, kafka02, and "kafka" round-robins those three for convenience. But I assume people running single-node clusters might run into this problem, though, since "kafka" seems as reasonable name as any.

As a workaround you can unset KAFKA_PORT and execute /etc/confluent/docker/run. This works OK for me (it's a part of StatefulSet manifest):

        command:
        - sh
        - -exc
        - |
          unset KAFKA_PORT && \
          export KAFKA_BROKER_ID=${HOSTNAME##*-} && \
          export KAFKA_ADVERTISED_LISTENERS=PLAINTEXT://${POD_IP}:9092 && \
          exec /etc/confluent/docker/run
Was this page helpful?
0 / 5 - 0 ratings

Related issues

fritchie picture fritchie  路  4Comments

mikouaj picture mikouaj  路  7Comments

Tin-Nguyen picture Tin-Nguyen  路  6Comments

OneCricketeer picture OneCricketeer  路  3Comments

rhammonds1 picture rhammonds1  路  3Comments