Home > Blockchain >  Access Kafka installed on a minikube cluster on Windows 10
Access Kafka installed on a minikube cluster on Windows 10

Time:05-03

I'm trying to install Kafka with Strimzy on a local munikube cluster running on Windows 10, to test the impact of different parameters (especially the TLS configuration). Before moving to TLS, i'd simply like to connect to my cluster :)

Here is my yaml configuration :

apiVersion: kafka.strimzi.io/v1beta1
kind: Kafka
metadata:
  name: my-cluster
spec:
  kafka:
    version: 2.3.0
    replicas: 1
    listeners:
      external:
        type: nodeport
        tls: false
    config:
      offsets.topic.replication.factor: 1
      transaction.state.log.replication.factor: 1
      transaction.state.log.min.isr: 1
      log.message.format.version: "2.3"
    storage:
      type: persistent-claim
      size: 1Gi
  zookeeper:
    replicas: 1
    storage:
      type: persistent-claim
      size: 2Gi
      deleteClaim: false
  entityOperator:
    topicOperator: {}
    userOperator: {}

For the listener, I firstly started with plain: {} but this only gives me services of type ClusterIP, not accessible from outside minikube (i really need to connect from outside). I then moved to a listener of kind external.

You can fin below the configuration of the cluster:

kubectl get all -n kafka
NAME                                             READY   STATUS    RESTARTS   AGE
pod/my-cluster-entity-operator-9657c9d79-8hknc   3/3     Running   0          17m
pod/my-cluster-kafka-0                           2/2     Running   0          18m
pod/my-cluster-zookeeper-0                       2/2     Running   0          18m
pod/strimzi-cluster-operator-f77b7d544-hq5pq     1/1     Running   0          5h22m

NAME                                          TYPE        CLUSTER-IP       EXTERNAL-IP   PORT(S)                      AGE
service/my-cluster-kafka-0                    NodePort    10.99.3.204      <none>        9094:30117/TCP               18m
service/my-cluster-kafka-bootstrap            ClusterIP   10.106.176.111   <none>        9091/TCP                     18m
service/my-cluster-kafka-brokers              ClusterIP   None             <none>        9091/TCP                     18m
service/my-cluster-kafka-external-bootstrap   NodePort    10.109.235.156   <none>        9094:32372/TCP               18m
service/my-cluster-zookeeper-client           ClusterIP   10.97.2.69       <none>        2181/TCP                     18m
service/my-cluster-zookeeper-nodes            ClusterIP   None             <none>        2181/TCP,2888/TCP,3888/TCP   18m

NAME                                         READY   UP-TO-DATE   AVAILABLE   AGE
deployment.apps/my-cluster-entity-operator   1/1     1            1           17m
deployment.apps/strimzi-cluster-operator     1/1     1            1           5h22m

The IP address of the minikube cluster is 192.168.49.2 (given by minikube ip)

For the while, is everything correct on my configuration ? I cannot connect on the cluster with a producer (i get a timeout error when i try to publish data).

I tried to connect to 192.168.49.2:32372 & 192.168.49.2:30117 and I always get the same timeout error. I also tryed to run

  • minikube service -n kafka my-cluster-kafka-external-bootstrap

and

  • minikube service -n kafka my-cluster-kafka-0

and i still get the same error.

What is wrong in what i'm trying to do?

Thanks!

CodePudding user response:

Ok, I got the answser. I changed the type of the service to LoadBalancer and started minikube tunnel

One other point, as I'm running this on windows, I noticed that if I run everything using powershell it works, if I used an other command line tool (like Moba) it does not work, I don't explain this.

  • Related