Deploy the aws-eks-asg-rolling-update-handler helm chart on Opensshift
TypeScriptTo deploy the
aws-eks-asg-rolling-update-handler
Helm chart on OpenShift, we will use Pulumi's Kubernetes provider to interact with the Kubernetes API and helm charts.First, make sure you have an existing OpenShift cluster and your
kubeconfig
is correctly set up to point to this cluster. Pulumi's Kubernetes provider will use this configuration to interact with your cluster.We use Pulumi's
kubernetes.helm.v3.Chart
resource to deploy a Helm chart. TheChart
resource is a high-level abstraction, which represents a Helm chart deployment in a Kubernetes cluster.The following TypeScript program illustrates how you can use Pulumi to deploy the specified helm chart to an OpenShift cluster:
import * as kubernetes from "@pulumi/kubernetes"; const awsEksAsgRollingUpdateHandlerChart = new kubernetes.helm.v3.Chart("aws-eks-asg-rolling-update-handler-chart", { // Specify the repository and chart details as well as any custom values you wish to provide chart: "aws-eks-asg-rolling-update-handler", version: "0.1.0", // Specify the version of the chart you wish to deploy fetchOpts: { repo: "https://aws.github.io/eks-charts", // Official AWS Helm charts repository }, // If you need to provide a Helm values file or override chart values, use the `values` field here // values: { /* ... */ }, // namespace where the chart will be installed namespace: "default", // You can change this to the namespace where you want to install your Helm chart }, { provider: /* your openshift kubernetes provider reference here */ }); // Exports can be used to print out certain information after deployment export const helmChartName = awsEksAsgRollingUpdateHandlerChart.name;
This program uses the
@pulumi/kubernetes
package, which should be installed in your project:npm install @pulumi/kubernetes
You have to replace the placeholder
/* your openshift kubernetes provider reference here */
with your OpenShift's Kubernetes provider instance if you have one. If you're using the default provider (configured via thekubeconfig
file), you can leave theprovider
field unspecified.Please ensure you specify the correct chart
version
that you want to deploy. Additionally, thenamespace
should be set to a namespace that exists in your OpenShift cluster or one you wish to create.After writing this code in a file (e.g.,
index.ts
), you can deploy it using the Pulumi CLI:pulumi up
Ensure you have run
pulumi login
and have selected the correct stack before runningpulumi up
. If you have not created a stack yet, you can create one withpulumi stack init
.This command creates or updates resources in your OpenShift cluster to match the desired state described in the program. Once the command completes, the outputs of the deployment thus the
helmChartName
will be displayed.Remember that deploying the
aws-eks-asg-rolling-update-handler
helm chart is specific for AWS EKS clusters, and the usefulness of this chart in OpenShift might be limited as it operates with AWS specific resources. Ensure that the Helm chart you deploy is appropriate for your OpenShift environment and that you understand what resources it will create and manage in your cluster.