1

I am new to k8s, have installed Kafka to the local cluster using helm install command and it is installed successfully and shown it using

helm list

and using

Kubectl get all -A

Command as running.

I installed Confluent.Kafka nugget package in my C# project and try to connect to the pod but it is not connected using localhost:13090 and giving no error message

Please note that the namespace of the pod is “default” while the namespace of the application pod is “my-pod”

Please advise me, thank you

OneCricketeer
  • 179,855
  • 19
  • 132
  • 245
AB1994
  • 21
  • 6
  • 1
    `localhost` is the pod itself, not another pod or the node the pod is running on. The Kafka charts will include a Service to reach the broker pods, and you need to use the service's name as a host name. – David Maze Feb 20 '21 at 13:18

1 Answers1

3

I can see 90% of the answer included in your question, you mention that the namespace is different so that means you need to add ".default" to your service name.

You also mention a port that possibly used to connect from the outside cluster but inside the cluster, you can use 9092 with the service including the word headless.

Example

mykafka-service-headless.default:9092

or

mykafka-service-headless.default

without port as this is the default one.

You will not need port forwarding but just in case, you may execute the port-forward command for 9092 for the subject Kafka pods.

Useme Alehosaini
  • 2,998
  • 6
  • 18
  • 26