1. Deploy the newrelic-private-minion helm chart on Opensshift


    Deploying the New Relic Private Minion Helm chart on an OpenShift cluster involves a few steps. We will use the kubernetes.helm.sh/v3.Chart resource from the Pulumi Kubernetes provider. This resource allows us to deploy a Helm chart to a Kubernetes cluster from within Pulumi.

    Below is a step-by-step guide, followed by the corresponding Pulumi TypeScript program that will perform the deployment:

    1. Prerequisites: Before running the Pulumi program, make sure you have access to an OpenShift cluster and have the kubectl command-line tool configured to communicate with your cluster. Additionally, ensure that Pulumi CLI and Node.js are installed on your machine.

    2. Configure Kubernetes Provider: Pulumi needs to be configured to communicate with your OpenShift Kubernetes cluster. This is typically done via your kubeconfig file, which must be set up correctly to access OpenShift.

    3. Helm Chart: We will deploy the New Relic Private Minion Helm chart. Set the repo and chart properties to the appropriate values for the New Relic chart.

    4. Specify Chart Version: Specify the version of the chart you wish to deploy. If not set, the latest version will be deployed.

    5. Set Values: Helm charts typically accept configuration values in a values.yaml file or as individual settings. With Pulumi, you can pass these directly in the values property of the Chart resource, which is an object containing the configuration settings.

    6. Deploy to OpenShift Namespace: Ensure that a namespace exists in your OpenShift cluster for the deployment, or create one as part of your Pulumi program. Set the namespace property to the namespace you want to deploy the chart to.

    Below is the TypeScript program that can be used with Pulumi to deploy the New Relic Private Minion Helm chart to an OpenShift cluster:

    import * as k8s from '@pulumi/kubernetes'; // Deploy New Relic's Private Minion Helm chart to an OpenShift cluster. const newRelicPrivateMinionChart = new k8s.helm.v3.Chart('newrelic-private-minion', { // Specify Kubernetes API version and kind for a Helm chart. apiVersions: ['v1'], kind: 'Chart', // Reference to your Helm chart and its settings. repo: 'newrelic', // Assume 'newrelic' is the repo name where the chart is located. chart: 'newrelic-private-minion', // Replace with a specific version if needed, or remove to use the latest version. version: '1.2.3', // Replace with the desired chart version. // Configure the chart with necessary values. values: { // Configuration values matching the New Relic Private Minion Helm chart values. // Example: // licenseKey: 'YOUR_NEW_RELIC_LICENSE_KEY', // minion: { // image: 'newrelic/synthetics-minion', // tag: 'latest', // ... // }, // You should replace the placeholders with actual values required by the Helm chart. }, // Set the namespace where the chart will be installed. namespace: 'newrelic', // Replace with the desired namespace, ensure it exists. }, { // Dependency is set to ensure the namespace exists before the Helm chart is deployed. dependsOn: [ // An array of other Kubernetes resources this depends on. // Example: new k8s.core.v1.Namespace("newrelic", { metadata: { name: "newrelic" } }), ], }); // Export the base URL to access the New Relic Private Minion, if applicable. export const baseUrl = newRelicPrivateMinionChart.getResourceProperty( 'v1/Service', 'newrelic-private-minion-service', // Replace with actual service name if different. 'status' ).apply(status => status.loadBalancer.ingress[0].ip); // Customized per your service's access method.

    This code defines a Pulumi program that creates a Helm chart resource targeting an OpenShift cluster. It's configured to deploy the New Relic Private Minion Helm chart. Ensure you replace the placeholder values such as YOUR_NEW_RELIC_LICENSE_KEY, version numbers, image tags, and other configuration options with those that apply to your specific use case.

    Lastly, the exported baseUrl may need to be adjusted depending on the actual service created by the Helm chart and how your OpenShift cluster is set up to expose services.

    To run this Pulumi program, save it to a file called index.ts in a new Pulumi project directory. Navigate to that directory in your terminal and run pulumi up to start the deployment process. Follow the prompts to complete the deployment.