How to get the number of nodes in a GKE node pool as a stackdriver metric?
Asked Answered
T

4

8

I'm making a dashboard in GCP stackdriver. We have a autoscaling node pool which the pods I'm interested in monitoring run in. What I'm wondering is how do I monitor the amount of nodes the are currently running in the pool?

I've had a look at log based metrics, but I can't find anywhere in the logs where it actually says how many nodes are currently running.

Tributary answered 7/8, 2019 at 15:4 Comment(0)
B
6

There's no metric for number of nodes per se. We can get something similar though with the sum of Total cores grouped by cluster_name:

stackdriver resource selection

Burlingame answered 13/8, 2019 at 5:46 Comment(2)
What if the node is a shared core vCPU like g1-small?Miguelmiguela
is there any way to get the number of nodes instead of the number of cores? Is there a way to do this with a Secondary Aggregator or something?Narrowminded
H
4

Monitoring the Instance Group/instance_group_size metric will show the exact number of vms/nodes in your node pool. You can filter on the instance group's name associated to your node pool:

enter image description here

Hypothec answered 27/10, 2022 at 15:4 Comment(0)
G
1

in metric explorer use instance group as resource type and instance group size as metric.Then filter out instance group that is configured as node pool for GKE.

Gliadin answered 22/2, 2021 at 12:16 Comment(1)
Please provide sources(link to documentation)Cele
A
0

In stack driver if you are using the new stack driver it will show the all the running node in an infrastructure part inside kubernetes engine menu.

If you will click on the node it will show all the containing namespaces of further you will click it will show all the running pods also.

for more deatils, you can check this out : https://medium.com/google-cloud/new-stackdriver-monitoring-for-kubernetes-part-1-a296fa164694

Alderete answered 7/8, 2019 at 18:53 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.