From a33606c365c5625e05517c2f54cc250a6d81cb48 Mon Sep 17 00:00:00 2001 From: haolin Date: Fri, 24 Nov 2023 10:35:17 +0800 Subject: [PATCH] add resource type struct and make update Signed-off-by: haolin --- ...en-cluster-management.io_klusterlets.crd.yaml | 6 ++++++ ...en-cluster-management.io_klusterlets.crd.yaml | 6 ++++++ operator/v1/types_klusterlet.go | 16 ++++++++++++++-- .../v1/zz_generated.swagger_doc_generated.go | 9 +++++++++ 4 files changed, 35 insertions(+), 2 deletions(-) diff --git a/crdsv1beta1/0001_00_operator.open-cluster-management.io_klusterlets.crd.yaml b/crdsv1beta1/0001_00_operator.open-cluster-management.io_klusterlets.crd.yaml index 01316fd0d..33ae90d69 100644 --- a/crdsv1beta1/0001_00_operator.open-cluster-management.io_klusterlets.crd.yaml +++ b/crdsv1beta1/0001_00_operator.open-cluster-management.io_klusterlets.crd.yaml @@ -145,6 +145,12 @@ spec: registrationImagePullSpec: description: RegistrationImagePullSpec represents the desired image configuration of registration agent. quay.io/open-cluster-management.io/registration:latest will be used if unspecified. type: string + resourceType: + description: ResourceType specify QoS classes of klusterlet deployment + type: object + properties: + type: + type: string workConfiguration: description: WorkConfiguration contains the configuration of work type: object diff --git a/operator/v1/0000_00_operator.open-cluster-management.io_klusterlets.crd.yaml b/operator/v1/0000_00_operator.open-cluster-management.io_klusterlets.crd.yaml index 2673c9236..e1c1417d3 100644 --- a/operator/v1/0000_00_operator.open-cluster-management.io_klusterlets.crd.yaml +++ b/operator/v1/0000_00_operator.open-cluster-management.io_klusterlets.crd.yaml @@ -229,6 +229,12 @@ spec: configuration of registration agent. quay.io/open-cluster-management.io/registration:latest will be used if unspecified. type: string + resourceType: + description: ResourceType specify QoS classes of klusterlet deployment + properties: + type: + type: string + type: object workConfiguration: description: WorkConfiguration contains the configuration of work properties: diff --git a/operator/v1/types_klusterlet.go b/operator/v1/types_klusterlet.go index 9421e5c09..ad59052fa 100644 --- a/operator/v1/types_klusterlet.go +++ b/operator/v1/types_klusterlet.go @@ -87,9 +87,21 @@ type KlusterletSpec struct { // +optional HubApiServerHostAlias *HubApiServerHostAlias `json:"hubApiServerHostAlias,omitempty"` - // BestEffortResource allow use the best effort resource for operator/registration/work deployment + // ResourceType specify QoS classes of klusterlet deployment // +optional - BestEffortResource bool `json:"bestEffortResource,omitempty"` + ResourceType ResourceType `json:"resourceType,omitempty"` +} + +type ResourceQosClass string + +const ( + ResourceQosClassDefault ResourceQosClass = "Default" + ResourceQosClassBestEffort ResourceQosClass = "BestEffort" +) + +// ResourceType allow user override the default pod QoS classes +type ResourceType struct { + Type ResourceQosClass `json:"type"` } // ServerURL represents the apiserver url and ca bundle that is accessible externally diff --git a/operator/v1/zz_generated.swagger_doc_generated.go b/operator/v1/zz_generated.swagger_doc_generated.go index fefa0333c..591ec4859 100644 --- a/operator/v1/zz_generated.swagger_doc_generated.go +++ b/operator/v1/zz_generated.swagger_doc_generated.go @@ -213,6 +213,7 @@ var map_KlusterletSpec = map[string]string{ "registrationConfiguration": "RegistrationConfiguration contains the configuration of registration", "workConfiguration": "WorkConfiguration contains the configuration of work", "hubApiServerHostAlias": "HubApiServerHostAlias contains the host alias for hub api server. registration-agent and work-agent will use it to communicate with hub api server.", + "resourceType": "ResourceType specify QoS classes of klusterlet deployment", } func (KlusterletSpec) SwaggerDoc() map[string]string { @@ -241,6 +242,14 @@ func (RegistrationConfiguration) SwaggerDoc() map[string]string { return map_RegistrationConfiguration } +var map_ResourceType = map[string]string{ + "": "ResourceType allow user override the default pod QoS classes", +} + +func (ResourceType) SwaggerDoc() map[string]string { + return map_ResourceType +} + var map_ServerURL = map[string]string{ "": "ServerURL represents the apiserver url and ca bundle that is accessible externally", "url": "URL is the url of apiserver endpoint of the managed cluster.",