Skip to main content

Quick Start Guide for Google Cloud Platform GKE

Prerequisites

Before you begin, you need to have a Google Cloud account, a project and install the following tools:

note

For some operation systems we recommend install google-cloud-sdk package instead of google-cloud-cli.

Initialize the gcloud CLI

Perform initial setup tasks and set up your default project:

gcloud init

Set up Environment Variables

Set up environment variables:

export LOCATION=us-central1
export PROJECT_ID={your_project_id}
export CLUSTER_NAME={reportportal_cluster_name}
export REPO_NAME={reportportal_helm_repo_name}
export RELEASE_NAME={reportportal_release_name}
export VERSION={current_chart_version}
export SUPERADMIN_PASSWORD={your_superadmin_password}
note

Here and below we use us-central1 region as a location for GKE cluster.
However, you can use any other region.

Set up gcloud credential helper

If you have Docker, you can use the Docker credential helper to authenticate to Artifact Registry.

Just perform the following commands:

gcloud auth login
gcloud auth configure-docker ${LOCATION}-docker.pkg.dev

Find more information about gcloud credential helper.

Adjust Google Cloud IAM

Installation of ReportPortal requires setting up access to your GKE cluster for creating a service account in GKE and providing permissions for some services to access Kubernetes API.

For adjusting access, you can do it using both Identity and Access Management (IAM) and Kubernetes RBAC.

You can use Predefined GKE Roles and update your account role. To set a service account on nodes, you must also have the Service Account User role (roles/iam.serviceAccountUser).

important

We recommend to create a separate IAM Service Account for working with GKE cluster.

Create a GKE cluster

important

All GKE clusters are created as public clusters by default.

You can create two types of GKE clusters:

note

We recommend to use Autopilot mode.
It is a managed Kubernetes environment that reduces the operational cost.

Create a cluster in Autopilot mode

It's pretty simple to create a cluster in Autopilot mode:

gcloud container clusters create-auto ${CLUSTER_NAME} \
--location=${LOCATION}

More information about creating a cluster in Autopilot mode.

Create a cluster in Standard mode

For a standard cluster you need to specify a machine type and a number of nodes.

ReportPortal requires at least 3 nodes with 2 vCPU and 4 GB memory for each. We recommend using e2-standard-2 machine type with 2 vCPU and 8 GB memory:

export MACHINE_TYPE=e2-standard-2

gcloud container clusters create ${CLUSTER_NAME} \
--zone=${LOCATION} \
--machine-type=${MACHINE_TYPE} \
--num-nodes=3

More information about creating a cluster in Standard mode.

Get cluster credentials for kubectl

gcloud container clusters get-credentials ${CLUSTER_NAME} \
--location=${LOCATION}

Verify the cluster mode

You can verify the cluster:

gcloud container clusters describe ${CLUSTER_NAME} \
--location=${LOCATION}

Prepare Helm package for installation

At the current moment, you can install ReportPortal on GKE cluster via Helm chart only from develop branch.

Create a repository

Create a repository in Artifact Registry for ReportPortal Helm charts:

gcloud artifacts repositories create ${REPO_NAME} --repository-format=docker \
--location=${LOCATION} --description="ReportPortal Helm repository"

More information about Store Helm charts in the Artifact Registry.

Verify that the repository was created:

gcloud artifacts repositories list

Authenticate with the repository

gcloud auth print-access-token | helm registry login -u oauth2accesstoken \
--password-stdin https://${LOCATION}-docker.pkg.dev

Build and push Helm chart

Add GitHub repository on your local machine:

git clone https://github.com/reportportal/kubernetes.git

Build and push the Helm chart to Artifact Registry using actual helm chart version and your project id:

cd kubernetes/reportportal
helm dependency update
helm package .
helm push reportportal-${VERSION}.tgz oci://${LOCATION}-docker.pkg.dev/${PROJECT_ID}/${REPO_NAME}

Install ReportPortal from Artifact Registry

Install Helm chart on GKE Autopilot Cluster

By default, ReportPortal Helm chart install with infrastructure dependencies in GKE Autopilot Cluster:

  • PostgreSQL
  • OpenSearch
  • RabbitMQ
  • MinIO

You can disable an installation of some components via Helm chart values, but you have to provide new credentials for your standalone components.

More information about it you can find here: Install the chart with dependencies.

For installing ReportPortal on GKE Autopilot Cluster, you need to set the:

  • ingress controller as a gce
  • superadmin password
  • resources requests for api, uat, and analyzer services
helm install \
--set ingress.class="gce" \
--set uat.superadminInitPasswd.password=${SUPERADMIN_PASSWORD} \
--set uat.resources.requests.memory="1Gi" \
--set serviceapi.resources.requests.cpu="1000m" \
--set serviceapi.resources.requests.memory="2Gi" \
--set serviceanalyzer.resources.requests.memory="1Gi" \
${RELEASE_NAME} \
oci://${LOCATION}-docker.pkg.dev/${PROJECT_ID}/${REPO_NAME}/reportportal \
--version ${VERSION}

Install Helm chart on GKE Standard Cluster

For installing ReportPortal on GKE Standard Cluster you need to set:

  • ingress controller as a gce
  • superadmin password
helm install \
--set ingress.class="gce" \
--set uat.superadminInitPasswd.password=${SUPERADMIN_PASSWORD} \
${RELEASE_NAME} \
oci://${LOCATION}-docker.pkg.dev/${PROJECT_ID}/${REPO_NAME}/reportportal \
--version ${VERSION}

Ingress configuration

You can add custom gce ingress annotations via ingress.annotations.gce parameter:

helm install \
...
--set-json='ingress.annotations.gce={"key1":"value1","key2":"value2"}'
...

If you have some domain name, set this FQDN to ingress.hosts:

helm install \
...
--set ingress.hosts[0].reportportal.k8.com
...

Certificate Management

Google-managed SSL certificates

note

This is recommended approach for using SSL certificates in GKE.

You can use Google-managed SSL certificates for your domain name:

helm install \
...
--set ingress.tls.certificate.gcpManaged=true
--set ingress.hosts\[0\]="example.com"
...

Cert-Manager

You can use Cert-Manager to manage certificates for your domain name.

Clean up

To delete the cluster:

gcloud container clusters delete ${CLUSTER_NAME} --location=${LOCATION}

To delete the artifacts repository:

gcloud artifacts repositories delete ${CLUSTER_NAME} --location=${LOCATION}

Disable HTTP Load Balancing

If you want to disable HTTP Load Balancing, you can do it after the certificate is attached to the Ingress resource:

kubectl annotate ingress ${APP_NAME}-gateway-ingress kubernetes.io/ingress.allow-http: "false"