Deploy the reportportal helm chart on Azure Managed Openshift Service
TypeScriptTo deploy the ReportPortal Helm chart on an Azure Managed OpenShift service, you will need to follow these steps:
-
Set up an Azure Managed OpenShift Cluster: You need to create an OpenShift cluster in Azure. Azure allows you to create fully managed OpenShift clusters through its Azure Red Hat OpenShift service.
-
Configure Kubectl to connect to your OpenShift Cluster: Once your cluster is ready, you will need to configure your
kubectl
to interact with the cluster. -
Deploy the ReportPortal Helm Chart: You will use the Helm Chart to deploy ReportPortal in your OpenShift Cluster.
Below is the Pulumi program written in TypeScript that demonstrates how to set up these steps. The program will:
- Create an Azure Red Hat OpenShift Cluster.
- Deploy the ReportPortal Helm Chart to the cluster using Kubernetes and Helm related Pulumi packages.
Here is the code, along with explanatory comments:
import * as azure_native from "@pulumi/azure-native"; import * as k8s from "@pulumi/kubernetes"; import * as pulumi from "@pulumi/pulumi"; // Create an Azure Resource Group to contain all the resources const resourceGroup = new azure_native.resources.ResourceGroup("resourceGroup", { resourceGroupName: "openshiftResourceGroup", }); // Create the OpenShiftManagedCluster resource in Azure const openshiftCluster = new azure_native.redhatopenshift.OpenShiftCluster("openshiftCluster", { resourceGroupName: resourceGroup.name, location: resourceGroup.location, resourceName: "myOpenShiftCluster", clusterProfile: { domain: "example", // Replace with your domain name pullSecret: "", // Insert your pull secret here resourceGroupId: resourceGroup.id, version: "4.3.0", // The version of OpenShift you want to use }, masterProfile: { vmSize: "Standard_D8s_v3", // Specify the required VM Size subnetId: "/path/to/your/subnet", // Specify the subnet ID where to place the master node }, networkProfile: { podCidr: "10.0.0.0/14", serviceCidr: "10.3.0.0/16", }, workerProfiles: [{ name: "worker", count: 3, // Specify the number of worker nodes you want vmSize: "Standard_D4s_v3", // Specify the required VM Size for worker nodes subnetId: "/path/to/your/subnet", // Specify the subnet ID where to place the worker nodes }], }); // Deploy the ReportPortal Helm chart to the OpenShift cluster. This requires the cluster to be up and accessible. // The exact values you may wish to configure can depend on your requirements for ReportPortal. const reportPortalChart = new k8s.helm.v3.Chart("reportPortal", { chart: "reportportal", version: "5.3.5", // Assuming using the specific version 5.3.5, adjust as necessary namespace: "default", fetchOpts:{ repo: "http://dl.bintray.com/epam/reportportal", // Replace with ReportPortal's Helm repository URL if it's different }, // Values to override chart default values // This will depend on your specific configuration requirements for ReportPortal. values: { postgresql: { postgresPassword: "<your password here>", resources: null, }, rabbitmq: { rabbitmq: { password: "<your password here>", }, }, }, }, { provider: new k8s.Provider("k8sProvider", { kubeconfig: openshiftCluster.kubeConfigRaw }) }); // Export the OpenShift cluster's name and Kubernetes config export const openshiftClusterName = openshiftCluster.resourceName; export const kubeConfig = openshiftCluster.kubeConfigRaw;
Make sure to replace
<your domain name>
,<your pull secret here>
,<your password here>
, and/path/to/your/subnet
with your actual data. You will also need to have your Azure credentials configured for Pulumi to communicate with Azure.In the sections of code for deploying the ReportPortal Helm chart, you will likely need to fill out more detailed configuration depending on your requirements (refer to the official ReportPortal Helm Chart for more information).
Please note that it can take some time for the cluster to become fully operational before you can deploy applications onto it. The
kubeConfigRaw
output of yourOpenShiftCluster
will contain the configuration needed to connect yourkubectl
CLI tool to the OpenShift cluster.To run this Pulumi program, save it to a file with a
.ts
extension (for example,reportPortalDeploy.ts
), ensure that the Pulumi CLI and the required npm packages are installed, and then execute it using the Pulumi CLI.-