1. Deploy the quickstart-python helm chart on Oracle Kubernetes Engine (OKE)

    TypeScript

    To deploy the quickstart-python Helm chart on Oracle Kubernetes Engine (OKE), you'll first need to have an OKE cluster up and running. Once you have that, you can use Pulumi's integration with the Kubernetes provider to deploy Helm charts. The kubernetes.helm.v3.Chart class allows us to deploy charts into a Kubernetes cluster.

    Below is a TypeScript program that demonstrates how to use Pulumi to deploy a Helm chart to your OKE cluster. Before running this program, ensure that you have configured your Pulumi environment for Oracle Cloud and Kubernetes.

    Here is the Pulumi program that accomplishes this:

    import * as oci from "@pulumi/oci"; import * as pulumi from "@pulumi/pulumi"; import * as k8s from "@pulumi/kubernetes"; // This assumes you have a pre-existing OKE cluster set up and the kubeconfig // is set up correctly to connect to your OKE cluster. // Fetch the kubeconfig for the cluster from your environment or other configuration. const kubeconfig = process.env.KUBECONFIG; // Create a provider for the existing OKE cluster. const clusterProvider = new k8s.Provider("okeCluster", { kubeconfig: kubeconfig, }); // Create a Kubernetes Namespace. const ns = new k8s.core.v1.Namespace("app-ns", {}, { provider: clusterProvider }); // Deploy the "quickstart-python" Helm chart into the namespace created above. const chart = new k8s.helm.v3.Chart("quickstart-python", { chart: "quickstart-python", version: "1.0.0", // Replace with the desired chart version. namespace: ns.metadata.name, }, { provider: clusterProvider }); // Export the Namespace name and the Chart name so they can be easily accessed. export const namespaceName = ns.metadata.name; export const chartName = chart.metadata.name;
    1. We import the necessary Pulumi libraries for Oracle Cloud Infrastructure (oci), Pulumi SDK (pulumi), and Kubernetes (k8s).
    2. We fetch the kubeconfig from the environment which contains the required information to connect to the OKE cluster. You must make sure that the KUBECONFIG environment variable is set to the path of your kubeconfig file or contain its content.
    3. We set up a Pulumi provider for Kubernetes that will allow us to operate on the OKE cluster using the kubeconfig we provided.
    4. We create a new Kubernetes namespace where the Helm chart will be deployed. This is good practice for organizational and security purposes.
    5. We deploy the quickstart-python Helm chart using Pulumi's Chart resource. Here, we specify the chart name and the namespace created previously. The version property should specify the version number of the Helm chart you wish to deploy. Make sure to replace "1.0.0" with the actual version number of the quickstart-python chart.
    6. Lastly, we export the names of the created namespace and chart for easy reference, which can be accessed through Pulumi's CLI after the deployment.

    To run this program, save the code to a file with a .ts extension, for instance, deploy-helm-chart.ts, and use the Pulumi CLI to create or update the resources. You can execute pulumi up to deploy the resources as defined above.

    Before running the command, be sure that you are authenticated with Oracle Cloud Infrastructure and have your Kubernetes context set up correctly for the OKE cluster. Also, be sure to have the correct access permissions to deploy resources in your OKE cluster.