You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: api/addons/v1beta1/clusterresourceset_types.go
+6Lines changed: 6 additions & 0 deletions
Original file line number
Diff line number
Diff line change
@@ -135,6 +135,8 @@ type ClusterResourceSetV1Beta2Status struct {
135
135
// +listType=map
136
136
// +listMapKey=type
137
137
// +kubebuilder:validation:MaxItems=32
138
+
// +Metrics:stateset:name="status_condition",help="The condition of a clusterresourceset.",labelName="status",JSONPath=.status,list={"True","False","Unknown"},labelsFromPath={"type":".type"}
139
+
// +Metrics:gauge:name="status_condition_last_transition_time",help="The condition's last transition time of a clusterresourceset.",valueFrom=.lastTransitionTime,labelsFromPath={"type":".type","status":".status"}
Copy file name to clipboardExpand all lines: api/bootstrap/kubeadm/v1beta1/kubeadmconfig_types.go
+11Lines changed: 11 additions & 0 deletions
Original file line number
Diff line number
Diff line change
@@ -502,6 +502,8 @@ type KubeadmConfigV1Beta2Status struct {
502
502
// +listType=map
503
503
// +listMapKey=type
504
504
// +kubebuilder:validation:MaxItems=32
505
+
// +Metrics:stateset:name="status_condition",help="The condition of a kubeadmconfig.",labelName="status",JSONPath=.status,list={"True","False","Unknown"},labelsFromPath={"type":".type"}
506
+
// +Metrics:gauge:name="status_condition_last_transition_time",help="The condition's last transition time of a kubeadmconfig.",valueFrom=.lastTransitionTime,labelsFromPath={"type":".type","status":".status"}
// +Metrics:info:name="annotation_paused",JSONPath=.annotations['cluster\.x-k8s\.io/paused'],help="Whether the kubeadmconfig is paused and any of its resources will not be processed by the controllers.",labelsFromPath={paused_value:"."}
Copy file name to clipboardExpand all lines: api/controlplane/kubeadm/v1beta1/kubeadm_control_plane_types.go
+17Lines changed: 17 additions & 0 deletions
Original file line number
Diff line number
Diff line change
@@ -83,6 +83,7 @@ type KubeadmControlPlaneSpec struct {
83
83
// odd numbers are permitted, as per [etcd best practice](https://etcd.io/docs/v3.3.12/faq/#why-an-odd-number-of-cluster-members).
84
84
// This is a pointer to distinguish between explicit zero and not specified.
85
85
// +optional
86
+
// +Metrics:gauge:name="spec_replicas",help="The number of desired machines for a kubeadmcontrolplane."
86
87
Replicas*int32`json:"replicas,omitempty"`
87
88
88
89
// version defines the desired Kubernetes version.
@@ -214,6 +215,7 @@ type RollingUpdate struct {
214
215
// Example: when this is set to 1, the control plane can be scaled
215
216
// up immediately when the rolling update starts.
216
217
// +optional
218
+
// +Metrics:gauge:name="spec_strategy_rollingupdate_max_surge",help="Maximum number of replicas that can be scheduled above the desired number of replicas during a rolling update of a kubeadmcontrolplane."
@@ -295,6 +297,7 @@ type KubeadmControlPlaneStatus struct {
295
297
// replicas is the total number of non-terminated machines targeted by this control plane
296
298
// (their labels match the selector).
297
299
// +optional
300
+
// +Metrics:gauge:name="status_replicas",help="The number of replicas per kubeadmcontrolplane.",nilIsZero=true
298
301
Replicasint32`json:"replicas"`
299
302
300
303
// version represents the minimum Kubernetes version for the control plane machines
@@ -307,10 +310,12 @@ type KubeadmControlPlaneStatus struct {
307
310
// updatedReplicas is the total number of non-terminated machines targeted by this control plane
308
311
// that have the desired template spec.
309
312
// +optional
313
+
// +Metrics:gauge:name="status_replicas_updated",help="The number of updated replicas per kubeadmcontrolplane.",nilIsZero=true
310
314
UpdatedReplicasint32`json:"updatedReplicas"`
311
315
312
316
// readyReplicas is the total number of fully running and ready control plane machines.
313
317
// +optional
318
+
// +Metrics:gauge:name="status_replicas_ready",help="The number of ready replicas per kubeadmcontrolplane.",nilIsZero=true
314
319
ReadyReplicasint32`json:"readyReplicas"`
315
320
316
321
// unavailableReplicas is the total number of unavailable machines targeted by this control plane.
@@ -322,6 +327,7 @@ type KubeadmControlPlaneStatus struct {
322
327
// Deprecated: This field is deprecated and is going to be removed when support for v1beta1 will be dropped. Please see https://github.com/kubernetes-sigs/cluster-api/blob/main/docs/proposals/20240916-improve-status-in-CAPI-resources.md for more details.
323
328
//
324
329
// +optional
330
+
// +Metrics:gauge:name="status_replicas_unavailable",help="The number of unavailable replicas per kubeadmcontrolplane.",nilIsZero=true
// initialized denotes that the KubeadmControlPlane API Server is initialized and thus
@@ -386,6 +392,8 @@ type KubeadmControlPlaneV1Beta2Status struct {
386
392
// +listType=map
387
393
// +listMapKey=type
388
394
// +kubebuilder:validation:MaxItems=32
395
+
// +Metrics:stateset:name="status_condition",help="The condition of a kubeadmcontrolplane.",labelName="status",JSONPath=".status",list={"True","False","Unknown"},labelsFromPath={"type":".type"}
396
+
// +Metrics:gauge:name="status_condition_last_transition_time",help="The condition's last transition time of a kubeadmcontrolplane.",valueFrom=.lastTransitionTime,labelsFromPath={"type":".type","status":".status"}
// +Metrics:info:name="info",help="Information about a kubeadmcontrolplane.",labelsFromPath={version:".spec.version"}
441
455
typeKubeadmControlPlanestruct {
442
456
metav1.TypeMeta`json:",inline"`
443
457
// metadata is the standard object's metadata.
444
458
// More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata
445
459
// +optional
460
+
// +Metrics:info:name="annotation_paused",JSONPath=.annotations['cluster\.x-k8s\.io/paused'],help="Whether the kubeadmcontrolplane is paused and any of its resources will not be processed by the controllers.",labelsFromPath={paused_value:"."}
Copy file name to clipboardExpand all lines: api/core/v1beta1/cluster_types.go
+11Lines changed: 11 additions & 0 deletions
Original file line number
Diff line number
Diff line change
@@ -462,6 +462,7 @@ const (
462
462
typeClusterSpecstruct {
463
463
// paused can be used to prevent controllers from processing the Cluster and all its associated objects.
464
464
// +optional
465
+
// +Metrics:gauge:name="spec_paused",help="Whether the cluster is paused and any of its resources will not be processed by the controllers.",nilIsZero=true
465
466
Pausedbool`json:"paused,omitempty"`
466
467
467
468
// clusterNetwork represents the cluster network configuration.
@@ -970,6 +971,7 @@ type ClusterStatus struct {
970
971
// phase represents the current phase of cluster actuation.
// +Metrics:stateset:name="status_phase",help="The clusters current phase.",labelName="phase",list={"Pending","Provisioning","Provisioned","Deleting","Failed","Unknown"}
973
975
Phasestring`json:"phase,omitempty"`
974
976
975
977
// infrastructureReady is the state of the infrastructure provider.
@@ -1008,6 +1010,8 @@ type ClusterV1Beta2Status struct {
1008
1010
// +listType=map
1009
1011
// +listMapKey=type
1010
1012
// +kubebuilder:validation:MaxItems=32
1013
+
// +Metrics:stateset:name="status_condition",help="The condition of a cluster.",labelName="status",JSONPath=.status,list={"True","False","Unknown"},labelsFromPath={"type":".type"}
1014
+
// +Metrics:gauge:name="status_condition_last_transition_time",help="The condition's last transition time of a cluster.",valueFrom=.lastTransitionTime,labelsFromPath={"type":".type","status":".status"}
// controlPlane groups all the observations about Cluster's ControlPlane current state.
@@ -1126,11 +1130,18 @@ func (v APIEndpoint) String() string {
1126
1130
// +kubebuilder:printcolumn:name="Version",type="string",JSONPath=".spec.topology.version",description="Kubernetes version associated with this Cluster"
// +Metrics:info:name="info",help="Information about a cluster.",labelsFromPath={topology_version:".spec.topology.version",topology_class:".spec.topology.class",control_plane_endpoint_host:".spec.controlPlaneEndpoint.host",control_plane_endpoint_port:".spec.controlPlaneEndpoint.port",control_plane_reference_kind:".spec.controlPlaneRef.kind",control_plane_reference_name:".spec.controlPlaneRef.name",infrastructure_reference_kind:".spec.infrastructureRef.kind",infrastructure_reference_name:".spec.infrastructureRef.name"}
1129
1138
typeClusterstruct {
1130
1139
metav1.TypeMeta`json:",inline"`
1131
1140
// metadata is the standard object's metadata.
1132
1141
// More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata
// +Metrics:info:name="annotation_paused",JSONPath=.annotations['cluster\.x-k8s\.io/paused'],help="Whether the cluster is paused and any of its resources will not be processed by the controllers.",labelsFromPath={paused_value:"."}
// +Metrics:info:name="annotation_paused",JSONPath=.annotations['cluster\.x-k8s\.io/paused'],help="Whether the clusterclass is paused and any of its resources will not be processed by the controllers.",labelsFromPath={paused_value:"."}
@@ -1165,6 +1173,8 @@ type ClusterClassV1Beta2Status struct {
1165
1173
// +listType=map
1166
1174
// +listMapKey=type
1167
1175
// +kubebuilder:validation:MaxItems=32
1176
+
// +Metrics:stateset:name="status_condition",help="The condition of a clusterclass.",labelName="status",JSONPath=.status,list={"True","False","Unknown"},labelsFromPath={"type":".type"}
1177
+
// +Metrics:gauge:name="status_condition_last_transition_time",help="The condition's last transition time of a clusterclass.",valueFrom=.lastTransitionTime,labelsFromPath={"type":".type","status":".status"}
// +Metrics:stateset:name="status_phase",help="The machines current phase.",labelName="phase",list={"Pending","Provisioning","Provisioned","Running","Deleting","Deleted","Failed","Unknown"}
553
556
Phasestring`json:"phase,omitempty"`
554
557
555
558
// certificatesExpiryDate is the expiry date of the machine certificates.
556
559
// This value is only set for control plane machines.
557
560
// +optional
561
+
// +Metrics:gauge:name="status_certificatesexpirydate",help="Information about certificate expiration date of a control plane node.",nilIsZero=true
// bootstrapReady is the state of the bootstrap provider.
@@ -596,6 +600,8 @@ type MachineV1Beta2Status struct {
596
600
// +listType=map
597
601
// +listMapKey=type
598
602
// +kubebuilder:validation:MaxItems=32
603
+
// +Metrics:stateset:name="status_condition",help="The condition of a machine.",labelName="status",JSONPath=".status",list={"True","False","Unknown"},labelsFromPath={"type":".type"}
604
+
// +Metrics:gauge:name="status_condition_last_transition_time",help="The condition's last transition time of a machine.",valueFrom=.lastTransitionTime,labelsFromPath={"type":".type","status":".status"}
// +Metrics:info:name="info",help="Information about a machine.",labelsFromPath={bootstrap_reference_kind:.spec.bootstrap.configRef.kind,bootstrap_reference_name:.spec.bootstrap.configRef.name,container_runtime_version:.status.nodeInfo.containerRuntimeVersion,control_plane_name:.metadata.labels.cluster\.x-k8s\.io/control-plane-name,failure_domain:.spec.failureDomain,infrastructure_reference_kind:.spec.infrastructureRef.kind,infrastructure_reference_name:.spec.infrastructureRef.name,kernel_version:.status.nodeInfo.kernelVersion,kube_proxy_version:.status.nodeInfo.kubeProxyVersion,kubelet_version:.status.nodeInfo.kubeletVersion,os_image:.status.nodeInfo.osImage,provider_id:.spec.providerID,version:.spec.version}
671
683
typeMachinestruct {
672
684
metav1.TypeMeta`json:",inline"`
673
685
// metadata is the standard object's metadata.
674
686
// More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata
// +Metrics:info:name="annotation_paused",JSONPath=.annotations['cluster\.x-k8s\.io/paused'],help="Whether the machine is paused and any of its resources will not be processed by the controllers.",labelsFromPath={paused_value:"."}
0 commit comments