Skip to content

Commit

Permalink
generate metrics configuration
Browse files Browse the repository at this point in the history
  • Loading branch information
chrischdi committed Aug 29, 2024
1 parent 1d67f82 commit 9eef1a8
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 22 deletions.
4 changes: 2 additions & 2 deletions config/metrics/kustomization.yaml
Original file line number Diff line number Diff line change
@@ -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:
Expand Down
29 changes: 13 additions & 16 deletions config/metrics/metrics.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# This file was auto-generated via: make generate-metrics-config
---
kind: CustomResourceStateMetrics
spec:
resources:
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -847,9 +845,9 @@ spec:
- each:
info:
labelsFromPath:
name:
- metadata
- name
maxUnhealthy:
- spec
- maxUnhealthy
path: null
type: Info
help: Information about a machinehealthcheck.
Expand Down Expand Up @@ -907,7 +905,7 @@ spec:
name: status_condition_last_transition_time
- each:
gauge:
nilIsZero: false
nilIsZero: true
path:
- status
- currentHealthy
Expand All @@ -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
Expand Down Expand Up @@ -1019,7 +1017,7 @@ spec:
- version
path: null
type: Info
help: ""
help: Information about a machinepool.
name: info
- each:
info:
Expand Down Expand Up @@ -1302,7 +1300,7 @@ spec:
name: status_replicas_available
- each:
gauge:
nilIsZero: false
nilIsZero: true
path:
- status
- fullyLabeledReplicas
Expand Down Expand Up @@ -1490,4 +1488,3 @@ spec:
help: The number of updated replicas per kubeadmcontrolplane.
name: status_replicas_updated
resourcePlural: ""

7 changes: 3 additions & 4 deletions config/metrics/rbac.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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:
Expand Down

0 comments on commit 9eef1a8

Please sign in to comment.