Deploy the ibm-skydive-dev helm chart on Opensshift
TypeScriptIn order to deploy the IBM Skydive Helm chart on an OpenShift cluster, ensure you have an OpenShift cluster up and running,
kubectl
configured to interact with the cluster, andhelm
command line tool installed if you're going to manually handle Helm charts. In this case, we are using Pulumi with the Kubernetes provider to deploy the Helm chart which will handle Helm internally.Here is how you can achieve this with Pulumi in TypeScript:
- First, you need to install the Pulumi CLI and set up your Pulumi account.
- Then, ensure you have access to your OpenShift cluster with kubectl.
- Now, you will write a Pulumi program that uses the Kubernetes provider to deploy a Helm chart.
- The
kubernetes.helm.v3.Chart
class from the Pulumi Kubernetes provider allows you to deploy Helm charts.
I'll provide you with a detailed Pulumi program, which will deploy the
ibm-skydive-dev
Helm chart on your OpenShift cluster. Please replace the placeholders with actual values specific to your environment, especiallyrepo
where your Helm chart is located andvalues
with the necessary configurations for the chart.import * as k8s from '@pulumi/kubernetes'; // A new Helm chart for IBM Skydive, specifying the chart and repository. const skydiveChart = new k8s.helm.v3.Chart('ibm-skydive-dev', { chart: 'skydive', // The name of the chart in the repository version: '0.1.0', // Replace with the actual chart version namespace: 'default', // Choose the appropriate namespace or create a new one fetchOpts: { repo: 'https://my-helm-chart-repo.org/', // Replace with the URL of the Helm chart repository }, // If you have custom values, define them here: values: { // Examples: // serviceType: 'ClusterIP', // resources: { // limits: { // cpu: '100m', // memory: '256Mi', // }, // requests: { // cpu: '100m', // memory: '256Mi', // }, // }, }, }, { provider: /* your Openshift kubernetes provider reference here */ }); // Export the base URL for the deployed application export const skydiveUrl = skydiveChart.getResourceProperty('kubernetes:core/v1:Service', 'ibm-skydive-dev', 'status').apply(status => { const ingress = status.loadBalancer.ingress[0]; return ingress.hostname || ingress.ip; });
This Pulumi program defines a single Kubernetes Helm chart. When you run
pulumi up
with this code, Pulumi will reach out to the given Helm chart repository, pull the specifiedskydive
Helm chart, and apply it to your Kubernetes cluster—OpenShift in this case.Here is what each part of the code does:
- The
import
statement allows you to use the Kubernetes plugin within Pulumi. skydiveChart
: This is a Pulumi resource representing the Helm chart you wish to deploy. It needs a name (first argument) and a set of configurations (second argument) that tell Pulumi where to find the chart and any special configurations you want to pass.fetchOpts.repo
: This is where you put the URL of the Helm chart repository containing theibm-skydive-dev
chart.values
: If the Helm chart requires it, you can specify a values object that contains the values for the chart's settings. This is equivalent to a values.yaml file used in Helm. These should match the schema expected by the Helm chart you're deploying.getResourceProperty
: This is a Pulumi function to retrieve a specific attribute from an already deployed resource—in this case, the external URL of Skydive once it is deployed.export
: This statement allows you to output the URL of the deployed service so you can easily access it after deployment.
Before running this Pulumi program, you may also need to set up your Pulumi Kubernetes provider to connect to your OpenShift cluster which can be done based on your specific cluster configuration.
When you're ready, navigate to your Pulumi project directory in the terminal and run:
pulumi up
This command will deploy your Helm chart to the OpenShift cluster. Follow the Pulumi CLI prompts to complete the deployment. Once finished, if you included the
export
statement, you'll be provided with the URL to access your IBM Skydive deployment.