From 4c4d38368b75e6884d63c900ba1e6886765d59dd Mon Sep 17 00:00:00 2001 From: Christian Schlotter Date: Fri, 15 Aug 2025 10:02:38 +0200 Subject: [PATCH 1/2] metrics: regenerate --- config/metrics/crd-clusterrole.yaml | 2 +- config/metrics/crd-metrics-config.yaml | 142 ++++++++++--------------- 2 files changed, 58 insertions(+), 86 deletions(-) diff --git a/config/metrics/crd-clusterrole.yaml b/config/metrics/crd-clusterrole.yaml index 52ca08243e28..f24506732b06 100644 --- a/config/metrics/crd-clusterrole.yaml +++ b/config/metrics/crd-clusterrole.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: - addons.cluster.x-k8s.io diff --git a/config/metrics/crd-metrics-config.yaml b/config/metrics/crd-metrics-config.yaml index 6ace01c4711d..deeebe3961cc 100644 --- a/config/metrics/crd-metrics-config.yaml +++ b/config/metrics/crd-metrics-config.yaml @@ -8,7 +8,7 @@ spec: groupVersionKind: group: addons.cluster.x-k8s.io kind: ClusterResourceSet - version: v1beta1 + version: v1beta2 labelsFromPath: name: - metadata @@ -33,7 +33,6 @@ spec: - Unknown path: - status - - v1beta2 - conditions valueFrom: - status @@ -50,7 +49,6 @@ spec: nilIsZero: false path: - status - - v1beta2 - conditions valueFrom: - lastTransitionTime @@ -62,7 +60,7 @@ spec: groupVersionKind: group: bootstrap.cluster.x-k8s.io kind: KubeadmConfig - version: v1beta1 + version: v1beta2 labelsFromPath: cluster_name: - metadata @@ -140,7 +138,6 @@ spec: - Unknown path: - status - - v1beta2 - conditions valueFrom: - status @@ -157,7 +154,6 @@ spec: nilIsZero: false path: - status - - v1beta2 - conditions valueFrom: - lastTransitionTime @@ -169,7 +165,7 @@ spec: groupVersionKind: group: cluster.x-k8s.io kind: Cluster - version: v1beta1 + version: v1beta2 labelsFromPath: name: - metadata @@ -234,7 +230,13 @@ spec: topology_class: - spec - topology - - class + - classRef + - name + topology_class_namespace: + - spec + - topology + - classRef + - namespace topology_version: - spec - topology @@ -266,7 +268,6 @@ spec: - Unknown path: - status - - v1beta2 - conditions valueFrom: - status @@ -283,7 +284,6 @@ spec: nilIsZero: false path: - status - - v1beta2 - conditions valueFrom: - lastTransitionTime @@ -312,7 +312,7 @@ spec: groupVersionKind: group: cluster.x-k8s.io kind: ClusterClass - version: v1beta1 + version: v1beta2 labelsFromPath: name: - metadata @@ -386,7 +386,6 @@ spec: - Unknown path: - status - - v1beta2 - conditions valueFrom: - status @@ -403,7 +402,6 @@ spec: nilIsZero: false path: - status - - v1beta2 - conditions valueFrom: - lastTransitionTime @@ -415,7 +413,7 @@ spec: groupVersionKind: group: cluster.x-k8s.io kind: Machine - version: v1beta1 + version: v1beta2 labelsFromPath: cluster_name: - spec @@ -563,7 +561,6 @@ spec: - Unknown path: - status - - v1beta2 - conditions valueFrom: - status @@ -580,7 +577,6 @@ spec: nilIsZero: false path: - status - - v1beta2 - conditions valueFrom: - lastTransitionTime @@ -592,8 +588,6 @@ spec: labelsFromPath: node_name: - name - node_uid: - - uid path: - status - nodeRef @@ -624,7 +618,7 @@ spec: groupVersionKind: group: cluster.x-k8s.io kind: MachineDeployment - version: v1beta1 + version: v1beta2 labelsFromPath: cluster_name: - spec @@ -743,6 +737,7 @@ spec: nilIsZero: false path: - spec + - rollout - strategy - rollingUpdate - maxSurge @@ -756,6 +751,7 @@ spec: nilIsZero: false path: - spec + - rollout - strategy - rollingUpdate - maxUnavailable @@ -775,7 +771,6 @@ spec: - Unknown path: - status - - v1beta2 - conditions valueFrom: - status @@ -792,7 +787,6 @@ spec: nilIsZero: false path: - status - - v1beta2 - conditions valueFrom: - lastTransitionTime @@ -850,27 +844,17 @@ spec: nilIsZero: true path: - status - - unavailableReplicas - valueFrom: null - type: Gauge - help: The number of unavailable replicas per machinedeployment. - name: status_replicas_unavailable - - each: - gauge: - nilIsZero: true - path: - - status - - updatedReplicas + - upToDateReplicas valueFrom: null type: Gauge - help: The number of updated replicas per machinedeployment. - name: status_replicas_updated + help: The number of up-to-date replicas per machinedeployment. + name: status_replicas_uptodate resourcePlural: "" - errorLogV: 0 groupVersionKind: group: cluster.x-k8s.io kind: MachineHealthCheck - version: v1beta1 + version: v1beta2 labelsFromPath: cluster_name: - spec @@ -911,9 +895,16 @@ spec: - each: info: labelsFromPath: - maxUnhealthy: + remediation_triggerif_unhealthylessthanorequalto: - spec - - maxUnhealthy + - remediation + - triggerIf + - unhealthyLessThanOrEqualTo + remediation_triggerif_unhealthyrange: + - spec + - remediation + - triggerIf + - unhealthyRange path: null type: Info help: Information about a machinehealthcheck. @@ -947,7 +938,6 @@ spec: - Unknown path: - status - - v1beta2 - conditions valueFrom: - status @@ -964,7 +954,6 @@ spec: nilIsZero: false path: - status - - v1beta2 - conditions valueFrom: - lastTransitionTime @@ -1006,7 +995,7 @@ spec: groupVersionKind: group: cluster.x-k8s.io kind: MachinePool - version: v1beta1 + version: v1beta2 labelsFromPath: cluster_name: - spec @@ -1126,7 +1115,6 @@ spec: - Unknown path: - status - - v1beta2 - conditions valueFrom: - status @@ -1143,7 +1131,6 @@ spec: nilIsZero: false path: - status - - v1beta2 - conditions valueFrom: - lastTransitionTime @@ -1201,17 +1188,17 @@ spec: nilIsZero: true path: - status - - unavailableReplicas + - upToDateReplicas valueFrom: null type: Gauge - help: The number of unavailable replicas per machinepool. - name: status_replicas_unavailable + help: The number of up-to-date replicas per machinepool. + name: status_replicas_uptodate resourcePlural: "" - errorLogV: 0 groupVersionKind: group: cluster.x-k8s.io kind: MachineSet - version: v1beta1 + version: v1beta2 labelsFromPath: cluster_name: - spec @@ -1326,7 +1313,6 @@ spec: - Unknown path: - status - - v1beta2 - conditions valueFrom: - status @@ -1343,7 +1329,6 @@ spec: nilIsZero: false path: - status - - v1beta2 - conditions valueFrom: - lastTransitionTime @@ -1375,27 +1360,27 @@ spec: nilIsZero: true path: - status - - fullyLabeledReplicas + - readyReplicas valueFrom: null type: Gauge - help: The number of fully labeled replicas per machineset. - name: status_replicas_fully_labeled + help: The number of ready replicas per machineset. + name: status_replicas_ready - each: gauge: nilIsZero: true path: - status - - readyReplicas + - upToDateReplicas valueFrom: null type: Gauge - help: The number of ready replicas per machineset. - name: status_replicas_ready + help: The number of up-to-date replicas per machineset. + name: status_replicas_uptodate resourcePlural: "" - errorLogV: 0 groupVersionKind: group: controlplane.cluster.x-k8s.io kind: KubeadmControlPlane - version: v1beta1 + version: v1beta2 labelsFromPath: cluster_name: - metadata @@ -1477,7 +1462,8 @@ spec: nilIsZero: false path: - spec - - rolloutStrategy + - rollout + - strategy - rollingUpdate - maxSurge valueFrom: null @@ -1497,7 +1483,6 @@ spec: - Unknown path: - status - - v1beta2 - conditions valueFrom: - status @@ -1514,7 +1499,6 @@ spec: nilIsZero: false path: - status - - v1beta2 - conditions valueFrom: - lastTransitionTime @@ -1536,37 +1520,37 @@ spec: nilIsZero: true path: - status - - readyReplicas + - availableReplicas valueFrom: null type: Gauge - help: The number of ready replicas per kubeadmcontrolplane. - name: status_replicas_ready + help: The number of available replicas per kubeadmcontrolplane. + name: status_replicas_available - each: gauge: nilIsZero: true path: - status - - unavailableReplicas + - readyReplicas valueFrom: null type: Gauge - help: The number of unavailable replicas per kubeadmcontrolplane. - name: status_replicas_unavailable + help: The number of ready replicas per kubeadmcontrolplane. + name: status_replicas_ready - each: gauge: nilIsZero: true path: - status - - updatedReplicas + - upToDateReplicas valueFrom: null type: Gauge - help: The number of updated replicas per kubeadmcontrolplane. - name: status_replicas_updated + help: The number of up-to-date replicas per kubeadmcontrolplane. + name: status_replicas_uptodate resourcePlural: "" - errorLogV: 0 groupVersionKind: group: infrastructure.cluster.x-k8s.io kind: DevCluster - version: v1beta1 + version: v1beta2 labelsFromPath: cluster_name: - metadata @@ -1595,7 +1579,6 @@ spec: - Unknown path: - status - - v1beta2 - conditions valueFrom: - status @@ -1612,7 +1595,6 @@ spec: nilIsZero: false path: - status - - v1beta2 - conditions valueFrom: - lastTransitionTime @@ -1624,7 +1606,7 @@ spec: groupVersionKind: group: infrastructure.cluster.x-k8s.io kind: DevMachine - version: v1beta1 + version: v1beta2 labelsFromPath: cluster_name: - metadata @@ -1653,7 +1635,6 @@ spec: - Unknown path: - status - - v1beta2 - conditions valueFrom: - status @@ -1670,7 +1651,6 @@ spec: nilIsZero: false path: - status - - v1beta2 - conditions valueFrom: - lastTransitionTime @@ -1682,7 +1662,7 @@ spec: groupVersionKind: group: infrastructure.cluster.x-k8s.io kind: DockerCluster - version: v1beta1 + version: v1beta2 labelsFromPath: cluster_name: - metadata @@ -1711,7 +1691,6 @@ spec: - Unknown path: - status - - v1beta2 - conditions valueFrom: - status @@ -1728,7 +1707,6 @@ spec: nilIsZero: false path: - status - - v1beta2 - conditions valueFrom: - lastTransitionTime @@ -1740,7 +1718,7 @@ spec: groupVersionKind: group: infrastructure.cluster.x-k8s.io kind: DockerMachine - version: v1beta1 + version: v1beta2 labelsFromPath: cluster_name: - metadata @@ -1769,7 +1747,6 @@ spec: - Unknown path: - status - - v1beta2 - conditions valueFrom: - status @@ -1786,7 +1763,6 @@ spec: nilIsZero: false path: - status - - v1beta2 - conditions valueFrom: - lastTransitionTime @@ -1798,7 +1774,7 @@ spec: groupVersionKind: group: ipam.cluster.x-k8s.io kind: IPAddressClaim - version: v1beta1 + version: v1beta2 labelsFromPath: cluster_name: - metadata @@ -1827,7 +1803,6 @@ spec: - Unknown path: - status - - v1beta2 - conditions valueFrom: - status @@ -1844,7 +1819,6 @@ spec: nilIsZero: false path: - status - - v1beta2 - conditions valueFrom: - lastTransitionTime @@ -1856,7 +1830,7 @@ spec: groupVersionKind: group: runtime.cluster.x-k8s.io kind: ExtensionConfig - version: v1alpha1 + version: v1beta2 labelsFromPath: name: - metadata @@ -1881,7 +1855,6 @@ spec: - Unknown path: - status - - v1beta2 - conditions valueFrom: - status @@ -1898,7 +1871,6 @@ spec: nilIsZero: false path: - status - - v1beta2 - conditions valueFrom: - lastTransitionTime From d0ca6256affad52daea3888748b39ba0ce91025b Mon Sep 17 00:00:00 2001 From: Christian Schlotter Date: Fri, 15 Aug 2025 10:39:30 +0200 Subject: [PATCH 2/2] update dashboards for uptodate metric --- .../grafana/dashboards/cluster-api-state.json | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/hack/observability/grafana/dashboards/cluster-api-state.json b/hack/observability/grafana/dashboards/cluster-api-state.json index d26f86676aae..082288991d3a 100644 --- a/hack/observability/grafana/dashboards/cluster-api-state.json +++ b/hack/observability/grafana/dashboards/cluster-api-state.json @@ -1213,9 +1213,9 @@ "uid": "prometheus" }, "editorMode": "code", - "expr": "sum (capi_kubeadmcontrolplane_status_replicas_updated)", + "expr": "sum (capi_kubeadmcontrolplane_status_replicas_uptodate)", "hide": false, - "legendFormat": "status updated replicas", + "legendFormat": "status up-to-date replicas", "range": true, "refId": "E" } @@ -1572,9 +1572,9 @@ "uid": "prometheus" }, "editorMode": "code", - "expr": "sum (capi_machinedeployment_status_replicas_updated)", + "expr": "sum (capi_machinedeployment_status_replicas_uptodate)", "hide": false, - "legendFormat": "status updated replicas", + "legendFormat": "status up-to-date replicas", "range": true, "refId": "E" },