1

I'm trying to get GCP billing costs on a GKE nodepool level .

I understand that the GKE usage metering feature only takes the labels of pods and PVCs into its table therefore giving workload level visibility into billing.

I also looked into the Standard usage cost data table which generates a table like gcp_billing_export_v1_<BILLING_ACCOUNT_ID> . This table also only generates labels for instance nodes of the google compute engine and even in the GKE side of things it only generates labels for clusters.

I tried to see if I could leverage the labels of instance templates but that would require me to manually add labels to all our instance templates of google compute engine which were created by GKE.

I'd like to know if there's a way where while creating a nodepool we can add labels that somehow would show up in either of the two bigquery tables above or if they can somehow be propagated to the VM instance templates created for the nodepool by GKE.

Prashanth
  • 81
  • 1
  • 11

1 Answers1

1

With GKE Usage metering, you can get cost based on namespace, label, deployment - https://www.economize.cloud/blog/gke-usage-cost-monitoring-kubernetes-clusters/

If you want to get cost based on nodes, you will need to add labels when you create the nodepools. Unfortunately, I think adding labels to existing nodepools would not be possible. These labels should propogate to the Standard Usage cost dataset.

Anirudh Murali
  • 612
  • 10
  • 25
  • thanks for your response Anirudh! I don't seem to see nodepool labels in the `standard usage cost dataset` . I only see VM instance template labels. Are you sure that the labels we set when we create the nodepool shows in the `standard usage cost dataset` ? – Prashanth May 20 '22 at 09:44
  • Sorry, missed the notification. I just checked and the labels seems to be propogating to the dataset. Did you try setting labels to a new nodepool? Do you mind sending me an email? (anirudh [at] economize.cloud) - I can take a deeper look. – Anirudh Murali Jun 26 '22 at 15:30
  • Not cool that this thread was taken offline. What were the findings? Does it work? – George Aristy Nov 02 '22 at 17:55