Deploy the jaeger-all-in-one-opentelemetry helm chart on Opensshift
TypeScriptTo deploy the
jaeger-all-in-one-opentelemetry
Helm chart on an OpenShift cluster using Pulumi, you will need to use thekubernetes.helm.v3.Chart
resource from the Pulumi Kubernetes provider. This resource allows you to deploy Helm charts into a Kubernetes cluster managed by Pulumi.Here's how you do it:
- First, you must have access to an existing OpenShift cluster and be authenticated with
kubectl
configured to communicate with it. - You will then use the
Chart
resource to specify the deployment of thejaeger-all-in-one-opentelemetry
Helm chart.
Below is a Pulumi TypeScript program that demonstrates this process:
import * as k8s from "@pulumi/kubernetes"; const jaegerChart = new k8s.helm.v3.Chart("jaeger-all-in-one-opentelemetry", { // Specify the chart repository URL and chart name. chart: "jaeger-all-in-one-opentelemetry", version: "<chart-version>", // specify the chart version if needed fetchOpts: { repo: "https://jaegertracing.github.io/helm-charts", // specify the Helm chart repository URL }, // Provide values to customize the deployment if needed. values: { // Values to configure Jaeger. Here you would specify any custom values you require. // For example, to set a specific OpenTelemetry collector configuration: // collector:{ // config: `otel-collector-config`, // }, }, // This chart will be deployed into the 'default' Kubernetes namespace, // but you can specify a different namespace if required. namespace: "default", // change to OpenShift project if required }); // Export the URL to access the deployed Jaeger instance export const jaegerUrl = jaegerChart.getResourceProperty("v1/Service", "jaeger-query", "status").apply(status => { const lb = status.loadBalancer; if (lb && lb.ingress && lb.ingress.length > 0) { const ingress = lb.ingress[0]; if (ingress.ip) return `http://${ingress.ip}`; if (ingress.hostname) return `http://${ingress.hostname}`; } return "LoadBalancer not provisioned"; });
Explanation
- Import the Kubernetes package: We import the Pulumi Kubernetes package which is necessary to interact with the Kubernetes cluster.
- Create a Helm Chart resource: We instantiate the
Chart
class from Pulumi's Kubernetes provider, passing the chart name as"jaeger-all-in-one-opentelemetry"
. - Configuration Options: Through the
fetchOpts
, you can specify therepo
URL from where to fetch the Helm chart. In thevalues
object, you can override the default chart values to customize the Jaeger deployment according to your needs. - Export a URL: After the deployment, we try to compute a URL where Jaeger's service can be accessed. This snippet assumes it will be exposed through a LoadBalancer service. If the OpenShift cluster does not provide a LoadBalancer, you will need to adjust this code snippet to match your service exposing strategy (like a Route or NodePort service).
Before you run this program, replace
<chart-version>
with the specific version of the chart that you wish to deploy. If you're not sure which version to use, you can runhelm search repo jaegertracing/jaeger
to find available versions.To execute this Pulumi program, make sure you have Pulumi installed and configured for your OpenShift cluster. Then, save the code in a file named
index.ts
, and run the following commands:pulumi up # Preview and deploy changes pulumi stack output jaegerUrl # To fetch the URL after deployment
Remember to install all necessary NPM packages with
npm install
before runningpulumi up
. You'll need at least the@pulumi/pulumi
and@pulumi/kubernetes
packages.This Pulumi program will deploy the
jaeger-all-in-one-opentelemetry
Helm chart into the default namespace. If you're deploying into a specific OpenShift project, you should specify that project name in thenamespace
property of theChart
resource.- First, you must have access to an existing OpenShift cluster and be authenticated with