Installs the kube-state-metrics agent.
The chart is distributed as an OCI Artifact as well as via a traditional Helm Repository.
- OCI Artifact:
oci://ghcr.io/prometheus-community/charts/kube-state-metrics - Helm Repository:
https://prometheus-community.github.io/helm-chartswith chartkube-state-metrics
The installation instructions use the OCI registry. Refer to the [helm repo](helm repo) command documentation for information on installing charts via the traditional repository.
helm install [RELEASE_NAME] oci://ghcr.io/prometheus-community/charts/kube-state-metrics [flags]See configuration below.
See helm install for command documentation.
helm uninstall [RELEASE_NAME]This removes all the Kubernetes components associated with the chart and deletes the release.
See helm uninstall for command documentation.
helm upgrade [RELEASE_NAME] oci://ghcr.io/prometheus-community/charts/kube-state-metrics [flags]See helm upgrade for command documentation.
You can upgrade in-place:
- upgrade your existing release name using the new chart repository
This version drops support for deprecated Pod Security Policy resources.
v3.0.0 includes kube-state-metrics v2.0, see the changelog for major changes on the application-side.
The upgraded chart now the following changes:
- Dropped support for helm v2 (helm v3 or later is required)
- collectors key was renamed to resources
- namespace key was renamed to namespaces
See Customizing the Chart Before Installing. To see all configurable options with detailed comments:
helm show values oci://ghcr.io/prometheus-community/charts/kube-state-metricsYou can enable kube-state-metrics endpoint protection using kube-rbac-proxy. By setting kubeRBACProxy.enabled: true, this chart will deploy one RBAC proxy container per endpoint (metrics & telemetry).
To authorize access, authenticate your requests (via a ServiceAccount for example) with a ClusterRole attached such as:
apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRole
metadata:
name: kube-state-metrics-read
rules:
- apiGroups: [ "" ]
resources: ["services/kube-state-metrics"]
verbs:
- getSee kube-rbac-proxy examples for more details.
As an alternative to kube-rbac-proxy, kube-state-metrics can authenticate and authorize requests itself using its built-in --auth-filter. Set authFilter.enabled: true to add the --auth-filter flag and the create permissions on tokenreviews and subjectaccessreviews that the filter requires.
Scrapers must then authenticate (for example via a ServiceAccount token) and be authorized to get the kube-state-metrics service. See the upstream Authentication / Authorization documentation for the scraper-side ClusterRole and ClusterRoleBinding.