Deploy the ibm-apic-ptl-instance helm chart on Oracle Kubernetes Engine (OKE)
TypeScriptTo deploy an IBM API Connect developer portal (often referred to as
ibm-apic-ptl-instance
) Helm chart on Oracle Kubernetes Engine (OKE), you will need to follow several steps. These steps include setting up a Kubernetes cluster on OKE, configuring Helm (a Kubernetes package manager) to work with your cluster, and deploying the IBM API Connect Helm chart using Helm.Below is a program written in TypeScript using Pulumi to accomplish this. The program is structured in three main parts:
- Setup Oracle Kubernetes Cluster: Use the Oracle Cloud Infrastructure (OCI) to provision a Kubernetes cluster.
- Deploy Helm chart to OKE: Use the Pulumi Kubernetes provider to deploy the Helm chart to the OKE cluster.
Here's the Pulumi TypeScript program that does just that:
import * as oci from "@pulumi/oci"; import * as k8s from "@pulumi/kubernetes"; // Step 1: Create an OKE Kubernetes cluster const cluster = new oci.containerservice.Cluster("okeCluster", { // Define your cluster configuration here }); // The kubeconfig can be obtained from the cluster details. It's used to interact with the Kubernetes cluster. const kubeconfig = cluster.kubeconfig.apply(JSON.stringify); // Step 2: Setup Pulumi provider for Kubernetes to use kubeconfig from the OKE cluster const k8sProvider = new k8s.Provider("k8sProvider", { kubeconfig: kubeconfig, }); // Step 3: Deploy the Helm chart const ibmApicPtlInstanceChart = new k8s.helm.v3.Chart("ibm-apic-ptl-instance", { fetchOpts: { repo: "https://<helm-chart-repository>", // Specify Helm chart repository URL here }, chart: "ibm-apic-ptl-instance", // The name of the chart // Specify any custom values for the Helm chart as needed // values: {}, }, { provider: k8sProvider }); // Export the cluster's kubeconfig export const kubeconfigOutput = kubeconfig;
In this program:
- We import the required OCI and Kubernetes packages from Pulumi.
- We create an Oracle Kubernetes Engine (OKE) Kubernetes cluster using the
oci.containerservice.Cluster
resource. You would need to fill in your specific OCI configuration details like compartment IDs, node pool configuration, and associated networking resources. For detailed information on how to configure each parameter, you can refer to the OCI Cluster documentation. - We obtain the
kubeconfig
from the created cluster, which allows us to interact with the Kubernetes cluster programmatically. - We set up a Pulumi Kubernetes provider to connect to the OKE cluster using the
kubeconfig
. - We deploy the
ibm-apic-ptl-instance
Helm chart using thek8s.helm.v3.Chart
resource. You will need to provide the specific Helm chart repository where the IBM API Connect Helm chart is located. - Finally, we export the
kubeconfig
so that you can interact with the Kubernetes cluster using tools such askubectl
.
Before you run this program, make sure that you have:
- Installed Pulumi CLI.
- Configured your Oracle Cloud Infrastructure credentials for Pulumi.
- Access to the IBM API Connect Helm chart repository and updated the placeholder in the
fetchOpts.repo
accordingly.
Once everything is set up, you can deploy your Pulumi program by running
pulumi up
, which will provision the specified resources for you. After the deployment, you can use the outputkubeconfig
to interact with your Kubernetes cluster and confirm the deployment of the IBM API Connect developer portal instance.