diff --git a/Makefile b/Makefile index b9af2d7d107c..4efb4f7cbd71 100644 --- a/Makefile +++ b/Makefile @@ -616,13 +616,11 @@ generate-e2e-templates-main: $(KUSTOMIZE) .PHONY: generate-metrics-config generate-metrics-config: $(CONTROLLER_GEN) ## Generate ./config/metrics/crd-metrics-config.yaml - OUTPUT_FILE="./config/metrics/crd-metrics-config.yaml"; \ - $(CONTROLLER_GEN) metrics output:metrics:stdout \ + $(CONTROLLER_GEN) metrics output:metrics:dir=./config/metrics \ paths=./api/... \ paths=./controlplane/kubeadm/api/... \ paths=./bootstrap/kubeadm/api/... \ - paths=./exp/api/... \ - > "$${OUTPUT_FILE}" + paths=./exp/api/... .PHONY: generate-diagrams generate-diagrams: ## Generate diagrams for *.plantuml files diff --git a/config/metrics/crd-metrics-config.yaml b/config/metrics/metrics.yaml similarity index 100% rename from config/metrics/crd-metrics-config.yaml rename to config/metrics/metrics.yaml diff --git a/config/metrics/crd-clusterrole.yaml b/config/metrics/rbac.yaml similarity index 99% rename from config/metrics/crd-clusterrole.yaml rename to config/metrics/rbac.yaml index bcd5bde16ba3..107ef82eac20 100644 --- a/config/metrics/crd-clusterrole.yaml +++ b/config/metrics/rbac.yaml @@ -6,6 +6,14 @@ metadata: labels: kube-state-metrics/aggregate-to-manager: "true" rules: +- apiGroups: + - bootstrap.cluster.x-k8s.io + resources: + - kubeadmconfigs + verbs: + - get + - list + - watch - apiGroups: - cluster.x-k8s.io resources: @@ -20,6 +28,7 @@ rules: - get - list - watch + - apiGroups: - controlplane.cluster.x-k8s.io resources: @@ -28,11 +37,3 @@ rules: - get - list - watch -- apiGroups: - - bootstrap.cluster.x-k8s.io - resources: - - kubeadmconfigs - verbs: - - get - - list - - watch