Deploy the argo-workflow helm chart on Opensshift
TypeScriptDeploying a Helm chart on OpenShift using Pulumi is similar to deploying to any other Kubernetes cluster, with the caveat that OpenShift has some specific security and networking policies.
The
kubernetes.helm.v3.Chart
resource from the@pulumi/kubernetes
package is typically used to deploy Helm charts. It lets you leverage Helm's package management without having to runhelm
commands separately.Below is a TypeScript program that installs the Argo Workflows Helm chart on an OpenShift cluster. The details are as follows:
- Import Dependencies: The necessary Pulumi and Kubernetes SDK packages are imported.
- Create a Kubernetes Provider: If you have multiple clusters or a specific kubeconfig for your OpenShift cluster, you will need to create a Kubernetes provider pointing to your OpenShift cluster.
- Deploy Helm Chart: The
Chart
resource encapsulates deploying the Argo Workflow Helm Chart by specifying the chart name (argo
) from the desired repository. - Configuration and Customization: You can customize the Helm chart deployment through the
values
property, which allows you to override default configuration values.
Here's what the Pulumi program looks like:
import * as k8s from '@pulumi/kubernetes'; // In a real-world scenario, you would likely need to setup a Kubernetes provider // to interact with your OpenShift cluster. This would involve specifying the kubeconfig // file that points to your OpenShift cluster. For this example, we are going to use the // default provider which assumes that you have already configured `kubectl` to connect // to your OpenShift cluster. const argoWorkflowsChart = new k8s.helm.v3.Chart('argo-workflows', { chart: 'argo-workflows', version: 'x.y.z', // Specify the version of the chart you wish to deploy fetchOpts: { repo: 'https://argoproj.github.io/argo-helm', // The repository where the chart is hosted }, // Define any custom values you want to pass to the chart values: { // For example, enabling persistence or specifying resource requests/limits: persistence: { enabled: true, }, server: { resources: { limits: { cpu: '1000m', memory: '512Mi', }, requests: { cpu: '200m', memory: '256Mi', }, }, }, }, // OpenShift projects (namespaces) have additional security and role configuration. // You might need to adapt the namespace settings or service accounts // depending on your OpenShift project's policies. namespace: 'your-openshift-namespace', // Replace with the namespace you want to deploy Argo Workflows into }); // Export the Chart's name export const chartName = argoWorkflowsChart.resourceNames;
When using Pulumi, you usually only need to run
pulumi up
to perform the deployment, and it will show you a preview of the resources that will be created. After confirmation, Pulumi applies the changes to the cluster.Remember to replace
'x.y.z'
with the version of the Argo Workflows Helm chart you want to use, and'your-openshift-namespace'
with the namespace in your OpenShift you want the chart to be deployed into. Also, adjust thevalues
property to configure the Helm chart as per your requirements.The above script assumes that you have already authenticated to your OpenShift cluster outside of Pulumi, but if you need to specify a kubeconfig file for Pulumi explicitly, you can provide its path in a Kubernetes provider instance and pass that provider to the
Chart
resource.