Deploy the ueransim helm chart on Oracle Kubernetes Engine (OKE)
TypeScriptDeploying a Helm chart on Oracle Kubernetes Engine (OKE) involves several steps using Pulumi's infrastructure as code approach. We'll create a program that defines the required cloud resources to host the Helm chart, which in this case is for
ueransim
, a UE and RAN simulator for 5G.The key Pulumi resources we'll use are:
oci.ContainerEngine.Cluster
- This resource creates an Oracle Kubernetes Engine (OKE) cluster, which is a managed Kubernetes environment on Oracle Cloud.kubernetes.helm.sh/v3.Chart
- This resource represents a Helm chart inside a Kubernetes cluster. Helm is a package manager for Kubernetes that allows you to define, install, and upgrade complex Kubernetes applications.
Here is a high-level overview of the program structure:
-
Setting up OKE: We will set up OKE by creating a Kubernetes cluster on Oracle Cloud Infrastructure (OCI). This step will make use of the
oci.ContainerEngine.Cluster
resource to provision the cluster. -
Helm Chart Deployment: After the cluster is up and running, we will deploy the
ueransim
Helm chart into the cluster. We will use thekubernetes.helm.sh/v3.Chart
resource to achieve this. The Helm chart will include all the necessary Kubernetes resources defined byueransim
, which might consist of Deployments, Services, and other necessary resources. -
Configurations: We will specify any values for configuring the
ueransim
deployment, which are passed to the Helm chart.
Below is a Pulumi TypeScript program that demonstrates these steps:
import * as pulumi from "@pulumi/pulumi"; import * as oci from "@pulumi/oci"; import * as k8s from "@pulumi/kubernetes"; // Initialize OCI provider configuration const provider = new oci.Provider("oci", { region: "us-phoenix-1", // replace with the region in which you want to create OKE }); // Create an OKE cluster const cluster = new oci.ContainerEngine.Cluster("okeCluster", { // You need to fill out these properties based on your specific OCI setup // compartmentId: Your compartment ID // vcnId: Your VCN ID where you'd like to set up the OKE // kubernetesVersion: The version of Kubernetes you'd like to use // ... and other cluster-related configurations }); // Using the generated kubeconfig from the OKE cluster const kubeconfig = cluster.kubeconfigs.apply(kc => kc[0].content); // Create a k8s provider instance using the kubeconfig const k8sProvider = new k8s.Provider("k8sProvider", { kubeconfig: kubeconfig, }); // You'll need the correct chart name and repository where `ueransim` is hosted const ueransimChart = new k8s.helm.v3.Chart("ueransim", { chart: "ueransim", // e.g., repository: "https://...", version: "x.y.z", // Specify the chart version namespace: "ueransim-namespace", // Specify the namespace or leave it to use the default namespace // values: Here you will specify any specific configurations needed by the ueransim Helm chart }, { provider: k8sProvider }); // Export the K8s cluster name and kubeconfig export const clusterName = cluster.name; export const kubeconfigFile = pulumi.secret(kubeconfig);
Steps to Run This Program:
-
Set Up Pulumi: Make sure you have Pulumi CLI and the required OCI (Oracle Cloud Infrastructure) CLI setup on your system.
-
OCI Credentials: The OCI credentials need to be configured locally; you can set this up using the
oci setup config
command from the Oracle CLI tool. Pulumi uses these credentials to authenticate with Oracle Cloud. -
Pulumi Stack: Initialize a new Pulumi stack or use an existing one.
-
Install Node.js and NPM: To run the Pulumi program, you need to have Node.js and NPM installed since we're using TypeScript.
-
Install Dependencies: Execute
npm install
oryarn
to install the dependencies specified in thepackage.json
file. -
Pulumi Deploy: Run
pulumi up
to deploy the program; during the deployment, Pulumi will provision the necessary OCI and Kubernetes resources. -
Access Kubeconfig: After deployment, a kubeconfig file will be created which you can use with
kubectl
to interact with your OKE cluster. -
Verify Deployment: Verify the deployment by checking the status of the resources in OKE using the
kubectl get all
command or through the OCI console.
Please replace placeholder values like
compartmentId
,vcnId
, and other configurations with actual values for your Oracle Cloud Infrastructure environment before running this program. Additionally, you'll need the repository URL and chart version for theueransim
Helm chart to specify in the chart instantiation.