Skip to content

Commit b4b6094

Browse files
committed
docs: Document RBAC and remove outdated info
Adds a paragraph on RBAC and removes the outdated information on setting the customresource in the --resources flag. Signed-off-by: Manuel Rüger <[email protected]>
1 parent 3a5c76d commit b4b6094

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

docs/customresourcestate-metrics.md

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,6 @@ If both flags are provided, the inline configuration will take precedence.
1616
When multiple entries for the same resource exist, kube-state-metrics will exit with an error.
1717
This includes configuration which refers to a different API version.
1818

19-
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.
20-
2119
```yaml
2220
apiVersion: apps/v1
2321
kind: Deployment
@@ -46,7 +44,6 @@ spec:
4644
each:
4745
type: Gauge
4846
...
49-
- --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
5047
```
5148
5249
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`.
@@ -85,6 +82,11 @@ spec:
8582

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

85+
### RBAC-enabled Clusters
86+
87+
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.
88+
89+
8890
### Examples
8991

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

0 commit comments

Comments
 (0)