1. Deploy the fastly-exporter helm chart on Oracle Kubernetes Engine (OKE)

    TypeScript

    To deploy the fastly-exporter Helm chart on Oracle Kubernetes Engine (OKE) using Pulumi, you'll need to do the following:

    1. Set up the OKE cluster: Ensure that your Oracle Kubernetes Engine cluster is up and running. This step won't be covered here but is a necessary prerequisite.

    2. Install Pulumi CLI: If Pulumi is not already installed, install the Pulumi CLI.

    3. Configure Pulumi for Oracle Cloud: You need to log in to your Oracle Cloud account using the Pulumi CLI and set the appropriate configuration settings for your OKE cluster. This typically involves setting the region and other specifics to your Oracle Cloud environment.

    4. Write and Deploy the Pulumi Program: You will use TypeScript to write a Pulumi program that will deploy the fastly-exporter Helm chart.

    Here is a detailed Pulumi program that accomplishes the deployment of the fastly-exporter Helm chart to an OKE cluster:

    import * as k8s from "@pulumi/kubernetes"; // Replace with the name of your OKE cluster's kubeconfig context const kubeconfigContext = "<YOUR_OKE_CLUSTER_KUBECONFIG_CONTEXT>"; // Instantiate a Kubernetes provider instance using the context of the OKE cluster const provider = new k8s.Provider("oke-provider", { kubeconfig: kubeconfigContext, }); // Define the details of the fastly-exporter Helm chart const chartName = "fastly-exporter"; const releaseName = "fastly-exporter"; const chartVersion = "<CHART_VERSION>"; // Specify the chart version you wish to deploy const chartRepo = "<CHART_REPO>"; // Specify the Helm repo URL where the chart is hosted, if necessary // Deploy the fastly-exporter Helm chart using the Kubernetes provider for OKE const fastlyExporterChart = new k8s.helm.v3.Chart(releaseName, { chart: chartName, version: chartVersion, fetchOpts: { repo: chartRepo, // Only needed if the chart is not from the default Helm repo }, }, { provider }); // Export any resources or URLs, like the service URL if it's being exposed export const exporterServiceUrl = fastlyExporterChart.getResourceProperty("v1/Service", `${releaseName}-${chartName}`, "status").apply(status => status.loadBalancer.ingress[0].ip);

    In this program:

    • The k8s.Provider resource configures Pulumi to use credentials from our OKE cluster.
    • The k8s.helm.v3.Chart resource is used to deploy a Helm chart. We're specifying the chartName, which would be fastly-exporter, and optionally the chartVersion and chartRepo if your chart is hosted in a Helm repository not known to Helm by default.

    Replace the placeholder values (<YOUR_OKE_CLUSTER_KUBECONFIG_CONTEXT>, <CHART_VERSION>, and <CHART_REPO>) with the actual values for your specific setup. If the fastly-exporter Helm chart is in the public repository, you may not need the repo argument in the fetchOpts.

    Once your Pulumi program is ready, you can run it using the Pulumi CLI:

    pulumi up

    This command initiates the deployment process. You will be prompted for confirmation after Pulumi shows you the planned changes.

    Please ensure that you have the necessary permissions in both Pulumi and Oracle Cloud to perform the deployment.