7

We have two dev teams working on diferent parts of our product. Both teams share the same cluster each having their working version of the code deployed on separate namespaces so they can test without one interfering with the other.

Now we want each team to have its own budget for the testing environment. In order to have that we need to be able to have the usage cost for each one. From what I know about GCP, the only way to keep track of the costs from each resource is to attach labels to them. This development cluster that we have already has a GKE label which is shared across all resources created by the cluster.

The problem is that, since both team uses the same cluster they share the same GKE tags. So I would like to have one Node Pool for each team with specific tags on each one.

I couldn't find anything that would allow me to do that so decided to ask it here.

It would be very overkill to create a separate cluster for each team.

Mauricio
  • 2,552
  • 2
  • 29
  • 43
  • Does this answer your question? [Add or edit label on existing node pool in GKE](https://stackoverflow.com/questions/55275066/add-or-edit-label-on-existing-node-pool-in-gke) – Alex G Sep 30 '21 at 12:38
  • @AlexG. No because the labels referred on that question are the Kubernetes Labels, not the GKE Labels. Kubernetes labels are used internaly for the cluster. GKE labels are labels used by the GCP usually for metrics and cost tracking of resources. – Mauricio Sep 30 '21 at 12:57
  • Apologies for the confusion, because cluster labels are inherited across all cluster resources, there is no possibility to assign distinct cluster labels to various node pool workers at this time. – Alex G Oct 11 '21 at 05:30
  • I too would love to add GCE resource labels to all instances in a node pool. This would greatly simplify dashboarding and logging, tracking e.g. average CPU across the pool without having to use wildcard regexs on the instance name (which are not supported on GCP dashboard filters) – dan carter Jun 14 '22 at 04:35

1 Answers1

0

You can use the cluster resource metering feature of GKE. You can track usage based on Kubernetes labels and/or resources.

Gari Singh
  • 11,418
  • 2
  • 18
  • 41