Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

AME-3041 Add support for cluster autoscaler settings #24

Merged
merged 5 commits into from
Oct 3, 2024
Merged
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 21 additions & 0 deletions pkg/acloudapi/apitypes.go
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,7 @@ type Cluster struct {
ObservabilityTenant *ObservabilityTenant `json:"observabilityTenant,omitempty" yaml:"ObservabilityTenant,omitempty"`
EnvironmentPrometheusRules bool `json:"environmentPrometheusRules" yaml:"EnvironmentPrometheusRules"`
MaintenanceSchedule *MaintenanceSchedule `json:"maintenanceSchedule,omitempty" yaml:"MaintenanceSchedule,omitempty"`
AutoScalerSettings AutoscalingSettings `json:"clusterAutoscalerSettings,omitempty" yaml:"ClusterAutoScalerSettings,omitempty"`
}

type MaintenanceSchedule struct {
Expand Down Expand Up @@ -152,6 +153,8 @@ type CreateCluster struct {
NodePools []NodePools `json:"nodePools" yaml:"NodePools"`
IPWhitelist []IPWhitelistEntry `json:"ipWhitelist,omitempty" yaml:"IpWhitelist,omitempty"`
Addons map[string]APIAddon `json:"addons,omitempty" yaml:"Addons,omitempty"`

AutoScalerSettings AutoscalingSettings `json:"clusterAutoscalerSettings,omitempty" yaml:"ClusterAutoScalerSettings,omitempty"`
}

// IPWhitelistEntry represents an entry in the IP whitelist.
Expand All @@ -176,6 +179,7 @@ type UpdateCluster struct {
DeleteProtection *bool `json:"deleteProtection,omitempty" yaml:"DeleteProtection,omitempty"`
IPWhitelist []string `json:"ipWhitelist,omitempty" yaml:"IpWhitelist,omitempty"`
Addons map[string]APIAddon `json:"addons,omitempty" yaml:"Addons,omitempty"`
AutoScalerSettings AutoscalingSettings `json:"clusterAutoscalerSettings,omitempty" yaml:"ClusterAutoScalerSettings,omitempty"`
Copy link
Member

@djmarkoz djmarkoz Oct 3, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think we should use a pointer here as well.

}

// NodePools is used by CreateCluster
Expand Down Expand Up @@ -425,3 +429,20 @@ type ListScheduledClusterUpgradesOpts struct {
ClusterIdentities []string
Statuses []ScheduledClusterUpgradeStatus
}

type AutoscalingSettings struct {
// ScaleDownUtilizationThreshold specifies the scale down utilization threshold
ScaleDownUtilizationThreshold string `json:"scale-down-utilization-threshold"`
// ScaleDownGpuUtilizationThreshold specifies the scale down GPU utilization threshold
ScaleDownGpuUtilizationThreshold string `json:"scale-down-gpu-utilization-threshold"`
// ScaleDownDelayAfterAdd specifies the scale down delay after add
ScaleDownDelayAfterAdd string `json:"scale-down-delay-after-add"`
// ScaleDownUnneededTime specifies the scale down unneeded time
ScaleDownUnneededTime string `json:"scale-down-unneeded-time"`
// ScaleDownUnreadyTime specifies the scale down unready time
ScaleDownUnreadyTime string `json:"scale-down-unready-time"`
// MaxNodeProvisionTime specifies the max node provision time
MaxNodeProvisionTime string `json:"max-node-provision-time"`
// UnremovableNodeRecheckTimeout specifies the unremovable node recheck timeout
UnremovableNodeRecheckTimeout string `json:"unremovable-node-recheck-timeout"`
}
Loading