Deploy the newrelic-private-minion helm chart on Oracle Kubernetes Engine (OKE)
TypeScriptTo deploy the New Relic Private Minion Helm chart on Oracle Kubernetes Engine (OKE), you need to perform several steps. First, you need to set up an OKE cluster, to which you will deploy the chart. Then you need to configure
kubectl
to communicate with the cluster and finally deploy the chart using Helm.For the OKE cluster, Oracle provides the
oci.ContainerEngine.Cluster
resource. You need to configure this with the necessary options such as the VCN ID and Kubernetes version. You will also likely need to manage node pools, which are collections of worker nodes.The
kubernetes.helm.sh/v3.Chart
resource allows you to deploy a Helm chart into a Kubernetes cluster. Helm is a package manager for Kubernetes, which packages multiple Kubernetes resources into a single logical deployment unit called a Chart.Below is a TypeScript program that uses Pulumi to deploy the New Relic Private Minion Helm chart to OKE. This example assumes that you have already set up the necessary cloud provider configuration and have the
kubeconfig
ready for use withkubectl
.import * as oci from "@pulumi/oci"; import * as k8s from "@pulumi/kubernetes"; // Create an OKE cluster const cluster = new oci.ContainerEngine.Cluster("my-cluster", { // Replace these with actual values compartmentId: "ocid1.compartment.oc1..xxxxxx", vcnId: "ocid1.vcn.oc1..xxxxxx", kubernetesVersion: "v1.21.0", // specify the version you need options: { // Customize your OKE cluster options as required } }); // Set up the Kubernetes provider to use the generated kubeconfig from the OKE cluster const k8sProvider = new k8s.Provider("my-k8s-provider", { kubeconfig: cluster.kubeconfig, // This assumes "kubeconfig" is an output of the "cluster" }); // Deploy New Relic Private Minion Helm chart const newrelicChart = new k8s.helm.v3.Chart("newrelic-private-minion", { chart: "newrelic-private-minion", version: "1.2.3", // specify the version of the chart you want to deploy fetchOpts: { repo: "https://helm-charts.newrelic.com", // use the correct Helm repository }, }, { provider: k8sProvider }); // Export the kubeconfig and cluster details export const kubeconfig = cluster.kubeconfig; export const clusterDetails = { id: cluster.id, name: cluster.name, nodePools: cluster.nodePools, // assumes nodePools is the collection of node pool resources for this cluster };
In the code above:
- We first import the required Pulumi packages for OCI and Kubernetes.
- The
oci.ContainerEngine.Cluster
resource is used to provision an Oracle Kubernetes Engine cluster. You must replace "ocid1.compartment.oc1..xxxxxx" and "ocid1.vcn.oc1..xxxxxx" with your compartment ID and VCN ID, respectively. Also, specify the Kubernetes version you want for your cluster. - Next, we create a new Pulumi Kubernetes provider (
k8s.Provider
) which uses the kubeconfig that the OKE cluster outputs. - We then define a Helm chart resource representing the New Relic Private Minion using the
k8s.helm.v3.Chart
class. Therepo
option should point to the New Relic Helm chart repository where the Private Minion chart is located. - The
version
property specifies the version of the chart you want to deploy. You will need to replace "1.2.3" with the actual chart version you wish to use. - The
provider
option ensures that the Helm chart is deployed using the cluster we created earlier. - Finally, we export the kubeconfig and cluster details so they can be easily retrieved after deployment.
Note: Make sure to replace the placeholders and versions with the ones that match your setup and the versions you require. This Pulumi program provides a foundational structure and may require additional customization based on the specific configuration of your New Relic Private Minion chart and Oracle Kubernetes Engine cluster. You might also need to adjust the OCI configuration and add credentials if they have not been set up previously in your Pulumi stack configuration.