Deployed Kafka in minikube; How to use python to produce/consume within and outside minikube?

Hi,

I deployed kafka in minikube using this link GitHub - 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.

Kafka broker etc. are running now. I am using confluent_kafka pkg to test it.

Here are comes two questions:

  1. within the minikube cluster, how to use python to produce and consume topics to the deployed kafka service? How to find the right bootstrap.server value?
  2. If I use local IDE outside minikube cluster, how to produce and consume topics to the kafka inside the minikube cluster? How to find the right bootstrap. server value?

Hi @Lishuai . The default port number for the bootstrap server is 9092. That gives a clue as to which k8s service we should look at. On your screenshot, lsj-confluent-oss-cp-kafka seems to be listening on that port so it’s likely the broker / bootstrap.server. The IP would be 10.100.7.123.

As for python, are you using this client: GitHub - confluentinc/confluent-kafka-python: Confluent's Kafka Python Client?
The documentation is at : confluent_kafka API — confluent-kafka 1.9.0 documentation