Deploy the reporting-legacy-api helm chart on Oracle Kubernetes Engine (OKE)
TypeScriptTo deploy a Helm chart on Oracle Kubernetes Engine (OKE) using Pulumi, you'll need to perform a few steps:
- Set up Oracles' Cloud Infrastructure (OCI) and configure it as the cloud provider for Pulumi.
- Create a Kubernetes cluster using the
oci.ContainerEngine.Cluster
resource. - Deploy a Helm chart on the created Kubernetes cluster using the
kubernetes.helm.sh/v3.Chart
resource.
I'll guide you through a Pulumi program in TypeScript that accomplishes these tasks. Before the provided program can be run, ensure that you have Pulumi installed, are authenticated with Oracle Cloud, and have the necessary OCI configuration set up, including region, tenancy OCID, user OCID, private key, and fingerprint.
Here is a step-by-step Pulumi program that deploys a Helm chart on OKE:
import * as pulumi from "@pulumi/pulumi"; import * as oci from "@pulumi/oci"; import * as k8s from "@pulumi/kubernetes"; // Initialize a new Pulumi project for Oracle Cloud Infrastructure. const config = new pulumi.Config(); // Here we would need the OCI configuration like region, tenancy OCID, user OCID, private key, and fingerprint. // These details are expected to be configured in the OCI provider or through environment variables. // Step 1: Create the Oracle Kubernetes Engine (OKE) cluster const cluster = new oci.containerengine.Cluster("reporting-legacy-api-cluster", { // Note: You will need to provide your own VCN and subnet configuration vcnId: config.require("vcnId"), kubernetesVersion: "v1.20.8", options: { // Additional OKE cluster options, if needed }, // You can apply more configurations as needed for your specific requirements, such as node pool setup. }); // Step 2: Deploy the reporting-legacy-api Helm chart on the created cluster // We will need to setup the K8s provider pointing to the created OKE cluster. // The kubeconfig can be obtained once the cluster is created. const k8sProvider = new k8s.Provider("oke-k8s", { kubeconfig: cluster.kubeconfig, }); // Assuming the Helm chart is hosted in a Helm repository or available locally. // Replace `<repoUrl>` with the URL of the Helm repository where your chart is located. const reportingLegacyApiChart = new k8s.helm.v3.Chart("reporting-legacy-api", { chart: "reporting-legacy-api", version: "<chartVersion>", // replace with the version of the chart // Set values for the chart as needed. values: { // Optionally provide configuration values for the Helm chart }, }, { provider: k8sProvider }); // Step 3: Export the cluster's kubeconfig output export const kubeconfig = cluster.kubeconfig; // End of Pulumi program
This program can be run using the
pulumi up
command within the directory that contains the program file. Please ensure all dependencies are installed and configurations are in place before running the command.This program is an outline; you will need to replace the placeholder values such as
<repoUrl>
and<chartVersion>
with the actual URL of the Helm chart repository and the version of the Helm chart you wish to deploy. Also, before running the program, make sure to insert the required OCI configuration parameters, such asvcnId
, which refers to the ID of the Virtual Cloud Network where the OKE cluster will be created. The Kubernetes provider configuration will use the kubeconfig of the created OKE cluster to manage resources within that cluster.