Skip to content

Commit

Permalink
Merge pull request #2106 from mrueg/doc-crs
Browse files Browse the repository at this point in the history
docs: Document RBAC and remove outdated info
  • Loading branch information
k8s-ci-robot authored Jun 28, 2023
2 parents 3a5c76d + b4b6094 commit bb6e9f4
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions docs/customresourcestate-metrics.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,6 @@ If both flags are provided, the inline configuration will take precedence.
When multiple entries for the same resource exist, kube-state-metrics will exit with an error.
This includes configuration which refers to a different API version.

In addition to specifying one of `--custom-resource-state-config*` flags, you should also add the custom resource *Kind*s in plural form to the list of exposed resources in the `--resources` flag. If you don't specify `--resources`, then all known custom resources configured in `--custom-resource-state-config*` and all available default kubernetes objects will be taken into account by kube-state-metrics.

```yaml
apiVersion: apps/v1
kind: Deployment
Expand Down Expand Up @@ -46,7 +44,6 @@ spec:
each:
type: Gauge
...
- --resources=certificatesigningrequests,configmaps,cronjobs,daemonsets,deployments,endpoints,foos,horizontalpodautoscalers,ingresses,jobs,limitranges,mutatingwebhookconfigurations,namespaces,networkpolicies,nodes,persistentvolumeclaims,persistentvolumes,poddisruptionbudgets,pods,replicasets,replicationcontrollers,resourcequotas,secrets,services,statefulsets,storageclasses,validatingwebhookconfigurations,volumeattachments
```
It's also possible to configure kube-state-metrics to run in a `custom-resource-mode` only. In addition to specifying one of `--custom-resource-state-config*` flags, you could set `--custom-resource-state-only` to `true`.
Expand Down Expand Up @@ -85,6 +82,11 @@ spec:

NOTE: The `customresource_group`, `customresource_version`, and `customresource_kind` common labels are reserved, and will be overwritten by the values from the `groupVersionKind` field.

### RBAC-enabled Clusters

Please be aware that kube-state-metrics needs list and watch permissions granted to `customresourcedefinitions.apiextensions.k8s.io` as well as to the resources you want to gather metrics from.


### Examples

The examples in this section will use the following custom resource:
Expand Down

0 comments on commit bb6e9f4

Please sign in to comment.