Install StreamNative Platform on minikube
StreamNative Platform is a cloud-native messaging and event-streaming platform that enables you to build a real-time application and data infrastructure for both real-time and historical events. In this article, I will demonstrate how to install StreamNative Platform on minikube on a local machine to explore it with the lightweight Kubernetes distribution, and deploy Pulsar on it. I will perform all the steps on a Mac computer with Apple silicon.
This setup mainly required DFD (Docker for Desktop). You can download the dmg file for Mac.
Install minikube
minikube is a lightweight Kubernetes distribution that allows you to quickly create a local Kubernetes cluster. For educational purposes, we will use minikube in this blog to set up our environment with Kubernetes 1.23 as an example.
1. Download and install minikube using the following commands.
2. Start Docker Desktop. You can test minikube by running minikube start --kubernetes-version=v1.23.0. Once it is started, you can stop it.
Install Helm
Use the following command to install Helm 3 with brew. We will use Helm to install StreamNative Platform later.
Install StreamNative Platform
Once all the above dependencies are installed and configured, follow the steps below to install StreamNative Platform on minikube.
1. Start Docker Desktop.
2. Start minikube with Kubernetes version 1.23.
Pulsar Operators will be installed later, which support Kubernetes versions between v1.16 (inclusive) and v1.26 (exclusive).
3. Set the default context to minikube.
4. Create a Kubernetes namespace called pulsar. As we are going to install everything under the same namespace, we can set the default context to the pulsar namespace. This allows us to perform operations in the pulsar namespace by default without using the -n option every time.
5. Add the streamnative repository using helm.
6. Install Pulsar Operators.
To fully leverage the power of StreamNative Platform, you can choose to install the Vault operator, cert-manager, and Function Mesh operator. For more information, see the StreamNative Platform documentation.
Install Apache Pulsar
Now that we have installed Pulsar Operators, we can deployed the custom resources (CRs) of ZooKeeper, BookKeeper, and brokers on minikube.
To deploy these CRs, download the YAML files from this GitHub repository and apply them. Alternatively, follow the examples below to install and create Pods for each component. Install ZooKeeper first, then BookKeeper, and finally the Pulsar broker.
Create the ZooKeeper custom resource
1. Create a zookeeper.yaml manifest file.
2. Run the following command to create the ZooKeeper Pod.
3. Verify if the ZooKeeper Pod has been created. Once it is up and running, you can install BookKeeper.
Install the BookKeeper custom resource
1. Create a bookkeeper.yaml manifest file.
2. Run the following command to create the BookKeeper Pod.
3. Verify if the BookKeeper Pod has been created. Once it is up and running, you can install the broker.
If you are running three bookie Pods, you must set anti-affinity to false.
Install the Pulsar broker custom resource
1. Create a broker.yaml manifest file.
2. Run the following command to create the broker Pod.
3. Verify if the broker Pod has been created.
4. Expected output:
5. To access the cluster, you can exec into the broker Pod and run the producer or consumer client.
For the MacBook Pro M1 chip, make sure IPV6 is disabled. Always use the latest version of Docker Desktop and ensure the following settings are enabled before creating CRs.
Now, you can use pulsar-admin to manage clusters, tenants, namespaces, topics, and more.
*☁️ Happy Learning ☁️*
More resources
Powered by Apache Pulsar, StreamNative Platform makes it easy to build mission-critical messaging and streaming applications and real-time data pipelines by integrating data from multiple sources into a single, central messaging and event streaming platform for your company. See the following resources for more details:
Newsletter
Our strategies and tactics delivered right to your inbox