September 2026 release is live Read More

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

Why this matters: these three methods trade off setup effort against depth of insight. Allocation-Based leans on GKE's own cost allocation feature — fastest to set up, but limited to what that feature exposes. Appliance-Based deploys Mavvrik's own agent via Helm, giving deeper per-pod telemetry at the cost of a more involved setup. Auto-discover automates the Allocation-Based approach for environments where clusters are created and torn down 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 Step-2.

  1. Login to in google cloud console

  2. Go to GKE cluster project

  3. Navigate to k8s service -> Clusters

  4. Click on Actions

Open GKE cluster actions
Open GKE cluster actions
  1. Click on Connect

Connect to the GKE cluster
Connect to the GKE cluster
  1. Copy command line access

  2. Click on OK

  3. Activate Cloud Shell

  4. Paste the copied command line access in terminal

Run GKE command-line access in Cloud Shell
Run GKE command-line access in Cloud Shell
  1. Press Enter

  2. 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

Navigate to Kubernetes administration in Mavvrik
Navigate to Kubernetes administration in Mavvrik
  1. Tap on GKE

  2. Click on GKE Cluster connect button

  3. 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
List Prometheus services in Kubernetes
List Prometheus services in Kubernetes
  1. In URL Replace prometheus-server-name,namespace & prometheus-internal-port with your data

  2. The following screenshot shows an example of a URL

Example Prometheus service URL
Example Prometheus service URL
  1. Paste the copied script in Cloud Shell and enter

Run the Mavvrik onboarding script in GCP Cloud Shell
Run the Mavvrik onboarding script in GCP Cloud Shell
  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.

Open detailed GKE cluster cost insights
Open detailed GKE cluster cost insights

Instructions to Enable GKE Cost Allocation (Allocation based)

Using UI

  1. Go to Kubernetes Clusters

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

Select the GKE cluster for cost allocation
Select the GKE cluster for cost allocation
  1. Click on Edit

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

Edit GKE cost allocation settings
Edit GKE cost allocation settings
  1. Select enable cost allocation option

Enable GKE cost allocation
Enable GKE cost allocation
  1. Once done you should see Cost Allocation enabled.

Confirm GKE cost allocation is enabled
Confirm GKE cost allocation is enabled

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 auto discover we need to enable the cost allocation on GKE cluster, follow the Instructions to Enable GKE Cost Allocation(Allocation based)

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

Navigate to Kubernetes administration in Mavvrik
Navigate to Kubernetes administration in Mavvrik
  1. Tap on GKE

  2. Click on the setting icon

Open GKE auto-discovery settings
Open GKE auto-discovery settings
  1. then enable the GKE cluster

Enable GKE cluster auto-discovery
Enable GKE cluster auto-discovery

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

Troubleshooting

  • If the installation command fails, confirm that kubectl and Helm are connected to the intended GKE cluster.

  • If allocation data is unavailable, verify that GKE cost allocation is enabled using one of the methods described above.