This is a tested example.
Not all clusters will have the metrics API, but this will function for ones that do.
The deployment uses the bitnami/kubectl image
.
It runs "get node metrics" in a shell while loop that sleeps.
The Deployment's Pod-template uses a ServiceAccount that is ClusterRoleBound to a ClusterRole permitting the list
and get
verbs for the Node
kind in the metrics.k8s.io
API group.
Here's how to reproduce: