1. Deploy the reportportal helm chart on Kubernetes

    TypeScript

    To deploy the ReportPortal Helm chart on Kubernetes using Pulumi, you need to be familiar with a few concepts:

    1. Kubernetes: A container orchestration system that automates the deployment, scaling, and management of containerized applications.
    2. Helm: A package manager for Kubernetes, which simplifies the deployment of applications (referred to as charts) on Kubernetes clusters.
    3. ReportPortal: An open-source service that provides capabilities for aggregating and visualizing test results.
    4. Pulumi Kubernetes Provider: This enables Pulumi to interact with Kubernetes resources, including the deployment of Helm charts.

    The main resource we'll use is the kubernetes.helm.v3.Chart, which is a Pulumi resource that allows us to deploy Helm charts on a Kubernetes cluster. We'll define a Pulumi program that creates an instance of this resource to deploy ReportPortal.

    Here's the Pulumi TypeScript program that does just that:

    import * as k8s from "@pulumi/kubernetes"; // We will create a new instance of the `kubernetes.helm.v3.Chart` class, which represents a Helm chart deployment in a Kubernetes cluster. const reportPortalChart = new k8s.helm.v3.Chart("reportportal", { // Specify the name of the Helm chart and the repository where it's located. chart: "reportportal", // The version of the chart if you want to pin to a specific version, omitted here to use the latest. // version: "x.y.z", fetchOpts: { // The repository where the ReportPortal Helm chart is housed. repo: "https://reportportal.github.io/helm-chart", }, // You can provide custom configuration values to the Helm chart through the `values` property. values: { // For instance, you might want to change the service type to LoadBalancer // if you're running on a cloud provider that supports external load balancers. service: { type: "ClusterIP", }, // ... other values }, // Optional: namespace where to deploy the chart, default is "default". // namespace: "reportportal-namespace", }); // Export the base URL for ReportPortal, this would usually be where you can access the deployed application. export const reportPortalUrl = reportPortalChart.getResourceProperty("v1/Service", "reportportal-reportportal-ui", "status") .apply(status => `http://${status.loadBalancer.ingress[0].ip}`);

    This program creates an instance of the Chart class, which Pulumi uses to deploy the ReportPortal Helm chart to your Kubernetes cluster. Inside the constructor, we pass in an object that specifies the following:

    • chart: The name of the Helm chart to deploy. In this case, it's "reportportal".
    • fetchOpts.repo: This is the Helm repository URL where the ReportPortal Helm chart can be found.
    • values: An optional property where you can specify custom configurations for the Helm chart. For example, setting the service type to "ClusterIP" which is suitable for internal cluster access. If you want to expose ReportPortal outside your cluster, you might change this to "LoadBalancer".
    • namespace: Optional Kubernetes namespace to deploy the chart into. If not provided, defaults to the "default" namespace.

    To apply this program, you would need to have Pulumi installed and configured with your desired cloud provider credentials, as well as kubectl configured to point to your Kubernetes cluster.

    At the very end of the program, we export reportPortalUrl which is a computed value that will eventually resolve to the external IP address where ReportPortal is accessible, after the Helm chart is deployed and the services are up and running. Please note that the use of LoadBalancer type and IP address is cloud provider-specific and might not be appropriate if you're running on a local or on-premises environment. Adjust the values configuration and export logic accordingly.

    Before running this Pulumi program, ensure you have the Pulumi CLI installed and authenticated with a Pulumi account. You should also have kubectl configured to communicate with your Kubernetes cluster. After setting up, you would run pulumi up within the directory of your Pulumi program to initiate the deployment process.