That one tutorial in python that shows an interaction with Kafka.
🚨 A gotcha is you must specify
imagePullPolicy: Neveror this will not obey the local dockerfile repo.
-
Set up minkube to use a local Docker
Lets set up minikube to use it's local docker image repo. You will need to do this for every shell.
eval $(minikube -p minikube docker-env)Now when you type
docker image lsyou will see the contents of minikube's local docker. This allows you to use images from your local system instead of ECR or Dockerhub. -
install the Helm chart for Kafka
- helm repo add bitnami https://charts.bitnami.com/bitnami
- helm install kafka bitnami/kafka
-
run docker build to add image to local minikube docker inventory
- docker build -t python-one .
-
install the
python-one.yamland see what's therekubectl apply -f python-one.yamlkubectl get all
-
install the
ingresskubectl apply -f ingress.yaml
-
test it out
curl $(minikube ip)/curl $(minikube ip)/docs
-
fire off a call to producer
kubectl exec -it python-one -- python app/producer.py
-
use a browser to look at changes
- http://
minikube ip/state - http://
minikube ip/docs - OpenAPI docs - http://
minikube ip/ - "Classic" Hello, world
- http://
-
fire off an update to kafka using the app
kubectl exec -it python-one python app/producer.py- check for the update in the browser using the state http://
minikube ip/state
-
show logs
- kubectl logs -f python-one # -f is follow - CTRL+c to stop
- kubectl logs -f kafka-0
-
docker build -t one .
-
kubectl delete -f python-one.yaml
-
kubectl apply -f python-one.yaml
- Building the images is gonna leave a bunch of garbage laying around -
docker system prune --volumescleans it up