From 9eef1a84a1285283dc9ec0d782d2d9d0c210e01d Mon Sep 17 00:00:00 2001 From: Christian Schlotter Date: Thu, 29 Aug 2024 16:17:33 +0200 Subject: [PATCH] generate metrics configuration --- config/metrics/kustomization.yaml | 4 ++-- config/metrics/metrics.yaml | 29 +++++++++++++---------------- config/metrics/rbac.yaml | 7 +++---- 3 files changed, 18 insertions(+), 22 deletions(-) diff --git a/config/metrics/kustomization.yaml b/config/metrics/kustomization.yaml index 3955c8d0d945..ec43f52f20e4 100644 --- a/config/metrics/kustomization.yaml +++ b/config/metrics/kustomization.yaml @@ -1,12 +1,12 @@ resources: - - ./crd-clusterrole.yaml + - ./rbac.yaml namespace: observability configMapGenerator: - name: kube-state-metrics-crd-config-capi files: - - capi.yaml=crd-metrics-config.yaml + - capi.yaml=metrics.yaml options: disableNameSuffixHash: true labels: diff --git a/config/metrics/metrics.yaml b/config/metrics/metrics.yaml index d67ea32bcc48..e216fc917f71 100644 --- a/config/metrics/metrics.yaml +++ b/config/metrics/metrics.yaml @@ -1,4 +1,4 @@ -# This file was auto-generated via: make generate-metrics-config +--- kind: CustomResourceStateMetrics spec: resources: @@ -527,14 +527,12 @@ spec: info: labelsFromPath: node_name: - - status - - nodeRef - name node_uid: - - status - - nodeRef - uid - path: null + path: + - status + - nodeRef type: Info help: Information about the node reference of a machine. name: status_noderef @@ -847,9 +845,9 @@ spec: - each: info: labelsFromPath: - name: - - metadata - - name + maxUnhealthy: + - spec + - maxUnhealthy path: null type: Info help: Information about a machinehealthcheck. @@ -907,7 +905,7 @@ spec: name: status_condition_last_transition_time - each: gauge: - nilIsZero: false + nilIsZero: true path: - status - currentHealthy @@ -917,17 +915,17 @@ spec: name: status_current_healthy - each: gauge: - nilIsZero: false + nilIsZero: true path: - status - expectedMachines valueFrom: null type: Gauge - help: Total number of pods counted by this machinehealthcheck. + help: Total number of machines counted by this machinehealthcheck. name: status_expected_machines - each: gauge: - nilIsZero: false + nilIsZero: true path: - status - remediationsAllowed @@ -1019,7 +1017,7 @@ spec: - version path: null type: Info - help: "" + help: Information about a machinepool. name: info - each: info: @@ -1302,7 +1300,7 @@ spec: name: status_replicas_available - each: gauge: - nilIsZero: false + nilIsZero: true path: - status - fullyLabeledReplicas @@ -1490,4 +1488,3 @@ spec: help: The number of updated replicas per kubeadmcontrolplane. name: status_replicas_updated resourcePlural: "" - diff --git a/config/metrics/rbac.yaml b/config/metrics/rbac.yaml index 107ef82eac20..bed50b0a70a0 100644 --- a/config/metrics/rbac.yaml +++ b/config/metrics/rbac.yaml @@ -2,9 +2,9 @@ apiVersion: rbac.authorization.k8s.io/v1 kind: ClusterRole metadata: - name: kube-state-metrics-custom-resource-capi labels: kube-state-metrics/aggregate-to-manager: "true" + name: manager-metrics-role rules: - apiGroups: - bootstrap.cluster.x-k8s.io @@ -20,15 +20,14 @@ rules: - clusterclasses - clusters - machinedeployments + - machinehealthchecks - machinepools - - machinesets - machines - - machinehealthchecks + - machinesets verbs: - get - list - watch - - apiGroups: - controlplane.cluster.x-k8s.io resources: