Skip to content

Instantly share code, notes, and snippets.

@caryyu
Last active April 10, 2020 03:54
Show Gist options
  • Save caryyu/3406c2b9651be0ed39ffce3cfdaec63b to your computer and use it in GitHub Desktop.
Save caryyu/3406c2b9651be0ed39ffce3cfdaec63b to your computer and use it in GitHub Desktop.
kafka-cli in kubernetes

This usage is based on the project of https://github.com/birdayz/kaf

Description

  • A Kafka cluster in your Kubernetes Cluster
  • If you're in China, Please make sure you have the proxy setup in your Kubernetes cluster as what I did

Steps

kubectl -n kafka run --generator=run-pod/v1 kafka-cli --image golang:alpine --rm -it --command ash
apk update && apk add curl
export https_proxy="http://proxy-service.namespace:7890"
curl -s https://raw.githubusercontent.com/birdayz/kaf/master/godownloader.sh | sh -s v0.1.32
alias kaf=/root/bin/kaf
kaf config add-cluster local -b kafka-bootstrap:9092
kaf config select-cluster
kaf node ls
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment