question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

cp-kafka-rest in Kubernetes exits with error

See original GitHub issue
  1. Starting Kafka Rest Proxy in Kubernetes exits with
   $ kubectl logs -f kafka-rest-lr991

   + [[ -n tcp://10.0.0.95:8082 ]]
  + echo 'PORT is deprecated. Please use KAFKA_REST_LISTENERS instead.'
  + exit 1

  PORT is deprecated. Please use KAFKA_REST_LISTENERS instead.
  1. Environment

  2. Followed this thread in Stackoverflow (https://stackoverflow.com/questions/41868161/kafka-in-kubernetes-cluster-how-to-publish-consume-messages-from-outside-of-kub/41869856).

  3. Following “kaka-rest-controller.yaml” file is used to start the pod in Kubernetes with required ENV variables

------------kaka-rest-controller.yaml-----------------
apiVersion: v1
kind: ReplicationController
metadata:
  labels:
    app: kafka-rest
    component: kafka-rest-endpoint
  name: kafka-rest
spec:
  replicas: 1
  template:
    metadata:
      labels:
        app: kafka-rest
        component: kafka-rest-endpoint
    spec:
      containers:
      - name: kafka-rest
        image: confluentinc/cp-kafka-rest:3.2.2
        env:
          - name: KAFKA_REST_HOST_NAME
            valueFrom:
              fieldRef:
                fieldPath: status.podIP
          - name: KAFKA_REST_ZOOKEEPER_CONNECT
            value: zookeeper:2181

Not sure if there are additional environmental variables missing, By default the Docker image seem to set the PORT by default and seem to check for it to exit.

Any help is appreciated

Issue Analytics

  • State:open
  • Created 6 years ago
  • Reactions:5
  • Comments:10

github_iconTop GitHub Comments

18reactions
geofflamrockcommented, Jul 20, 2017

Do you have a Kubernetes service called kafka-rest in your setup?

Environment variables are added by Kubernetes for services by default, and I found that I had to name the service something else like kafka-rest-service for it to not find that environment variable and continue on.

12reactions
bojidar-bgcommented, Nov 8, 2018

I managed to workaround this issue without renaming the service by unsetting the environment variable before running:

apiVersion: apps/v1
kind: StatefulSet
spec:
  # ...
  template:
    # ...
    spec:
      containers:
      - image: confluentinc/cp-kafka-rest:5.0.1
        # ...
        command: ["bash", "-c", "unset KAFKA_REST_PORT; /etc/confluent/docker/run"]
Read more comments on GitHub >

github_iconTop Results From Across the Web

Kafka Rest Proxy exits with error code 1 and no descriptive log ...
I've notices that when launching the image locally the SimpleLoggerFactory binding is used and when it is launched on remote kubernetes cluster ...
Read more >
Troubleshoot Confluent for Kubernetes
The ConfluentRolebindings custom resources (CRs) can be stuck in the DELETING state if associated Kafka cluster is removed. Solution: Manually remove the ...
Read more >
Exit code 1 for multiple containers, missing Dockerfile #53
schema-registry | Caused by: org.apache.kafka.common.errors.TimeoutException: Timed out waiting to send the call. schema-registry | [main] ERROR ...
Read more >
Documentation - Apache Kafka
We provide a Java client for Kafka, but clients are available in many languages. ... TopicCommand) now exits with non-zero exit code on...
Read more >
confluentinc - Bountysource
I am using the Docker image from "confluentinc/cp-kafka-rest:5.2.3" and my deployment looks something like below. I can see variables to change settings like ......
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found