You are viewing an old version of this page. View the current version.

Compare with Current View Page History

« Previous Version 3 Next »







image2021-7-21_10-26-50.png



Installing in Kubernetes


$ helm repo add bitnami https://charts.bitnami.com/bitnami
"bitnami" has been added to your repositories

$ helm install kafka bitnami/kafka
NAME: kafka
LAST DEPLOYED: Tue Jul 27 11:19:47 2021
NAMESPACE: default
STATUS: deployed
REVISION: 1
TEST SUITE: None
NOTES:
** Please be patient while the chart is being deployed **

Kafka can be accessed by consumers via port 9092 on the following DNS name from within your cluster:

    kafka.default.svc.cluster.local

Each Kafka broker can be accessed by producers via port 9092 on the following DNS name(s) from within your cluster:

    kafka-0.kafka-headless.default.svc.cluster.local:9092

To create a pod that you can use as a Kafka client run the following commands:

    kubectl run kafka-client --restart='Never' --image docker.io/bitnami/kafka:2.8.0-debian-10-r55 --namespace default --command -- sleep infinity
    kubectl exec --tty -i kafka-client --namespace default -- bash

    PRODUCER:
        kafka-console-producer.sh \
            
            --broker-list kafka-0.kafka-headless.default.svc.cluster.local:9092 \
            --topic test

    CONSUMER:
        kafka-console-consumer.sh \
            
            --bootstrap-server kafka.default.svc.cluster.local:9092 \
            --topic test \
            --from-beginning

$ kubectl get pods



References

ReferenceURL
Apache Kafka in 5 minuteshttps://www.youtube.com/watch?v=PzPXRmVHMxI
Kafka Topics, Partitions and Offsets Explainedhttps://www.youtube.com/watch?v=_q1IjK5jjyU


  • No labels