Open izmal opened 9 months ago
Ok I was forced to use this product. I have come up with a better solution since my previous comment (the nuclear option :P).
The root cause is Alpine Linux musl library on Kubernetes. No matter what you do Alpine Linux will be dodgy at best. OAUTH2 is unconfigurable because JAVA can't do DNS.
The Solution: Grab their Dockerfile from (https://github.com/provectus/kafka-ui/blob/master/kafka-ui-api/Dockerfile)
(I'll edit this below to the Dockerfile when I'm able)
Change the FROM to FROM azul/zulu-openjdk-debian:17-jre-headless
Then change the apk to apt get. You don't need the gcompat. Then change the adduser and addgroup to useradd and usergroup commands
Then build the image.
Extra-Info: There is an issue in the helm chart SPRING_CONFIG_ADDITION-ALLOCATION should be SPRING_CONFIG_ADDITIONALLOCATION
This means that with my debian build (maybe Alpine too) the config doesn't apply unless you use env variables. I've added it like this
env:
- name: SPRING_CONFIG_ADDITIONALLOCATION
value: /kafka-ui/config.yml
Then DON'T use the yamlApplicationConfig or yamlApplicationConfigConfig elements.
Create your config in a configmap named kafka-ui-configmap
Add the volume mapping and mounts manually
volumes:
- name: kafka-ui-yaml-conf-configmap
configMap:
name: kafka-ui-configmap
volumeMounts:
- name: kafka-ui-yaml-conf-configmap
mountPath: /kafka-ui/
Here Are the modified Dockerfile
FROM azul/zulu-openjdk-debian:17-jre-headless
RUN apt-get install \
# snappy codec
# gcompat \
# configuring timezones
tzdata
RUN groupadd kafkaui && useradd kafkaui -g kafkaui
# creating folder for dynamic config usage (certificates uploads, etc)
RUN mkdir /etc/kafkaui/
RUN chown kafkaui /etc/kafkaui
USER kafkaui
ARG JAR_FILE
COPY "/target/${JAR_FILE}" "/kafka-ui-api.jar"
ENV JAVA_OPTS=
EXPOSE 8080
# see JmxSslSocketFactory docs to understand why add-opens is needed
CMD java --add-opens java.rmi/javax.rmi.ssl=ALL-UNNAMED $JAVA_OPTS -jar kafka-ui-api.jar
After Using the builded images, the error doesn't solved
I had it running with keycloak but got a nice formatted 404 when logging in that my browser debug mode didn't see. Also needed to press F5 a few times to get it to log in. I gave up on Kafka UI for now, and am running AKHQ with keycloak integration behind a reverse proxy on kubernetes. I do hope that the Kafka UI devs look into the problems when running kubernetes. Main problem seems to be Alpine Linux and strange issues when behind a reverse proxy. I do believe that they are doing their best and will ultimately turn it into the enterprise grade tool it was intended to be. I will check back in the future.
Issue submitter TODO list
Describe the bug (actual behavior)
Got exception UnknownHostException for host from bootstrapServers field. But in container host resolved correct.
Expected behavior
Resolve host from bootstrapServers.
Your installation details
Steps to reproduce
I add to config two clusters. First is external host with kafka. Second is kafka in k8s. Can resolve hosts in container:
But in log i see for external server:
Looks like bug.
I can use as workaround two dedicated kafka-iu:
But it is strange that in container resolver i can get ip for hosts but application show error.
Screenshots
No response
Logs
No response
Additional context
No response