You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The max(kube_node_created) would return the value of your newest node member, not your oldest. Thus it returns the number of days since you last added a node. If you want the cluster age in days, then use the min() to get the timestamp of the oldest cluster node.
When I use round((time() - min(kube_node_created)) / 86400) I get 681 which lines up to the age of my oldest cluster node:
$ k get nodes
NAME STATUS ROLES AGE VERSION
k3s01 Ready control-plane,etcd,master 680d v1.28.5+k3s1
k3s02 Ready control-plane,etcd,master 654d v1.28.5+k3s1
k3s03 Ready control-plane,etcd,master 661d v1.28.5+k3s1
k3s04 Ready worker 427d v1.28.5+k3s1
k3s05 Ready worker 427d v1.28.5+k3s1
k3s06 Ready worker 354d v1.28.5+k3s1
if I use max() then I get 355 which is the age of the newest node.
The text was updated successfully, but these errors were encountered:
I think you have the wrong calculation for
cluster_age_days
using:The
max(kube_node_created)
would return the value of your newest node member, not your oldest. Thus it returns the number of days since you last added a node. If you want the cluster age in days, then use themin()
to get the timestamp of the oldest cluster node.When I use
round((time() - min(kube_node_created)) / 86400)
I get681
which lines up to the age of my oldest cluster node:if I use
max()
then I get355
which is the age of the newest node.The text was updated successfully, but these errors were encountered: