diff --git a/model/clusters_mgmt/v1/autoscaler_resource_limits_type.model b/model/clusters_mgmt/v1/autoscaler_resource_limits_type.model new file mode 100644 index 00000000..61b045a4 --- /dev/null +++ b/model/clusters_mgmt/v1/autoscaler_resource_limits_type.model @@ -0,0 +1,29 @@ +/* +Copyright (c) 2023 Red Hat, Inc. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +struct AutoscalerResourceLimits { + // Maximum number of nodes in all node groups. + // Cluster autoscaler will not grow the cluster beyond this number. + MaxNodesTotal Integer + + // Minimum and maximum number of cores in cluster, in the format :. + // Cluster autoscaler will not scale the cluster beyond these numbers. + Cores ResourceRange + + // Minimum and maximum number of gigabytes of memory in cluster, in the format :. + // Cluster autoscaler will not scale the cluster beyond these numbers. + Memory ResourceRange +} diff --git a/model/clusters_mgmt/v1/autoscaler_scale_down_config_type.model b/model/clusters_mgmt/v1/autoscaler_scale_down_config_type.model new file mode 100644 index 00000000..c03e16f9 --- /dev/null +++ b/model/clusters_mgmt/v1/autoscaler_scale_down_config_type.model @@ -0,0 +1,35 @@ +/* +Copyright (c) 2023 Red Hat, Inc. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +struct AutoscalerScaleDownConfig { + // Should cluster-autoscaler scale down the cluster. + Enabled Boolean + + // How long a node should be unneeded before it is eligible for scale down. + UnneededTime String + + // Node utilization level, defined as sum of requested resources divided by capacity, below which a node can be considered for scale down. + UtilizationThreshold String + + // How long after scale up that scale down evaluation resumes. + DelayAfterAdd String + + // How long after node deletion that scale down evaluation resumes, defaults to scan-interval. + DelayAfterDelete String + + // How long after scale down failure that scale down evaluation resumes. + DelayAfterFailure String +} diff --git a/model/clusters_mgmt/v1/cluster_autoscaler_type.model b/model/clusters_mgmt/v1/cluster_autoscaler_type.model new file mode 100644 index 00000000..d75d0042 --- /dev/null +++ b/model/clusters_mgmt/v1/cluster_autoscaler_type.model @@ -0,0 +1,41 @@ +/* +Copyright (c) 2023 Red Hat, Inc. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +// Cluster-wide autoscaling configuration. +struct ClusterAutoscaler { + // BalanceSimilarNodeGroups enables/disables the + // `--balance-similar-node-groups` cluster-autocaler feature. + // This feature will automatically identify node groups with + // the same instance type and the same set of labels and try + // to keep the respective sizes of those node groups balanced. + BalanceSimilarNodeGroups Boolean + + // Enables/Disables `--skip-nodes-with-local-storage` CA feature flag. If true cluster autoscaler will never delete nodes with pods with local storage, e.g. EmptyDir or HostPath. true by default at autoscaler. + SkipNodesWithLocalStorage Boolean + + // Sets the autoscaler log level. + // Default value is 1, level 4 is recommended for DEBUGGING and level 6 will enable almost everything. + LogVerbosity Integer + + // Gives pods graceful termination time before scaling down. + MaxPodGracePeriod Integer + + // Constraints of autoscaling resources. + ResourceLimits AutoscalerResourceLimits + + // Configuration of scale down operation. + ScaleDown AutoscalerScaleDownConfig +} diff --git a/model/clusters_mgmt/v1/cluster_type.model b/model/clusters_mgmt/v1/cluster_type.model index 34dd1022..e0607215 100644 --- a/model/clusters_mgmt/v1/cluster_type.model +++ b/model/clusters_mgmt/v1/cluster_type.model @@ -105,6 +105,9 @@ class Cluster { // Proxy. Proxy Proxy + // Autoscaler. + Autoscaler ClusterAutoscaler + // Additional trust bundle. AdditionalTrustBundle String diff --git a/model/clusters_mgmt/v1/resource_range_type.model b/model/clusters_mgmt/v1/resource_range_type.model new file mode 100644 index 00000000..397fdcbd --- /dev/null +++ b/model/clusters_mgmt/v1/resource_range_type.model @@ -0,0 +1,20 @@ +/* +Copyright (c) 2023 Red Hat, Inc. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +struct ResourceRange { + Min Integer + Max Integer +}