Run the script prepare_helm_release.sh to create secrets required for installing the Apache Pulsar Helm chart. The username pulsar and password pulsar are used for logging into the Grafana dashboard and Pulsar Manager.
./scripts/pulsar/prepare_helm_release.sh \
-n pulsar \
-k pulsar-mini \
-c
Use the Pulsar Helm chart to install a Pulsar cluster to Kubernetes.
note
You need to specify --set initialize=true when installing Pulsar the first time. This command installs and starts Apache Pulsar.
helm install\
--values examples/values-minikube.yaml \
--setinitialize=true \
--namespace pulsar \
pulsar-mini apache/pulsar
Check the status of all pods.
kubectl get pods -n pulsar
If all pods start up successfully, you can see that the STATUS is changed to Running or Completed.
Step 2: Use pulsar-admin to create Pulsar tenants/namespaces/topics
pulsar-admin is the CLI (command-Line Interface) tool for Pulsar. In this step, you can use pulsar-admin to create resources, including tenants, namespaces, and topics.
Then you can see all the partitioned topics in the namespace apache/pulsar.
"persistent://apache/pulsar/test-topic"
Step 3: Use Pulsar client to produce and consume messages
You can use the Pulsar client to create producers and consumers to produce and consume messages.
By default, the Pulsar Helm chart exposes the Pulsar cluster through a Kubernetes LoadBalancer. In Minikube, you can use the following command to check the proxy service.
kubectl get services -n pulsar |grep pulsar-mini-proxy
This output tells what are the node ports that Pulsar cluster's binary port and HTTP port are mapped to. The port after 80: is the HTTP port while the port after 6650: is the binary port.
Then you can find the IP address and exposed ports of your Minikube server by running the following command.
The Pulsar Manager UI will be open in your browser. You can use the username pulsar and password pulsar to log into Pulsar Manager.
In Pulsar Manager UI, you can create an environment.
Click New Environment button in the top-left corner.
Type pulsar-mini for the field Environment Name in the popup window.
Type http://pulsar-mini-broker:8080 for the field Service URL in the popup window.
Click Confirm button in the popup window.
After successfully creating an environment, you are redirected to the tenants page of that environment. Then you can create tenants, namespaces and topics using the Pulsar Manager.
Step 5: Use Prometheus and Grafana to monitor cluster
Grafana is an open-source visualization tool, which can be used for visualizing time series data into dashboards.
By default, the Grafana is exposed as a separate LoadBalancer. You can open the Grafana UI using the following command:
minikube service pulsar-mini-grafana -n pulsar
The Grafana UI is open in your browser. You can use the username pulsar and password pulsar to log into the Grafana Dashboard.
You can view dashboards for different components of a Pulsar cluster.