Deploy the tt-workflow-driver helm chart on Azure Managed Openshift Service
TypeScriptTo deploy a Helm chart on Azure Managed OpenShift, we'll go through the following steps:
-
Set up an Azure Red Hat OpenShift (ARO) cluster: Azure offers the Azure Red Hat OpenShift (ARO) service, where you get fully managed OpenShift clusters. The management and operation of the OpenShift clusters are handled by Microsoft and Red Hat.
-
Install the Helm Chart onto the ARO cluster: Once we have an ARO cluster set up, we can deploy applications using Helm. Helm is a package manager for Kubernetes, which allows you to define, install, and upgrade complex Kubernetes applications. Helm charts are packages pre-configured Kubernetes resources.
Here's a step-by-step Pulumi program in TypeScript of what we're going to do:
- Set up the provider for Azure.
- Create the Azure Red Hat OpenShift (ARO) cluster.
- Configure Kubernetes for the newly created ARO cluster.
- Use the Helm Chart resource to deploy your application.
Before you start, make sure you have configured your Azure credentials for the Pulumi CLI, and the required packages are installed in your project.
Now, here is the TypeScript program for Pulumi:
import * as azure_native from "@pulumi/azure-native"; import * as k8s from "@pulumi/kubernetes"; import * as pulumi from "@pulumi/pulumi"; // This initializes an Azure Resource Group. const resourceGroup = new azure_native.resources.ResourceGroup("myResourceGroup"); // Here we create an ARO cluster. An in-depth configuration can be added as needed. const cluster = new azure_native.redhatopenshift.OpenShiftCluster("myAROCluster", { resourceGroupName: resourceGroup.name, location: resourceGroup.location, openShiftVersion: "4", // Specify the OpenShift version you want to deploy, for example, 4.3. clusterProfile: { // The cluster profile contains basic configuration of the ARO cluster. domain: "example", // The domain name for your cluster. resourceGroupId: resourceGroup.id, pullSecret: "<pullSecret>", // Your Red Hat pull secret. }, masterProfile: { // The master profile configures the master nodes. vmSize: "Standard_D8s_v3", }, workerProfiles: [{ name: "worker", count: 3, vmSize: "Standard_D4s_v3", }], apiserverProfile: { visibility: "Public", }, ingressProfiles: [{ name: "default", visibility: "Public", }], }); // Set up the Kubernetes provider to connect to the ARO cluster. const k8sProvider = new k8s.Provider("k8sProvider", { kubeconfig: cluster.kubeconfig, }); // Now, we use the Helm Chart resource to deploy the `tt-workflow-driver` chart. const chart = new k8s.helm.v3.Chart("tt-workflow-driver", { chart: "tt-workflow-driver", // You would replace 'chartRepo' with the repository URL where your chart is hosted. fetchOpts: { repo: "https://<chartRepo>", }, version: "1.0.0", // The version of the chart you want to deploy. namespace: "default", // The target namespace for the helm chart. }, { provider: k8sProvider }); // Export the cluster's kubeconfig. export const kubeconfig = cluster.kubeconfig;
Please replace the placeholders (like
<pullSecret>
andhttps://<chartRepo>
) with your actual information. ThepullSecret
is from your Red Hat OpenShift subscription, and thechartRepo
is the repository URL hosting your Helm chart.To apply this Pulumi program, save the code to a file named
index.ts
, then run the commandspulumi stack init
to create a new stack, andpulumi up
to deploy the resources to Azure.Remember to review the plan shown by
pulumi up
carefully to ensure it does what you expect before confirming the deployment. After deployment is finished, you can get the kubeconfig of your cluster by runningpulumi stack output kubeconfig
.Each resource in the program is documented, explaining what it does:
- The
ResourceGroup
is a logical container for your Azure resources. OpenShiftCluster
is the Azure resource that represents the ARO cluster.Provider
is a Pulumi concept, representing the Kubernetes provider which allows Pulumi to interact with the Kubernetes cluster.Chart
is the Helm chart that we wish to deploy on the Kubernetes cluster.
With this program, you will have an OpenShift cluster in Azure, and a Helm chart (tt-workflow-driver in your case) deployed to it.
-