Get your copy of the O’Reilly Cassandra eBook: The Definitive Guide - Download FREE Today
Replicated's K8s-in-a-box and how we used it to build Luna Streaming
Apache Pulsar, the open-source distributed messaging and streaming platform, is architected in a way that makes deployment using Kubernetes simple. But what about users who want to take advantage of this natural pairing, but aren’t ready to dive into installing Kubernetes from scratch?
In our recent Luna Streaming release, which is the DataStax distribution of Apache Pulsar, we asked that question. The answer is Replicated, a toolset to streamline the distribution and management of third-party applications. Its ability to deliver and manage Kubernetes applications anywhere made it simple to enable on-premise users to run our Apache Pulsar Helm chart.
Apache Pulsar and Kubernetes
Deploying Apache Pulsar in Kubernetes puts some powerful features at your fingertips: resource-based scheduling and enforcement, rolling upgrades, and well-integrated support for tools needed for a production deployment of Apache Pulsar, such as Prometheus, Grafana, and cert-manager. For these reasons, we prefer to deploy Apache Pulsar in Kubernetes.
One of the goals for Luna Streaming was to build a package around Apache Pulsar that embodied the best practices that we learned while designing, operating, and supporting Apache Pulsar. It includes valuable tools to smooth the path for operating Apache Pulsar for both new and experienced teams, such as the Apache Pulsar Admin console UI for common admin tasks and the Pulsar Heartbeat for monitoring.
For users that are already running Kubernetes in the cloud or on-premise, it was straightforward. We created a Helm chart for Luna Streaming that deploys our certified version of Apache Pulsar along with all the tools you need to run a production cluster.
But we still needed a path to using Luna Streaming for those who haven’t adopted Kubernetes.
Replicated allows you to deliver and manage Kubernetes applications anywhere. In our case, we wanted to enable on-premise users to run our Apache Pulsar Helm chart, including all its valuable add-on pieces. Replicated made this surprisingly easy to do. Using the tooling provided by Replicated, we were able to build an installation package that will deploy a production ready Pulsar cluster on a set of nodes. Under the hood, the tools install and configure Kubernetes and then deploy our Apache Pulsar Helm chart to the new Kubernetes environment.
Having installed Kubernetes myself on bare metal nodes, I can attest that what the Replicated tools are doing behind the scenes is no small feat. On top of the fundamental components of Kubernetes, such as etcd and kube-proxy, the tools are also taking care of installing the core plugins (such as container networking and PVC provisioning) as well as must-have Kubernetes addons, including cert-manager and Prometheus.
kURL and KOTS
To make this work, we leveraged two projects from Replicated: kURL, and KOTS. The kURL project enables you to quickly build Kubernetes installers. You can select the version of Kubernetes you want to deploy and many other aspects of Kubernetes installation. For example, we are deploying OpenEBS with Local Persistent Volumes enabled. This lets us use the local volumes on the nodes as PersistentVolumes for the PersistentVolumeClaims associated with our StatefulSets (for BookKeeper and ZooKeeper).
The kURL web site has a handy UI for generating a configuration manifest for the Kubernetes layer. You can click on the options you want and it will create a (properly indented!) YAML file for you.
Once you’ve defined the manifest, you can use the kURL installer to create a full Kubernetes cluster with as many nodes as you need. For our initial release, we decided to support a 1-node install for development and test deployments and a 4-node install for a production deployment.
That takes care of the Kubernetes layer. For the application part, in our case Apache Pulsar and its management tools, we are using KOTS. Like kURL, KOTS is configured using YAML manifest files. You may be thinking that building new manifests for your application that are compatible with KOTS is a lot of work. But it’s not, because KOTS enables you to simply import your existing Helm chart. You just need to define a small manifest that references the Helm chart, and all the work that you already did to build the Helm chart can be reused.
Once you have your Helm chart imported, you can use the KOTS Vendor tool to build an interface that lets users enter the key values for the Helm chart. Because you’re deploying to the Kubernetes cluster you defined using kURL, you can properly set values on behalf of the user. For example, we know what StorageClass options there will be on the kURL-deployed cluster, so we can set those depending on what options the user selects. This minimizes the options the user has to sort through, making the package more usable.
KOTS Vendor portal
Replicated has really figured out how to make the development of a package like Luna Streaming easy. The KOTS Vendor portal allows you to manage unstable (development), beta, and stable channels of your application. It also lets you manage licenses for your customers. In our case, we wanted to make Luna Streaming freely available to everyone, so we are using the Community license option.
The best part of the development process is that the separation of kURL (Kubernetes layer) and KOTS (application layer) means that if you just want to update the application layer and test it, then you don’t need to re-install the (unchanged) Kubernetes layer. You can just redeploy a new version of the KOTS application. Compared to other tools that require you to build and install the entire package (Kubernetes and application) each time you want to iterate on a test version, this is a huge development time saver.
Check out Luna Streaming
Using the tools provided by Replicated and our existing Helm chart, we were able to quickly build a package to allow on-premise users to take advantage of the full Luna Streaming experience for Apache Pulsar.
If you want to check out what we’ve built using Replicated, go to the Luna Streaming quick-start documentation. From there we take you step-by-step from empty servers to a production environment in no time, thanks to the Kubernetes friendliness of Apache Pulsar and the power of Replicated’s K8s-in-a-box tooling.