Skip to content

Commit

Permalink
Merge pull request #24 from avisi-cloud/AME-3041-add-support-for-clus…
Browse files Browse the repository at this point in the history
…ter-autoscaling-settings

AME-3041 Add support for cluster autoscaler settings
  • Loading branch information
HugUlf authored Oct 3, 2024
2 parents 7ff2cef + eb62d49 commit 3f12549
Showing 1 changed file with 27 additions and 7 deletions.
34 changes: 27 additions & 7 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 @@ -153,7 +154,8 @@ type CreateCluster struct {
IPWhitelist []IPWhitelistEntry `json:"ipWhitelist,omitempty" yaml:"IpWhitelist,omitempty"`
Addons map[string]APIAddon `json:"addons,omitempty" yaml:"Addons,omitempty"`

MaintenanceScheduleIdentity string `json:"maintenanceScheduleIdentity,omitempty" yaml:"MaintenanceScheduleIdentity,omitempty"`
AutoScalerSettings *AutoscalingSettings `json:"clusterAutoscalerSettings,omitempty" yaml:"ClusterAutoScalerSettings,omitempty"`
MaintenanceScheduleIdentity string `json:"maintenanceScheduleIdentity,omitempty" yaml:"MaintenanceScheduleIdentity,omitempty"`
}

// IPWhitelistEntry represents an entry in the IP whitelist.
Expand All @@ -173,12 +175,13 @@ type UpdateCluster struct {
EnableAutoUpgrade *bool `json:"enableAutoUpgrade,omitempty" yaml:"EnableAutoUpgrade,omitempty"`
EnableHighAvailability *bool `json:"enableHighAvailability,omitempty" yaml:"EnableHighAvailability,omitempty"`
// Deprecated: replaced by PodSecurityStandardsProfile which offers support for selecting a specific default PSS profile. This setting does not do anything since Kubernetes v1.23
EnablePodSecurityStandards *bool `json:"enablePodSecurityStandards,omitempty" yaml:"EnablePodSecurityStandards,omitempty"`
PodSecurityStandardsProfile *string `json:"podSecurityStandardsProfile,omitempty" yaml:"PodSecurityStandardsProfile,omitempty"`
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"`
MaintenanceScheduleIdentity *string `json:"maintenanceScheduleIdentity,omitempty" yaml:"MaintenanceScheduleIdentity,omitempty"`
EnablePodSecurityStandards *bool `json:"enablePodSecurityStandards,omitempty" yaml:"EnablePodSecurityStandards,omitempty"`
PodSecurityStandardsProfile *string `json:"podSecurityStandardsProfile,omitempty" yaml:"PodSecurityStandardsProfile,omitempty"`
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"`
MaintenanceScheduleIdentity *string `json:"maintenanceScheduleIdentity,omitempty" yaml:"MaintenanceScheduleIdentity,omitempty"`
}

// NodePools is used by CreateCluster
Expand Down Expand Up @@ -451,3 +454,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"`
}

0 comments on commit 3f12549

Please sign in to comment.