Deploy the saml-exporter helm chart on Digital Ocean Kubernetes Service
TypeScriptDeploying a Helm chart on a Kubernetes cluster in Digital Ocean involves several steps:
- Create a Digital Ocean Kubernetes (DOKS) cluster.
- Configure
kubectl
to communicate with the cluster. - Install Helm on your local machine.
- Use Helm to deploy the
saml-exporter
chart to the DOKS cluster.
Let's write a Pulumi program in TypeScript to create the DOKS cluster and then guide you through the remaining steps to deploy the Helm chart.
The Pulumi program below will create a new DOKS cluster for you:
import * as digitalocean from "@pulumi/digitalocean"; import * as pulumi from "@pulumi/pulumi"; // Create a DigitalOcean Kubernetes cluster with a default node pool. const cluster = new digitalocean.KubernetesCluster("saml-exporter-cluster", { region: digitalocean.Regions.NYC1, version: "latest", // Use the latest available Kubernetes version or specify your preferred version nodePool: { name: "default", size: digitalocean.DropletSlugs.DropletS2VCPU2GB, nodeCount: 3, // Number of nodes in the pool }, }); // Export the cluster details export const kubeconfig = cluster.kubeConfigs[0].rawConfig; export const clusterName = cluster.name;
After running this Pulumi program, you'll have a new Kubernetes cluster up and ready to go in your Digital Ocean account. Let's go over the other necessary steps:
Configure
kubectl
to Communicate with the ClusterAfter you’ve created the cluster with Pulumi, you'll have a
kubeconfig
file that allows you to connect to your new Kubernetes cluster withkubectl
. To set up thekubectl
connection:# After pulumi up finishes, it will print out the kubeconfig as an output # You can also access the kubeconfig via the Pulumi console pulumi stack output kubeconfig > kubeconfig.yaml export KUBECONFIG=kubeconfig.yaml
Install Helm
You'll need Helm installed on your local machine. Follow the official Helm installation guide for detailed instructions.
Deploy the
saml-exporter
Helm ChartTo deploy the
saml-exporter
chart, you'll need to know the repository it's located in. With Helm installed and yourkubectl
configured, run:helm repo add <repo-name> <repo-url> # Replace with the saml-exporter chart's repository name and URL helm install saml-exporter <repo-name>/saml-exporter
If you need to pass specific values to customize the Helm chart, use a
values.yaml
file or pass values using the--set
flag.That's it! You've now created a Kubernetes cluster on Digital Ocean and deployed a Helm chart to it.
Remember that for managing Helm charts with Pulumi, you could also use the pulumi-kubernetes package that allows you to manage Helm charts directly within your Pulumi program. However, as you're specifically looking to deploy the
saml-exporter
, this is usually done after the fact, using the Helm CLI once the cluster is up and running. If you prefer to manage the Helm release fully in Pulumi, let me know so that I can guide you through that process as well.