From 298fd95ca9d2f21bb25849bc0011950f406b7c11 Mon Sep 17 00:00:00 2001 From: xuezhaojun Date: Tue, 2 Jan 2024 14:06:07 +0800 Subject: [PATCH] Add nodeStatus. Signed-off-by: xuezhaojun --- ...ter-management.io_managedclusters.crd.yaml | 20 +++++++++++++++++++ cluster/v1/types.go | 19 ++++++++++++++++++ .../v1/zz_generated.swagger_doc_generated.go | 12 +++++++++++ 3 files changed, 51 insertions(+) diff --git a/cluster/v1/0000_00_clusters.open-cluster-management.io_managedclusters.crd.yaml b/cluster/v1/0000_00_clusters.open-cluster-management.io_managedclusters.crd.yaml index 88fbe6ae5..c4ea83931 100644 --- a/cluster/v1/0000_00_clusters.open-cluster-management.io_managedclusters.crd.yaml +++ b/cluster/v1/0000_00_clusters.open-cluster-management.io_managedclusters.crd.yaml @@ -263,6 +263,26 @@ spec: - type type: object type: array + nodeStatus: + description: NodeStatus represents the status of nodes on the managed + cluster. + properties: + ready: + description: Ready represents the number of ready nodes on the + managed cluster. + format: int32 + type: integer + schedulable: + description: Schedulable represents the number of schedulable + nodes on the managed cluster. + format: int32 + type: integer + total: + description: Total represents the total number of nodes on the + managed cluster. + format: int32 + type: integer + type: object version: description: Version represents the kubernetes version of the managed cluster. diff --git a/cluster/v1/types.go b/cluster/v1/types.go index e4a9351d7..58d0cf1b2 100644 --- a/cluster/v1/types.go +++ b/cluster/v1/types.go @@ -163,6 +163,25 @@ type ManagedClusterStatus struct { // vendor or version specific and may not be included from all managed clusters. // +optional ClusterClaims []ManagedClusterClaim `json:"clusterClaims,omitempty"` + + // NodeStatus represents the status of nodes on the managed cluster. + // +optional + NodeStatus NodeStatus `json:"nodeStatus,omitempty"` +} + +// NodeStatus represents the status of nodes on the managed cluster. +type NodeStatus struct { + // Ready represents the number of ready nodes on the managed cluster. + // +optional + Ready int32 `json:"ready,omitempty"` + + // Schedulable represents the number of schedulable nodes on the managed cluster. + // +optional + Schedulable int32 `json:"schedulable,omitempty"` + + // Total represents the total number of nodes on the managed cluster. + // +optional + Total int32 `json:"total,omitempty"` } // ManagedClusterVersion represents version information about the managed cluster. diff --git a/cluster/v1/zz_generated.swagger_doc_generated.go b/cluster/v1/zz_generated.swagger_doc_generated.go index 3b06be595..45642a78a 100644 --- a/cluster/v1/zz_generated.swagger_doc_generated.go +++ b/cluster/v1/zz_generated.swagger_doc_generated.go @@ -70,6 +70,7 @@ var map_ManagedClusterStatus = map[string]string{ "allocatable": "Allocatable represents the total allocatable resources on the managed cluster.", "version": "Version represents the kubernetes version of the managed cluster.", "clusterClaims": "ClusterClaims represents cluster information that a managed cluster claims, for example a unique cluster identifier (id.k8s.io) and kubernetes version (kubeversion.open-cluster-management.io). They are written from the managed cluster. The set of claims is not uniform across a fleet, some claims can be vendor or version specific and may not be included from all managed clusters.", + "nodeStatus": "NodeStatus represents the status of nodes on the managed cluster.", } func (ManagedClusterStatus) SwaggerDoc() map[string]string { @@ -85,6 +86,17 @@ func (ManagedClusterVersion) SwaggerDoc() map[string]string { return map_ManagedClusterVersion } +var map_NodeStatus = map[string]string{ + "": "NodeStatus represents the status of nodes on the managed cluster.", + "ready": "Ready represents the number of ready nodes on the managed cluster.", + "schedulable": "Schedulable represents the number of schedulable nodes on the managed cluster.", + "total": "Total represents the total number of nodes on the managed cluster.", +} + +func (NodeStatus) SwaggerDoc() map[string]string { + return map_NodeStatus +} + var map_Taint = map[string]string{ "": "The managed cluster this Taint is attached to has the \"effect\" on any placement that does not tolerate the Taint.", "key": "Key is the taint key applied to a cluster. e.g. bar or foo.example.com/bar. The regex it matches is (dns1123SubdomainFmt/)?(qualifiedNameFmt)",