-
Notifications
You must be signed in to change notification settings - Fork 702
cp-kafka-rest in Kubernetes exits with error #286
Comments
|
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. |
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"] |
This fixed the same issue when deploying the Schema Registry image, thank you! |
I'm trying to install schema-registry via Helm helm install incubator/schema-registry --version 1.1.9 |
I am also using incubator/schema-registry and could resolve the issue by simply changing the release name from schema-registry to anything else, in this case sr: helm install sr -f schema-registry_values.yaml incubator/schema-registry |
It was about almost 2 months ago. Currently I have a working system but I really don't remember anything about workaround. |
This is because, by default, kubelet injects a set of ENVs automatically (for service discovery purpose). Another workaround is to disable this by setting |
This approach worked for me. Just that in my case, I did not have KAFKA_REST_PORT rather KAFKA_PORT. Finally this is how the command looks like for my deployment template of Kafka
|
Same issue with cp-kafka (0.6.1), but there is no way to override |
Environment
Followed this thread in Stackoverflow (https://stackoverflow.com/questions/41868161/kafka-in-kubernetes-cluster-how-to-publish-consume-messages-from-outside-of-kub/41869856).
Following "kaka-rest-controller.yaml" file is used to start the pod in Kubernetes with required ENV variables
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
The text was updated successfully, but these errors were encountered: