1. Deploy the onap helm chart on Kubernetes

    TypeScript

    To deploy the ONAP (Open Network Automation Platform) Helm chart on a Kubernetes cluster using Pulumi, we'll use the kubernetes.helm.v3.Chart resource from the Pulumi Kubernetes provider. This resource allows you to provide a Helm chart either from a repository or from a local path and deploy it into your Kubernetes cluster.

    Here is a structured outline of the steps we'll take in the Pulumi program:

    1. Import required packages: We'll import the necessary Pulumi and Kubernetes packages.
    2. Create a Kubernetes Provider: If you're targeting a specific cluster which is not your current context, you would need to create and configure a Kubernetes provider.
    3. Deploy Helm Chart: Use the Chart resource to deploy ONAP Helm chart. You would need the chart name and optionally the repository URL if it's not a standard one, any custom values you want to override in the chart, and the namespace to deploy.

    Below is the TypeScript program that follows these steps.

    import * as k8s from '@pulumi/kubernetes'; // Step 1: Set up the ONAP Helm Chart details. // Replace `chartVersion` and `repoUrl` with the appropriate values for the ONAP Helm chart. const chartName = 'onap'; const chartVersion = 'x.y.z'; // specify the chart version const repoUrl = 'https://helm.onap.org/kubernetes'; // specify the ONAP Helm repo URL if available const namespace = 'onap'; // specify the namespace where you want to install ONAP // Step 2: If you need to target a specific Kubernetes cluster, configure the provider here. // If you're using the current context from your kubeconfig, this step is not necessary. // // const k8sProvider = new k8s.Provider('k8s-provider', { // kubeconfig: '<YOUR_KUBECONFIG_CONTENTS>', // }); const onapHelmChart = new k8s.helm.v3.Chart(chartName, { chart: chartName, version: chartVersion, fetchOpts: { repo: repoUrl, }, namespace: namespace, // If you need to specify additional configurations, you can set them in `values`. // Example: // values: { // someParameter: 'someValue', // }, }, { /* Uncomment if you have a custom provider: provider: k8sProvider */ }); // Export the Helm chart deployment name (release name) export const onapDeploymentName = onapHelmChart.getResourceProperty('v1/Service', `${namespace}-onap`, 'metadata').apply(m => m.name);

    Here's a breakdown of what this program does:

    • We import the Pulumi Kubernetes package that includes the capabilities to interact with Kubernetes clusters.
    • We specify details like the name of the ONAP chart, the version you wish to deploy, and the Helm chart repository URL if it's hosted on a custom Helm repository.
    • We create an instance of the Chart resource which Pulumi uses to install the ONAP chart. If you have a kubeconfig file for a non-default cluster, you can instantiate a k8s.Provider and pass it to the Chart resource.
    • Additionally, you have the option to include a values object which allows you to override default configurations in the Helm chart.

    After running this program with Pulumi (using pulumi up), the ONAP platform will be deployed to your Kubernetes cluster. Make sure to replace chartVersion, repoUrl, and any other placeholder values with actual information pertinent to your deployment scenario.

    Keep in mind that deploying ONAP is a complex task that involves many detailed configurations. The above program assumes a Helm chart is readily available with all necessary ONAP components defined. Individual ONAP services may require additional configuration through the values object, which you would add based on your specific requirements. It's important to refer to the ONAP Helm chart documentation for all necessary configurations.