Deploy the shubhamchart helm chart on Oracle Kubernetes Engine (OKE)
TypeScriptTo deploy the
shubhamchart
Helm chart on Oracle Kubernetes Engine (OKE), you will need to follow these steps:-
Set up the Oracle Kubernetes Engine (OKE): You'll first need to have an OKE cluster running. You can create and manage Kubernetes clusters in OCI using the
oci.ContainerEngine.Cluster
resource. -
Install the Helm Chart: Once you have your Kubernetes cluster, you'll use the
kubernetes.helm.v3.Chart
resource to deploy the Helm chart to the cluster.
Below is a Pulumi program in TypeScript that demonstrates how to accomplish this. This program assumes that you have already set up Pulumi with the appropriate oracle cloud credentials and have an OKE cluster ready for use.
import * as pulumi from "@pulumi/pulumi"; import * as oci from "@pulumi/oci"; import * as k8s from "@pulumi/kubernetes"; // Use an existing OKE cluster's kubeconfig for our k8s provider. const clusterOci = oci.containerengine.Cluster.get("cluster", "<OKE_CLUSTER_OCID>"); // Create a k8s provider. const provider = new k8s.Provider("okeK8s", { kubeconfig: pulumi.secret(clusterOci.kubeConfigs[0].content), }); // Define the Helm chart, version, and values to apply. const chart = new k8s.helm.v3.Chart("shubhamchart", { chart: "shubhamchart", version: "1.2.3", // replace with the actual chart version // Alternatively specify 'repo' if the chart is located in a Helm repo. // repo: "https://charts.example.com/", values: { // Specify your chart values here. }, }, { provider: provider }); // Export the URL for the deployed Helm chart export const helmChartUrl = chart.getResourceProperty("v1/Service", "shubhamchart", "status");
Before running this program, replace
<OKE_CLUSTER_OCID>
with the actual OCID of your OKE cluster. If your Helm chart requires specific values, place them in thevalues
object. Also, adjust theversion
to match the version of theshubhamchart
that you wish to deploy.Please note that the exact details of the chart, such as its
version
and requiredvalues
, will depend on the specifics of the chart and what it needs to run correctly.This program will create an instance of a Helm chart resource and apply it to your cluster. Pulumi models infrastructure with real programming languages, allowing you to write code that's both declarative and imperative. As a result, the state of your infrastructure is understood and managed by Pulumi, and changes can be easily managed and tracked.
To apply this deployment to your cluster, save the code in a file with a
.ts
extension, and run the following commands in your terminal:pulumi stack init dev # Create a new stack for the development environment pulumi up # Preview and deploy the changes
pulumi up
will show you a preview of the actions Pulumi will take to achieve the desired state (deploying the specified Helm chart) and, upon confirmation, will carry out those actions. The exported endpoint of the Helm chart will be displayed once the deployment is complete.-