GKE - Google Kubernetes Engine onboarding

Mavvrik supports two ways to connect an GKE cluster, as shown in the Connect GKE Cluster screen:

  • Allocation-Based – recommended when you want quick onboarding and cost allocation visibility without deep cluster telemetry.

  • Appliance-Based – recommended when you need deeper telemetry and more detailed Kubernetes insights.

  • Auto-discover and connect — recommended when you want to connect clusters that are created frequently

Steps to onboard the GKE cluster(Appliance based)

Step-1: Install Helm and kubectl

If Helm and kubectl are already installed, skip the steps below and proceed to https://help.mavvrik.ai/content/gke-google-kubernetes-engine-onboarding#GKE-GoogleKubernetesEngineonboarding-Step-2:OnboardtheclusterinMavvrik

  • Login to in google cloud console

  • Go to GKE cluster project

  • Navigate to k8s service -> Clusters

  • Click on Actions

image-20250109-122101.png
  • Click on Connect

image-20250109-122427.png
  • Copy command line access

  • Click on OK

  • Activate Cloud Shell

  • Paste the copied command line access in terminal

image-20250109-122951.png
  • Press Enter

  • If the Kubectl and helm are not installed in the cluster then follow the below steps

    • Steps to install kubectl

      $install via cloud 
      gcloud components install kubectl
      
      #via brew
      brew install kubectl
      
    • Steps to install helm

      brew install helm
      

Step-2: Onboard the cluster in Mavvrik

  1. Login to Mavvrik Portal

  2. Click on Menu

  3. In Admin section, Click on Accounts

  4. Click on Kubernetes

    image-20260309-093552.png
  5. Tap on GKE

  6. Click on GKE Cluster connect button

  7. Enter your Prometheus URL .

Steps to get Prometheus URL

  1. Capture the Prometheus URL associated with the K8s cluster:

a. Enter the following URL in Mavvrik UI

http://<prometheus-server-name>.<namespace>:<prometheus-internal-port>

b. To find the Prometheus service, run the following command in Kubernetes shell

kubectl get svc -n prometheus
image-20240606-090502.png
  1. In URL Replace prometheus-server-name,namespace & prometheus-internal-port with your data

  2. The following screenshot shows an example of a URL

image-20250109-120821.png


  1. Paste the copied script in Cloud Shell and enter

image-20250109-124337.png
  1. Click on the Connect button in Mavvrik.

  2. The onboarded GKE Cluster will be displayed, and the status will be ACTIVE.

Direct Cluster Navigation

There is a clickable link on the cluster names. This allows to seamlessly navigate to detailed cost insights for each cluster directly from the Kubernetes Admin page.

image-20250509-115735.png


Instructions to Enable GKE Cost Allocation (Allocation based)

To enable cost allocation following the steps:

Using UI:

  1. Go to Kubernetes Clusters

  2. Select the Cluster for which you want to enable cost allocation

image-20260129-035355.png
  1. Click on Edit

  2. Find the Cost Allocation option and click on Edit if its disabled,

image-20260129-035502.png
  1. Select enable cost allocation option

image-20260129-035551.png
  1. Once done you should see Cost Allocation enabled.

image-20260129-035841.png


Using CLI

  1. Enable cost allocation at cluster level using gcloud command

    1. gcloud container clusters update CLUSTER_NAME \
          --enable-cost-allocation
      
  2. Verify is cost allocation enabled successfully on the cluster:

    1. gcloud container clusters describe CLUSTER_NAME
      

      The output is similar to the following:

    2. ...
      costManagementConfig:
        enabled: true
      ...
      
      

In this output, costManagementConfig indicates that GKE cost allocation is enabled.


Steps to onboard the GKE cluster(Auto-discover and connect based)


To enable the cost allocation on GKE cluster follow the above setup i.e. https://help.mavvrik.ai/content/gke-google-kubernetes-engine-onboarding#GKE-GoogleKubernetesEngineonboarding-InstructionstoEnableGKECostAllocation(Allocationbased)

Step-2: Enable the discovery and connect cluster in Mavvrik

  1. Login to Mavvrik Portal

  2. Click on Menu

  3. In Admin section, Click on Accounts

  4. Click on Kubernetes

    image-20260309-093552.png
  5. Tap on GKE

  6. Click on the setting icon

    image-20260309-170237.png


  7. then enable the GKE cluster

image-20260309-170341.png

After enabling the cost allocation tags, wait for 24 hours for the cluster to be automatically onboarded