1. Deploy the weave-cloud helm chart on Oracle Kubernetes Engine (OKE)

    TypeScript

    To deploy the Weave Cloud Helm chart on Oracle Kubernetes Engine (OKE), you need to have a running OKE cluster and Helm installed in your environment. The following Pulumi program in TypeScript automates the deployment process.

    We will use two main resources: oci.ContainerEngine.Cluster for managing the OKE cluster and kubernetes.helm.sh/v3.Chart for deploying Helm charts to a Kubernetes cluster.

    First, ensure that you have installed Pulumi, configured the Oracle Cloud Infrastructure (OCI) provider, and set up the Kubernetes configuration to point to your OKE cluster.

    The kubernetes.helm.sh/v3.Chart resource allows us to install Helm charts on Kubernetes. We provide it with the chart name (weave-cloud in this case), and it will fetch and install that chart into the designated Kubernetes cluster.

    Here is your TypeScript Pulumi program:

    import * as pulumi from "@pulumi/pulumi"; import * as oci from "@pulumi/oci"; import * as k8s from "@pulumi/kubernetes"; // Use the existing OKE cluster or create a new one if necessary const okeCluster = new oci.ContainerEngine.Cluster("okeCluster", { // ... specify the cluster configuration }); // Use the existing Kubeconfig from the OKE cluster or a previously setup config const k8sProvider = new k8s.Provider("k8s", { kubeconfig: okeCluster.kubeconfig.rawConfig, // This is an example; replace with your actual kubeconfig }); // Deploy the Weave Cloud Helm chart into the OKE cluster const weaveCloudChart = new k8s.helm.sh.v3.Chart("weave-cloud", { chart: "weave-cloud", // Namespace where Weave Cloud components will be installed namespace: "weave", // Ensure you're fetching the chart from the correct repository // You may need to add the Helm repository that contains the Weave Cloud chart // Use `helm repo add` command to add the repository, then reference it here repo: "weaveworks", // This is an example; replace with the actual Helm chart repo name // Set any custom values for the Weave Cloud chart you wish to override // values: { ... } }, { provider: k8sProvider }); // Export the base URL for Weave Cloud which can be accessed after installation export const weaveCloudUrl = okeCluster.endpoints.publicEndpoint;

    In this code:

    • We create an instance of the OKE cluster using oci.ContainerEngine.Cluster.
    • We set up a Pulumi Kubernetes provider with the kubeconfig from the OKE cluster.
    • We introduce a Helm chart resource using k8s.helm.sh/v3.Chart to install the Weave Cloud chart from the specified Helm repository.
    • We specify the namespace for the chart and the repository which contains the Weave Cloud chart.
    • The weaveCloudUrl export shows the endpoint to access Weave Cloud once it is deployed.

    Make sure to replace placeholder values like // ... specify the cluster configuration and repo: "weaveworks" with your actual cluster configuration and the correct Helm repository name.

    Before running the Pulumi program, ensure that your OKE cluster is up and that you have access to its kubeconfig file. Additionally, if the Weave Cloud chart requires any specific values to be set, you can provide them in the values section of the Chart resource.

    To deploy this Pulumi program:

    1. Save the code in a file named index.ts.
    2. Run pulumi up to execute the Pulumi program.
    3. Confirm the preview looks correct and then proceed with the deployment.

    Your Weave Cloud Helm chart will now be deployed on your Oracle Kubernetes Engine cluster.