-
Notifications
You must be signed in to change notification settings - Fork 96
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #747 from osherdp/feature/configuring-cluster-auto…
…scaler OCM-209 | feat: Add cluster autoscaler structs to cluster model
- Loading branch information
Showing
5 changed files
with
128 additions
and
0 deletions.
There are no files selected for viewing
29 changes: 29 additions & 0 deletions
29
model/clusters_mgmt/v1/autoscaler_resource_limits_type.model
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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 <min>:<max>. | ||
// 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 <min>:<max>. | ||
// Cluster autoscaler will not scale the cluster beyond these numbers. | ||
Memory ResourceRange | ||
} |
35 changes: 35 additions & 0 deletions
35
model/clusters_mgmt/v1/autoscaler_scale_down_config_type.model
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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 | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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 | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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 | ||
} |