Deploy the quickwit helm chart on Azure Kubernetes Service (AKS)
TypeScriptTo deploy the Quickwit Helm chart on Azure Kubernetes Service (AKS), we will follow these steps:
-
Set up the AKS cluster: First, we need to create an AKS cluster. This is the environment where your Quickwit application will run.
-
Install the Helm chart: Once the AKS cluster is provisioned and configured, we can proceed to deploy the Quickwit Helm chart onto the cluster.
Let's walk through each step.
Set up an AKS cluster
To set up the AKS cluster, we use the
ProvisionedCluster
resource from theazure-native
provider. TheProvisionedCluster
resource allows you to define and configure an AKS cluster in Azure. We will specify certain properties such as the location, Kubernetes version, and node size.Please make sure you've authenticated with Azure and set up the Pulumi Azure Native provider before running this code.
Install Quickwit Helm chart
We will use the
Chart
resource from the Pulumi Kubernetes provider to install a Helm chart. TheChart
resource enables us to deploy packaged applications within the Kubernetes cluster. In this case, we will tell it to install the Quickwit Helm chart.You will need to have your Kubernetes configuration file handy or have your environment configured to connect to your AKS cluster.
Now, let's dive into the Pulumi TypeScript program to deploy a Quickwit Helm chart on AKS.
import * as pulumi from "@pulumi/pulumi"; import * as azure_native from "@pulumi/azure-native"; import * as k8s from "@pulumi/kubernetes"; // Define the AKS cluster resource. const aksCluster = new azure_native.containerservice.ManagedCluster("myQuickwitCluster", { // Provide the required location. resourceGroupName: "myResourceGroup", location: "East US", // Define the properties for the cluster. agentPoolProfiles: [{ count: 2, maxPods: 110, mode: "System", name: "agentpool", osDiskSizeGB: 30, osType: "Linux", vmSize: "Standard_DS2_v2", }], dnsPrefix: "myQuickwitCluster", enableRbac: true, kubernetesVersion: "1.18.14", }); // Export the kubeconfig for the AKS cluster. export const kubeconfig = pulumi. all([aksCluster.name, aksCluster.resourceGroupName]). apply(([name, resourceGroupName]) => azure_native.containerservice.listManagedClusterUserCredentials({ resourceGroupName, resourceName: name, })).apply(creds => Buffer.from(creds.kubeconfigs[0].value, 'base64').toString()); // Define the Helm chart for Quickwit. const quickwitChart = new k8s.helm.v3.Chart("quickwit-chart", { chart: "quickwit", version: "0.1.0", // Quickwit Helm chart repository details can be specified here fetchOpts: { repo: "https://quickwit.github.io/helm-charts/", }, }, { provider: new k8s.Provider("k8s-provider", { kubeconfig }) }); // Expose the IP address of the Quickwit service once it's ready. const quickwitService = quickwitChart.getResource("v1/Service", "quickwit"); export const quickwitIpAddress = quickwitService.status.loadBalancer.ingress[0].ip;
In this program:
- We're defining a managed AKS cluster named
myQuickwitCluster
in a resource groupmyResourceGroup
. - The
agentPoolProfiles
defines the size of the node, the number of nodes, and the disk size, among other settings. export const kubeconfig
takes the output of the created AKS cluster and fetches the kubeconfig, which is needed to interact with the cluster.- We're creating a new instance of a Helm chart using the
Chart
resource to deploy Quickwit. The details of the Helm repository where the Quickwit chart can be found are specified in thefetchOpts
field. - We define a Kubernetes Service to provide a stable endpoint for accessing Quickwit. The Quickwit Helm chart should define a service that exposes the application.
- Lastly, we export the IP address of the Quickwit service that can be used to access your Quickwit instance.
To deploy this stack, save the above code in a file, for example
index.ts
, and run the following commands:pulumi stack init myQuickwitStack pulumi up
This will prompt you to log in to your Pulumi account and deploy the resources as defined in the code. After successfully deploying, Pulumi will output the Kubernetes cluster's kubeconfig and the IP address of the Quickwit service.
-