confluentinc / cp-helm-charts

The Confluent Platform Helm charts enable you to deploy Confluent Platform services on Kubernetes for development, test, and proof of concept environments.
https://cnfl.io/getting-started-kafka-kubernetes
Apache License 2.0
789 stars 846 forks source link

NodePort for cp-zookeeper and cp-schema-registry #590

Open swimand opened 2 years ago

swimand commented 2 years ago

Currently it is possible to set cp-kafka to run with NodePort instead of ClusterIP, but there is no way to do the same for the zookeeper and schema registry services.

Is there a workaround which would allow me to expose these services to the localhost? Or would it be possible to add such a feature?

imalik8088 commented 2 years ago

For SR and ZK you can write your own Service resources with NodePort or any other required types. I wouldn't suggest to open ZK to access it from outside if you have not reasons to make ZK accessible from from outside.

swimand commented 2 years ago

This is only for local development purposes, where I am running my application directly in the IDE, and would like to connect to the cp-helm-charts that are running on my local machines kubernetes cluster.

As I would prefer to keep the same port configuration, I have been attempting this suggested solution with services of type LoadBalancer with same port as targetport. Sadly it doesn't seem to be working. Although the ports are exposed and the kafka/schema-registry/zookeeper seem to be reachable, they aren't accepting the connection from my application (Java/Spring). Am I missing any specific settings to allow connections from outside the kubernetes cluster?

OneCricketeer commented 1 year ago

missing any specific settings to allow connections from outside the kubernetes cluster

Does this help? https://strimzi.io/blog/2019/04/17/accessing-kafka-part-1/