Deploy the hivemq-platform-operator helm chart on Rancher
TypeScriptTo deploy the HiveMQ Platform Operator Helm chart on a Rancher managed Kubernetes cluster, you will need to perform a series of steps that involve setting up the necessary Pulumi resources. Below is an explanation of how you can accomplish this with a detailed Pulumi program in TypeScript.
The resources you'll be creating include:
-
Rancher2 CatalogV2: This resource represents a catalog on Rancher that contains Helm Charts. We will point this catalog to the Helm repo where the HiveMQ Platform Operator chart is located.
-
Rancher2 AppV2: This resource represents an application installed via a Helm chart in Rancher. After defining our
CatalogV2
, we will use this to declare the deployment of the HiveMQ Platform Operator chart.
In this example, we are assuming you have a Rancher management server already up and running, and have access to a Kubernetes cluster managed by Rancher. Please replace placeholder values like
YOUR_RANCHER_CLUSTER_ID
with the actual values from your Rancher setup.Additionally, before running this Pulumi program, make sure that you have set up the Pulumi CLI and authenticated with Rancher as needed. You should also have a Pulumi stack created for where you're planning to deploy this application.
Here's the Pulumi TypeScript program that demonstrates how to deploy the HiveMQ Platform Operator:
import * as pulumi from "@pulumi/pulumi"; import * as rancher2 from "@pulumi/rancher2"; // Define the Rancher2 CatalogV2 resource to point to the Helm chart's repository const hivemqCatalog = new rancher2.CatalogV2("hivemq-catalog", { clusterId: "YOUR_RANCHER_CLUSTER_ID", // Replace with your Rancher cluster ID name: "hivemq", url: "https://www.hivemq.com/artifact/helm/", // URL of the HiveMQ Helm chart repository gitRepo: "", // Use this if the chart is in a Git repository gitBranch: "", // Specify branch if using a Git repository // Additional properties can be set if needed (e.g. specifying a Git repository, credentials, etc.) }); // Define the Rancher2 AppV2 resource to deploy HiveMQ Platform Operator using the catalog entry const hivemqApp = new rancher2.AppV2("hivemq-app", { clusterId: "YOUR_RANCHER_CLUSTER_ID", // Replace with your Rancher cluster ID namespace: "default", // Specify the namespace where the chart should be deployed repoName: hivemqCatalog.name, // Reference the catalog by its name chartName: "hivemq-platform-operator", // Specify the exact chart name chartVersion: "YOUR_CHART_VERSION", // Replace with your desired chart version values: ``, // YAML string or a config file containing your deployment values // You might need to specify values for the Helm chart depending on the chart's requirements. }); // Export the App's name export const appName = hivemqApp.metadata.apply(meta => meta.name);
Remember to replace
YOUR_RANCHER_CLUSTER_ID
with the actual ID of your Rancher Kubernetes cluster andYOUR_CHART_VERSION
with the version of the HiveMQ Helm chart you want to deploy. Thevalues
property can be a YAML-formatted string with the necessary values required for the HiveMQ Platform Operator.Running
pulumi up
will apply this program to your Pulumi stack and deploy the HiveMQ Platform Operator Helm chart to the specified Kubernetes cluster managed by Rancher.Please note that the specifics of
values
for therancher2.AppV2
may need to be customized depending on the configuration needed by the HiveMQ Platform Operator Helm chart and your cluster setup. The YAML values string should be formatted correctly; otherwise, the Helm deployment can fail or misconfigure the HiveMQ operator.-