Posts /

Getting started with KSQL via Kubernetes and Helm

KSQL via Kubernetes and Helm

I recently gave a tech talk about KSQL at Mailchimp, and I wanted to make it as easy as possible for engineers to experiment with this technology right after the presentation. So, I decided to create a Helm chart that can be used for learning about KSQL, and even for prod deployments to your Kubernetes cluster. This post talks about how to use the Helm chart I created, and will provide a basis for deeper KSQL tutorials in later blog posts.

Prerequisites

Helm Refresher

If you’ve used Helm before, feel free to skip this section. If not, then no worries, we’ll briefly discuss what Helm is below. For a deeper understanding, please consult the Helm docs.

Helm allows us to deploy multiple Kubernetes resources very easily using the concept of charts. You can think of charts as simply a package for related resources (deployments, config maps, services, etc). In order to create a chart, we simply need to adhere to a specific directory structure when defining our KSQL resources.

So, lets look at the directory structure of our KSQL chart:

$ ls -1p

Dockerfile
README.md
VERSION.txt
chart/
docker-entrypoint.sh
files/
script/

Deploying the Helm Chart

Now, run the following build script, which will build any custon UDFs / UDAFs you have defined (I will be discussing custom KSQL functions in a future tutorial), and also the Docker image that will be used for running KSQL.

$ ./script/build

Finally, deploy the Helm chart with another helper script that is included in the script directory.

$ ./script/deploy