-
Notifications
You must be signed in to change notification settings - Fork 196
gke install
- Quick Start Guide for Google Cloud Platform GKE
Before you begin, you need to have a Google Cloud account, a project and install the following tools:
- kubectl 1.28 or later
- Helm 3.11 or later
- google-cloud-cli
- gke-gcloud-auth-plugin
Note: For some operation systems we recommend install
google-cloud-sdkpackage instead ofgoogle-cloud-cli.
Perform initial setup tasks and set up your default project:
gcloud initSet up environment variables:
export REPO_LOCATION=us-central1
export CLUSTER_LOCATION=us-central1-a
export PROJECT_ID=$(gcloud config get-value project | tr ':' '/')
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-central1region as a location for GKE cluster. However, you can use any other region.
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 ${REPO_LOCATION}-docker.pkg.devYou can find more information about gcloud credential helper here.
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. Read about it here.
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.
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.
It's pretty simple to create a cluster in Autopilot mode:
gcloud container clusters create-auto ${CLUSTER_NAME} \
--location=${REPO_LOCATION}Note: You can use the Google Filestore CSI driver for the Autopilot cluster. It is enabled by default. Minimal storage size for Google Filestore is 1 TB. Check the pricing.
For more information about creating a cluster in Autopilot mode you can find here.
For a standard cluster you need to specify a machine type and a number of nodes.
ReportPortal requires at least 3 nodes with 4 vCPU and 6 GB memory for each in
the Kubernetes with infrastructure dependencies.
We recommend using custom-4-6144 machine type with 4 vCPU and 6 GB memory
as a minimal configuration.
If you want avoid using MinIO or Google Cloud Storage, you can use a filesystem storage type and Google Filestore as a storage class.
For this, you need to enable the Google Filestore CSI driver when creating a cluster:
export MACHINE_TYPE=custom-4-6144
gcloud container clusters create ${CLUSTER_NAME} \
--addons=GcpFilestoreCsiDriver \
--zone=${ZONE} \
--machine-type=${MACHINE_TYPE}or you can enable it after the cluster creation:
gcloud container clusters update ${CLUSTER_NAME} \
--update-addons=GcpFilestoreCsiDriver=ENABLEDNote: Minimal storage size for Google Filestore is 1 TB. Check the pricing.
More information about creating a cluster in Standard mode you can find here.
gcloud container clusters get-credentials ${CLUSTER_NAME} \
--location=${CLUSTER_LOCATION}You can verify the cluster:
gcloud container clusters describe ${CLUSTER_NAME} \
--location=${CLUSTER_LOCATION}At the current moment, you can install ReportPortal on GKE cluster via Helm chart only from develop branch.
Create a repository in Artifact Registry for ReportPortal Helm charts:
gcloud artifacts repositories create ${REPO_NAME} --repository-format=docker \
--location=${REPO_LOCATION} --description="ReportPortal Helm repository"More information about Store Helm charts in the Artifact Registry you can find here.
Verify that the repository was created:
gcloud artifacts repositories listgcloud auth print-access-token | helm registry login -u oauth2accesstoken \
--password-stdin https://${REPO_LOCATION}-docker.pkg.devAdd GitHub repository on your local machine:
git clone https://github.com/reportportal/kubernetes.gitBuild 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://${REPO_LOCATION}-docker.pkg.dev/${PROJECT_ID}/${REPO_NAME}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://${REPO_LOCATION}-docker.pkg.dev/${PROJECT_ID}/${REPO_NAME}/reportportal \
--version ${VERSION}If you want to use Google Filestore instead of MinIO, you need to set
the storage.type to filesystem, storage.volume.storageClassName
to standard-rwx, and disable MinIO installation:
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" \
--set storage.type="filesystem" \
--set storage.volume.storageClassName="standard-rwx" \
--set minio.install=false \
${RELEASE_NAME} \
oci://${REPO_LOCATION}-docker.pkg.dev/${PROJECT_ID}/${REPO_NAME}/reportportal \
--version ${VERSION}Note: Minimal storage size for Google Filestore is 1 TB. Check the pricing.
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://${REPO_LOCATION}-docker.pkg.dev/${PROJECT_ID}/${REPO_NAME}/reportportal \
--version ${VERSION}If you want to use Google Filestore instead of MinIO, you need to set
the storage.type to filesystem, storage.volume.storageClassName
to standard-rwx, and disable MinIO installation:
helm install \
--set ingress.class="gce" \
--set uat.superadminInitPasswd.password=${SUPERADMIN_PASSWORD} \
--set storage.type="filesystem" \
--set storage.volume.storageClassName="standard-rwx" \
--set minio.install=false \
${RELEASE_NAME} \
oci://${REPO_LOCATION}-docker.pkg.dev/${PROJECT_ID}/${REPO_NAME}/reportportal \
--version ${VERSION}Note: Minimal storage size for Google Filestore is 1 TB. Check the pricing.
You can add custom GCE ingress annotations via ingress.annotations parameter:
helm install \
...
--set 'ingress.annotations.kubernetes\.io/ingress\.allow-http=false' \
--set 'ingress.annotations.networking\.gke\.io/v1beta1\.FrontendConfig=my-frontend-config'
...Or using a values file:
ingress:
class: gce
annotations:
kubernetes.io/ingress.allow-http: "false"
networking.gke.io/v1beta1.FrontendConfig: "my-frontend-config"If you have some domain name, set this FQDN to ingress.hosts:
helm install \
...
--set 'ingress.hosts[0]=reportportal.example.com'
...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'
...You can use Cert-Manager to manage certificates for your domain name.
To delete the cluster:
gcloud container clusters delete ${CLUSTER_NAME} --location=${CLUSTER_LOCATION}To delete the artifacts repository:
gcloud artifacts repositories delete ${CLUSTER_NAME} --location=${REPO_LOCATION}If you want to disable HTTP Load Balancing, you can set it in your values file:
ingress:
annotations:
kubernetes.io/ingress.allow-http: "false"Or add the annotation after the certificate is attached to the Ingress resource:
kubectl annotate ingress ${RELEASE_NAME}-gateway-ingress kubernetes.io/ingress.allow-http="false"