Deploy the orchestra-login-portal-argocd helm chart on Azure Kubernetes Service (AKS)
TypeScriptTo deploy the
orchestra-login-portal-argocd
Helm chart on Azure Kubernetes Service (AKS), we need to accomplish a few steps using Pulumi:- Provision an AKS cluster: This will be the environment where your applications will run.
- Install the Argo CD Helm chart: Argo CD is a declarative, GitOps continuous delivery tool for Kubernetes, and you seem interested in deploying a login portal for it.
Below, I will provide a TypeScript program that uses Pulumi to create an AKS cluster and then deploy the
orchestra-login-portal-argocd
Helm chart to it.To get started, ensure you have Pulumi installed and configured to work with Azure. You will also need
kubectl
installed to interact with the AKS cluster, as well as Helm CLI if you want to manage Helm charts manually.Here's your Pulumi program:
import * as pulumi from "@pulumi/pulumi"; import * as azure_native from "@pulumi/azure-native"; import * as k8s from "@pulumi/kubernetes"; // Step 1: Provision an AKS cluster // We use the `azure-native` provider here to provision a managed Kubernetes cluster. const resourceGroup = new azure_native.resources.ResourceGroup("resourceGroup", { resourceGroupName: "orchestraLoginPortalResourceGroup", location: "EastUS", // Choose the appropriate Azure region }); const aksCluster = new azure_native.containerservice.ManagedCluster("aksCluster", { resourceGroupName: resourceGroup.name, agentPoolProfiles: [{ count: 3, // Define the number of nodes modes: ["System"], // System node mode vmSize: "Standard_DS2_v2", osType: "Linux", name: "agentpool", }], dnsPrefix: "orchestraloginportal-aks", linuxProfile: { adminUsername: "azureuser", ssh: { publicKeys: [{ keyData: "ssh-rsa ..." }], // Replace with your SSH public key }, }, servicePrincipalProfile: { clientId: "YOUR_CLIENT_ID", // Azure service principal ID secret: "YOUR_CLIENT_SECRET", // Azure service principal secret }, kubernetesVersion: "1.19.11", location: resourceGroup.location, }); // Export the kubeconfig file for the AKS cluster export const kubeconfig = aksCluster.kubeConfigRaw; // Step 2: Install the Argo CD Helm chart // We will use the `k8s` provider to work with Kubernetes resources within Pulumi. // Ensure that your Pulumi CLI is configured with the appropriate kubeconfig or context. const k8sProvider = new k8s.Provider("k8sProvider", { kubeconfig: aksCluster.kubeConfigRaw, }); // Deploy the `orchestra-login-portal-argocd` Helm chart on our AKS cluster const argoCD = new k8s.helm.v3.Chart("argoCD", { chart: "argo-cd", fetchOpts: { repo: "https://argoproj.github.io/argo-helm", }, // The `values` field should be replaced with the appropriate values // to configure the `orchestra-login-portal-argocd` chart. values: { // Provide specific values for configuring the chart here }, }, { provider: k8sProvider }); // Export the ArgoCD server address export const argoCdServer = argoCD.getResourceProperty("v1/Service", "argo-cd-argocd-server", "status").apply(status => { const ingress = status.loadBalancer.ingress[0]; if (ingress.ip) { return ingress.ip; } else { return ingress.hostname; } });
This script does the following:
- Creates a new resource group in Azure that will contain the AKS cluster.
- Provisions an AKS cluster with the specified node count and size, SSH access configuration, and service principal credentials.
- Exports the generated
kubeconfig
which is needed to access the AKS cluster withkubectl
. - Creates a Pulumi Kubernetes provider instance using the
kubeconfig
from the AKS cluster. - Deploys the Argo CD Helm chart from the specified Helm repository to the AKS cluster using the Kubernetes provider.
Please replace
YOUR_CLIENT_ID
andYOUR_CLIENT_SECRET
with your Azure service principal credentials, and provide your SSH public key where indicated. Make sure to fill in thevalues
field with the necessary values to configure theorchestra-login-portal-argocd
Helm chart.After running this program with the Pulumi CLI, you will have an AKS cluster with Argo CD installed, ready for continuos deployment. The
argoCdServer
output will provide the external IP or hostname you can use to access the Argo CD server.