Skip to content

Commit

Permalink
metrics: add rbac
Browse files Browse the repository at this point in the history
  • Loading branch information
chrischdi committed Sep 8, 2023
1 parent e46b1b0 commit e9806cf
Show file tree
Hide file tree
Showing 2 changed files with 34 additions and 0 deletions.
21 changes: 21 additions & 0 deletions config/metrics/crd-clusterrole.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
---
apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRole
metadata:
name: kube-state-metrics-custom-resource-capv
labels:
kube-state-metrics/aggregate-to-manager: "true"
rules:
- apiGroups:
- infrastructure.cluster.x-k8s.io
resources:
- vsphereclusters
- vsphereclusteridentities
- vspheredeploymentzones
- vspherefailuredomains
- vspheremachines
- vspherevms
verbs:
- get
- list
- watch
13 changes: 13 additions & 0 deletions config/metrics/kustomization.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
resources:
- ./crd-clusterrole.yaml

namespace: observability

configMapGenerator:
- name: kube-state-metrics-crd-config-capv
files:
- capv.yaml=crd-metrics-config.yaml
options:
disableNameSuffixHash: true
labels:
kube-state-metrics/custom-resource: "true"

0 comments on commit e9806cf

Please sign in to comment.