mstump / kafka-k8s-training

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

kafka-k8s-training

This repository has several components:

  • Docker files for the creation of docker images for Kafka broker and consumers
  • Makefile which automates the creation of the docker images
  • helm charts used in the deployment of docker images for the publisher and consumer to Kubernetes
  • Kubernetes YAML files used to deploy Zookeeper and Kafka to Kubernetes

Useful links

  • helm to create templates for k8s YAML files
  • ark for backup restore in kubernetes
  • authenticator for setting up auth to AWS IAM users
  • dex for auth to LDAP
  • kops for provisioning k8s on AWS

Building and deploying components to k8s

Install Zookeeper and Kafka

kubectl create -f kafka/zookeeper/*.yml
kubectl create -f kafka/kafka.yml

Docker

Build docker images

make build

Push the docker images to the repositor(ies) defined at the top of the Makefile

make push

Run the Kafka consumer docker image

make kafka-consumer_run

Run the Kafka publisher docker image

make kafka-publisher_run

Access the shell of the Kafka publisher docker image

make kafka-publisher_shell

Access the shell of the Kafka consumer docker image

make kafka-consumer_shell

Install Helm charts for the producer and the consumer

Install helm on your local machine. Then install helm on your k8s cluster by running.

helm init
helm version

Install each of the helm charts.

helm install -n publisher charts/publisher
helm install -n consumer charts/consumer

Wait for the pods to become ready

kubectl get po -w

Tail the logs for the publisher deployment

kubectl logs -f deployment/publisher-publisher

About

License:Apache License 2.0


Languages

Language:Python 49.6%Language:Makefile 32.3%Language:Smarty 18.2%