Skip to content

Commit

Permalink
add flag to allow use best effort resource for klusterlet
Browse files Browse the repository at this point in the history
Signed-off-by: haolin <[email protected]>
  • Loading branch information
haowells committed Nov 24, 2023
1 parent bab1208 commit 67f5fa7
Show file tree
Hide file tree
Showing 5 changed files with 67 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -145,6 +145,16 @@ 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
resourceRequirement:
description: ResourceRequirement specify QoS classes of klusterlet deployment
type: object
properties:
type:
type: string
default: Default
enum:
- Default
- BestEffort
workConfiguration:
description: WorkConfiguration contains the configuration of work
type: object
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -229,6 +229,17 @@ spec:
configuration of registration agent. quay.io/open-cluster-management.io/registration:latest
will be used if unspecified.
type: string
resourceRequirement:
description: ResourceRequirement specify QoS classes of klusterlet
deployment
properties:
type:
default: Default
enum:
- Default
- BestEffort
type: string
type: object
workConfiguration:
description: WorkConfiguration contains the configuration of work
properties:
Expand Down
20 changes: 20 additions & 0 deletions operator/v1/types_klusterlet.go
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,26 @@ type KlusterletSpec struct {
// registration-agent and work-agent will use it to communicate with hub api server.
// +optional
HubApiServerHostAlias *HubApiServerHostAlias `json:"hubApiServerHostAlias,omitempty"`

// ResourceRequirement specify QoS classes of klusterlet deployment
// +optional
ResourceRequirement ResourceRequirement `json:"resourceRequirement,omitempty"`
}

type ResourceQosClass string

const (
// Default use resource setting in the template file
ResourceQosClassDefault ResourceQosClass = "Default"
// If all containers in the pod don't set resource request and limits, the pod is treated as BestEffort.
ResourceQosClassBestEffort ResourceQosClass = "BestEffort"
)

// ResourceRequirement allow user override the default pod QoS classes
type ResourceRequirement struct {
// +kubebuilder:validation:Enum=Default;BestEffort
// +kubebuilder:default:=Default
Type ResourceQosClass `json:"type"`
}

// ServerURL represents the apiserver url and ca bundle that is accessible externally
Expand Down
17 changes: 17 additions & 0 deletions operator/v1/zz_generated.deepcopy.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

9 changes: 9 additions & 0 deletions operator/v1/zz_generated.swagger_doc_generated.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 67f5fa7

Please sign in to comment.