Deploy the sumo helm chart on Rancher
TypeScriptTo deploy the Sumo Logic Helm chart on a Rancher-managed Kubernetes cluster, you would typically follow these steps:
- Set up Helm and Tiller in your Kubernetes cluster managed by Rancher.
- Add the Sumo Logic Helm repository to your configuration.
- Update the Helm chart repository to ensure you have the latest version of charts.
- Create a
values.yaml
file with the configuration needed for Sumo Logic. - Run the Helm command to install the Sumo Logic chart into your cluster with your values.
To automate this process using Pulumi, we would leverage Pulumi's programming model to script the Helm chart installation.
Here's a TypeScript program example using Pulumi's Rancher 2 and Kubernetes providers to deploy the Sumo Logic Helm chart:
import * as k8s from "@pulumi/kubernetes"; import * as rancher2 from "@pulumi/rancher2"; import * as pulumi from "@pulumi/pulumi"; // Assume we have a Rancher 2 Kubernetes cluster previously set up, // and we are going to deploy the Helm chart into this cluster. // Fetch the kubeconfig from the Rancher 2 cluster using Pulumi's rancher2 provider. // Replace `clusterName` with the name of your Rancher-managed Kubernetes cluster. const clusterKubeConfig = pulumi.output(rancher2.getClusterKubeConfig({name: "clusterName"})); // Create a provider for the Kubernetes cluster managed by Rancher 2. const k8sProvider = new k8s.Provider("rancherK8s", { kubeconfig: clusterKubeConfig.kubeConfig, }); // Add the Sumo Logic Helm chart repository. const sumoLogicChartRepo = new k8s.helm.v3.Repository("sumologic-repo", { name: "sumologic", url: "https://sumologic.github.io/sumologic-kubernetes-collection", // Official Sumo Logic Helm repository }, { provider: k8sProvider }); // Use the Helm chart to install Sumo Logic. // You must configure the `values` to match the requirements for your Sumo Logic setup. const sumoLogicRelease = new k8s.helm.v3.Release("sumologic-release", { chart: "sumologic", version: "2.1.3", // use the version that suits your requirements repositoryOpts: { repo: sumoLogicChartRepo.url, }, namespace: "sumologic", values: { // Specify your Helm chart values here or leave it empty to use defaults // Example value structure for Sumo Logic // sumologic: { // accessId: "<Your Sumo Logic Access ID>", // accessKey: "<Your Sumo Logic Access Key>", // }, }, }, { provider: k8sProvider }); // Export the Helm release status export const sumoLogicReleaseStatus = sumoLogicRelease.status;
This Pulumi program performs the following actions:
- It uses the
rancher2.getClusterKubeConfig
function to fetch the kubeconfig for a given Rancher 2 Kubernetes cluster. - It creates a Kubernetes provider that communicates with the cluster via this kubeconfig.
- It defines a Helm repository resource that represents the Sumo Logic Helm chart repository using the
@pulumi/kubernetes
provider. - It then creates a Helm release resource that deploys the Sumo Logic Helm chart with the required configuration (you need to replace the placeholder values in
values
with your actual Sumo Logic configurations).
Please note that you should replace
clusterName
with the actual name of your Rancher Kubernetes cluster and fill in thevalues
with your specific Sumo Logic configuration values such asaccessId
andaccessKey
. These values are typically sensitive and should be treated as secrets.Overall, Pulumi scripts the deployment process, which you could otherwise manually execute using Helm and Rancher UI or CLI. With Pulumi, you can version control your infrastructure, share and collaborate with teammates, and automate deployments across environments.