1. Deploy the jaeger-all-in-one-opentelemetry helm chart on Oracle Kubernetes Engine (OKE)

    TypeScript

    To deploy the Jaeger All-In-One OpenTelemetry Helm chart on Oracle Kubernetes Engine (OKE), we will leverage Pulumi's @pulumi/kubernetes package to interact with Kubernetes resources, and specifically the helm.sh/v3.Chart resource for Helm Charts.

    In this Pulumi program, we will go through the following steps:

    1. Import necessary Pulumi packages.
    2. Instantiate an OKE cluster where our application will be deployed.
    3. Deploy the Jaeger All-In-One OpenTelemetry Helm chart to the OKE cluster.

    It is important to note that you should have your Oracle Cloud Infrastructure (OCI) credentials configured either through the OCI command-line interface (oci-cli) or through environment variables, as Pulumi will use them to interact with the cloud resources.

    Below is the TypeScript program that shows you how to deploy the Jaeger Helm chart on OKE:

    import * as pulumi from "@pulumi/pulumi"; import * as oci from "@pulumi/oci"; import * as k8s from "@pulumi/kubernetes"; // Initialize an OCI provider configuration. const provider = new oci.Provider("oci", { region: "us-phoenix-1", // Replace with the region you want to use }); // Provision an OKE cluster. const cluster = new oci.ContainerEngine.Cluster("oke-cluster", { // Define required cluster properties here, like compartment ID, VCN configuration etc. // compartmentId, vcnId, etc., should be replaced with your actual IDs or pulled from config. compartmentId: "ocid1.compartment.oc1..xxxxxEXAMPLExxxxx", // Since we're setting up an example, we'd need actual OCI properties to create the cluster // For the sake of this program, we are pre-supposing that these resources exist. }, {provider}); // Once the cluster is provisioned, use the kubeconfig to interact with the cluster const k8sProvider = new k8s.Provider("k8s-provider", { kubeconfig: cluster.kubeconfig, }); // Deploy the Jaeger All-In-One OpenTelemetry Helm Chart const jaegerChart = new k8s.helm.v3.Chart("jaeger-all-in-one-opentelemetry", { chart: "jaeger-all-in-one-opentelemetry", version: "1.28.0", // Specify the version of the chart, you can adjust this as needed. // Helm repository configurations might be required. fetchOpts: { repo: "https://jaegertracing.github.io/helm-charts", // Official Jaeger Helm chart repository }, }, { provider: k8sProvider }); // Export the public URL for Jaeger export const jaegerURL = jaegerChart.getResourceProperty("v1/Service", "jaeger-all-in-one-opentelemetry-query", "status") .apply(status => `http://${status.loadBalancer.ingress[0].hostname}`);

    Let's break down the code:

    • We import the necessary Pulumi modules to work with OCI and Kubernetes resources.
    • We create an OCI Provider instance, which allows us to specify our preferred region.
    • We then provision a Kubernetes cluster on OCI using the oci.ContainerEngine.Cluster resource. You need to provide your own compartmentId along with other necessary properties that are specific to your OCI setup.
    • A k8s.Provider instance is used to configure our connection to the Kubernetes cluster using the kubeconfig provided by OKE cluster.
    • The Jaeger Helm chart is deployed using the k8s.helm.v3.Chart resource. The fetchOpts are configured to use Jaeger's official Helm chart repository.
    • Finally, we export the Jaeger service URL, assuming that the chart exposes a LoadBalancer service for the Jaeger UI.

    Once you have this code ready, you can run it using the Pulumi CLI:

    1. Navigate to the directory containing this Pulumi program.
    2. Run pulumi up to create and deploy the resources.
    3. After the deployment is successful, Pulumi will output the Jaeger URL.

    Take note that before you run pulumi up, Pulumi requires you to create a new stack using pulumi stack init if you haven't already done so.