0

In our GCP project we are working on a project to assist organization and cost management. We got a situation on one of our use cases.

Multiple projects node pools are present in one of our GKE cluster. All the instances under this cluster are inheriting Cluster labels. We want to have separate labels based on node pools for billing purposes.

  1. Is there any way to filter instances of a particular node pool in billing?
  2. If not, then how can we set separate labels based on node pools for billing purposes?
xyphan
  • 1
  • 2
  • I think an acceptable solution for this (as GKE only supports billing labels per-cluster and not per-node) would be importing all the data in a BQ dataset and then querying the nodes: https://cloud.google.com/kubernetes-engine/docs/how-to/cluster-usage-metering#view_in_bigquery – Vi Pau Apr 14 '21 at 16:08

1 Answers1

0

We could able to apply labels based on cluster [1] and also you can apply labels to nodes.

How to apply labels to nodes:

  • List the nodes in your cluster, along with their labels:

      **kubectl get nodes --show-labels.**
    
  • Chose one of your nodes, and add a label to it:

      **kubectl label nodes <your-node-name> disktype=ssd.**
    

You can refer the below document to break down your billing charges. [2] When you enable GKE usage metering, resource usage records are written to a BigQuery table that you specify. [3] Please refer the below documents: [1] https://cloud.google.com/kubernetes-engine/docs/how-to/creating-managing-labels [2] https://cloud.google.com/billing/docs/how-to/bq-examples [3] https://cloud.google.com/kubernetes-engine/docs/how-to/cluster-usage-metering