Deploy the ibm-cpd-wos-instance helm chart on Azure Kubernetes Service (AKS)
TypeScriptTo deploy the IBM Cloud Pak for Data Watson OpenScale (
ibm-cpd-wos
) instance on Azure Kubernetes Service (AKS) using Pulumi with Helm charts, you'll first need to set up an AKS cluster. Then, you will use Pulumi's Helm chart resource to deploy theibm-cpd-wos-instance
.Below is a step-by-step guide to accomplishing this task:
Step 1: Set up AKS Cluster
First, you'll create an Azure Kubernetes Service (AKS) cluster. This is where your IBM Cloud Pak for Data Watson OpenScale instance will be deployed.
In Pulumi, the
KubernetesCluster
resource from the@pulumi/azure
package is used to provision an AKS cluster.Step 2: Deploy IBM CPD WOS Helm Chart
Once the AKS cluster is running, you can deploy the IBM CPD WOS instance using the Helm chart. Pulumi provides the
Chart
resource in the@pulumi/kubernetes
package to deploy Helm charts.It's important to note that you'll need the Helm chart repository where the
ibm-cpd-wos-instance
Helm chart is located, and also the exact version of the chart you want to deploy.Step 3: Configure kubeconfig
To interact with your AKS cluster, you'll need the
kubeconfig
file, which contains the credentials to talk to your Kubernetes cluster. Pulumi can retrieve this information after you've created an AKS cluster by accessing thekubeConfigRaw
property of the AKS cluster.Now, let's write the TypeScript program:
import * as pulumi from "@pulumi/pulumi"; import * as azure from "@pulumi/azure"; import * as k8s from "@pulumi/kubernetes"; const config = new pulumi.Config(); const resourceGroupName = config.require("resourceGroupName"); const name = "my-aks-cluster"; const location = config.require("location"); // Create an Azure Resource Group const resourceGroup = new azure.core.ResourceGroup(resourceGroupName, { location: location, }); // Create an AKS cluster const cluster = new azure.containerservice.KubernetesCluster(name, { resourceGroupName: resourceGroup.name, location: resourceGroup.location, defaultNodePool: { name: "aksagentpool", nodeCount: 3, vmSize: "Standard_DS2_v2", }, dnsPrefix: `${pulumi.getStack()}-kube`, servicePrincipal: { clientId: config.require("clientId"), clientSecret: config.require("clientSecret"), }, linuxProfile: { adminUsername: "adminuser", sshKey: { keyData: config.require("sshPublicKey"), }, }, kubernetesVersion: "1.18.14", }); // Deploy the IBM CPD WOS instance via Helm Chart const ibmCpdWosChart = new k8s.helm.v3.Chart("ibm-cpd-wos-instance", { chart: "ibm-cpd-wos-instance", version: "1.2.3", // replace with the actual chart version fetchOpts: { repo: "https://charts.yourhelmrepo.com/", // replace with the actual HELM repo URL }, // Define values for the Helm chart as needed values: { // Specify the chart values here, for example: // replicaCount: 2, // image: "your-image", // ... }, }, { provider: new k8s.Provider("k8s-provider", { kubeconfig: cluster.kubeConfigRaw }) }); // Export the cluster's kubeconfig. export const kubeconfig = cluster.kubeConfigRaw; export const clusterName = cluster.name;
In the program above, you need to replace the placeholders such as
resourceGroupName
,clientId
,clientSecret
,sshPublicKey
,1.2.3
, andhttps://charts.yourhelmrepo.com/
with your actual values.clientId
andclientSecret
are used to authenticate the service principal with Azure. These can be created in the Azure portal.sshPublicKey
is the SSH public key that will be used to access the cluster nodes.
Once you've filled in all the placeholders, you can run the Pulumi program to provision your AKS cluster and deploy the IBM Cloud Pak for Data Watson OpenScale helm chart on the cluster.
Ensure you have Pulumi CLI installed and configured for Azure access, then run the following commands to deploy:
pulumi up
This command will preview and deploy your infrastructure. Follow the Pulumi CLI prompts to complete the deployment.
Note:
You must have Helm and kubectl installed on your system, along with the necessary Azure CLI tools to interact with Azure resources. The kubeconfig will be used by kubectl to manage the resources on the Kubernetes cluster and must be secured appropriately.