Kube-state-metrics
kube-state-metrics is a simple service that listens to the Kubernetes API server and generates metrics about the state of the objects.
It consists of:
Its exposed metrics are used in various alerts and Grafana dashboards.
Building a new version
Before adding a new version of kube-state-metrics, use the upstream changelog to verify that there are no changes that need to be made elsewhere. This could include necessary changes to the helm chart, or k8s configuration, so be sure to verify both.
The upstream helm charts are available. Major changes tend to be called out in the README, but it may be useful to examine the repo history, as well.
In the production images repo, add a new directory under images/kube-state-metrics, with a version number like 'v1.23'. Copy the contents of one of the other version directories into your new directory. Then, update Dockerfile.template to build from the new upstream version you're targeting. See this change for an example.
Deploying a new version
After adding the new version, pin the kube-state-metrics chart to the current version, so everything in production doesn't update at once. Then, update the deployment chart for kube-state-metrics.
In order to test the change, override the chart version in a particular cluster (for instance, one of the staging clusters - helmfile.d/admin_ng/values/staging-codfw/values.yaml).