![]() I keep them separate to explicitly separate each type in this case and because it's convenient as you can just run kubectl pointing to the directory as described below in the "Running it" section. kafka-k8s/* do cat $each echo "-" done > local-kafka-combined.yaml this will concatenate all files in a single one called local-kafka-combined.yaml. You will find multiple Kubernetes declarative files in this folder, please notice that you could also combine all files in a single one separating them with a line containing triple dashes -, if combining them is your preference you can open a terminal and from the pv-pvc-setup folder run for each in. If you checked out the repo described above the setup presented here is under pv-pvc-setup folder. The setup using Persistent Volumes and Persistent Volume Claims To clone the repo git clone I guess this is more than enough introduction let's have some fun. You can get the full source from Github repo where you will find the files and Quick Start for both aforementioned approaches. It should work for Mac and Windows also but I have never tried it. I have created and tested these approaches on a Linux Development machine. In the past couple of days I came up with two local setups running Kafka, Schema-registry and Zookeeper on local development machine with Kubernetes using Kind, in this first post I will cover a setup using Persistent Volumes and Persistent Volume Claims and in the next one I will cover using Storage classes. My goal with this setup here is for learning and to have a more "realistic" Kubernetes setup on local development machine so I opted to not use Strimzi or Helm charts. Strimzi is an awesome simpler alternative to achieve the same, check it out. You may want to run a local kafka for quick and easy test and prototyping and also to save money from running it in the cloud just for functional development, if you combine that with also packaging and running your application on Kubernetes you have a very efficient setup that closely mirrors cloud environments where your app and the Kubernetes cluster you will use for the environments are probably running. This is a minimal local Kafka setup meant for development so it's a single instance of Kafka, Schema-registry and Zookeeper. If you don't need strict control over the Kafka and Zookeeper storage locations on your developer host machine which is most of the time the case, I would recommend that you use the Storage class setup approach because it's simpler and uses less code as it leverages the default storage provider used by Kind. Usually I go with docker-compose for that as it is simpler to get it going but due to the omnipresence of Kubernetes these days in companies I decided to also port my local Confluent Kafka setup to run on Kubernetes for practicing and getting closer to production environments where my application will most likely also run on Kubernetes. ![]() ![]() In this post I will cover the steps to run Kafka locally on your development machine using Kubernetes.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |