Commit Graph

71 Commits

Author SHA1 Message Date
Damir Markovic 11d150e920 Add podScaleUpDelay annotation support 2022-09-05 20:24:19 +02:00
mikelo c127763a45 switched policy for PodDisruptionBudget from v1beta1 to v1 in time for 1.25 2022-06-24 19:13:03 +02:00
Benjamin Pineau a726944273 Don't deref nil nodegroup in deleteCreatedNodesWithErrors
Various cloudproviders' `NodeGroupForNode()` implementations (including
aws, azure, and gce) can returns a `nil` error _and_ a `nil` nodegroup.
Eg. we're seeing AWS returning that on failed upscales on live clusters.
Checking that `deleteCreatedNodesWithErrors` doesn't return an error is
not enough to safely dereference the nodegroup (as returned by
`NodeGroupForNode()`) by calling nodegroup.Id().

In that situation, logging and returning early seems the safest option,
to give various caches (eg. clusterstateregistry's and cloud provider's)
the opportunity to eventually converge.
2022-05-30 18:47:14 +02:00
Kuba Tużnik 6bd2432894 CA: switch legacy ScaleDown to use the new Actuator
NodeDeletionTracker is now incremented asynchronously
for drained nodes, instead of synchronously. This shouldn't
change anything in actual behavior, but some tests
depended on that, so they had to be adapted.

The switch aims to mostly be a semantic no-op, with
the following exceptions:
* Nodes that fail to be tainted won't be included in
  NodeDeleteResults, since they are now tainted
  synchronously.
2022-05-27 15:13:44 +02:00
Daniel Kłobuszewski c550b77020 Make NodeDeletionTracker implement ActuationStatus interface 2022-04-28 17:08:10 +02:00
Daniel Kłobuszewski 7f8b2da9e3 Separate ScaleDown logic with a new interface 2022-04-26 08:48:45 +02:00
Daniel Kłobuszewski 5a78f49bc2 Move soft tainting logic to a separate package 2022-04-26 08:48:45 +02:00
Daniel Kłobuszewski 7686a1f326 Move existing ScaleDown code to a separate package 2022-04-26 08:48:45 +02:00
Daniel Kłobuszewski 4187e4ce3d Extract core test utils to a separate package 2022-04-26 08:48:45 +02:00
Yaroslava Serdiuk 8a7b99c7eb Continue CA loop when unregistered nodes were removed 2022-04-12 07:49:42 +00:00
Jayant Jain 729038ff2d Adding support for Debugging Snapshot 2021-12-30 09:08:05 +00:00
Bartłomiej Wróblewski 5076047bf8 Skip iteration loop if node creation failed 2021-06-16 14:40:15 +00:00
Michael McCune 3169a1cd9b add field keys to cluster autoscaler unit test structs
A few of the unit test structures did not have field name keys when
using literal structs. This change adds the fields to make this code a
little more future-proof.
2021-05-25 12:53:21 -04:00
Eric Mrak and Brett Kochendorfer 8442ba8307 Add argument for Status Configmap tests 2021-02-18 17:21:32 +00:00
Maciek Pytel 65b3c8d3cc Rename default options to NodeGroupDefaults 2021-01-25 13:21:30 +01:00
Maciek Pytel 3e42b26a22 Per NodeGroup config for scale-down options
This is the implementation of
https://github.com/kubernetes/autoscaler/issues/3583#issuecomment-743215343.
2021-01-25 11:00:17 +01:00
Maciek Pytel 08d18a7bd0 Define interfaces for per NodeGroup config.
This is the first step of implementing
https://github.com/kubernetes/autoscaler/issues/3583#issuecomment-743215343.
New method was added to cloudprovider interface. All existing providers
were updated with a no-op stub implementation that will result in no
behavior change.
The config values specified per NodeGroup are not yet applied.
2021-01-25 11:00:16 +01:00
Bartłomiej Wróblewski 0fb897b839 Update imports after scheduler scheduler/framework/v1alpha1 removal 2020-11-30 10:48:52 +00:00
Maciek Pytel 655b4081f4 Migrate to klog v2 2020-06-05 17:22:26 +02:00
Jakub Tużnik 73a5cdf928 Address recent breaking changes in scheduler
The following things changed in scheduler and needed to be fixed:
* NodeInfo was moved to schedulerframework
* Some fields on NodeInfo are now exposed directly instead of via getters
* NodeInfo.Pods is now a list of *schedulerframework.PodInfo, not *apiv1.Pod
* SharedLister and NodeInfoLister were moved to schedulerframework
* PodLister was removed
2020-04-24 17:54:47 +02:00
Aleksandra Malinowska 9c6a0f9aab Filter out expendable pods before initializing snapshot 2020-03-03 12:05:58 +01:00
Łukasz Osipiuk fa2c6e4d9e Propagate cluster state to ClusterSnapshot 2020-02-04 20:51:27 +01:00
Aleksandra Malinowska 3614d4ec33 Test balancing autoprovisioned node groups 2020-02-03 17:54:02 +01:00
Łukasz Osipiuk dd9fe48f46 Remove filterOutSchedulableSimple 2020-01-29 13:11:38 +01:00
Łukasz Osipiuk e2ca403123 Return error from NewScaleTestAutoscalingContext 2020-01-29 11:22:07 +01:00
Łukasz Osipiuk cdcc693ab9 Remove OldBinpackingEstimator 2020-01-14 15:29:16 +01:00
Łukasz Osipiuk 7b499aa4c9 Rename STOCKOUT to RESOURCE_POOL_EXHAUSTED
We came into conclusion that using STOCKOUT as error code is too
specific. Migrating to more general term RESOURCE_POOL_EXHAUSTED.
2019-11-12 14:39:51 +01:00
Łukasz Osipiuk 7f083d2393 Move core/utils.go to separate package and split into multiple files 2019-10-22 14:23:40 +02:00
Vivek Bagade 90aa28a077 Move pod packing in upcoming nodes to RunOnce from Estimator for performance improvements 2019-06-19 14:48:47 +02:00
Łukasz Osipiuk be68d06b40 Add unit test case for OTHER error handling 2019-06-07 16:54:01 +02:00
Krzysztof Jastrzebski 22b4a6283e Optimize building node infos by using map with pods for nodes. 2019-06-03 13:24:09 +02:00
Krzysztof Jastrzebski 4831d76288 Cache cloud provider node instances in cluster state. 2019-05-31 10:11:51 +02:00
Krzysztof Jastrzebski da82f831a3 Use fakeNodeLister instead of mocks. 2019-05-27 15:10:31 +02:00
Kubernetes Prow Robot cb4e60f8d4
Merge pull request #2031 from krzysztof-jastrzebski/master
Add functionality which delays node deletion to let other components prepare for deletion.
2019-05-20 00:57:13 -07:00
Łukasz Osipiuk e76558c65f Add methods for passing arbitrary object via autoscaling context
Change-Id: I066e58010a0aef4989bfc1f73b90bc69c773b26e
2019-05-17 16:38:12 +02:00
Krzysztof Jastrzebski 4247c8b032 Implement functionality which delays node deletion when node has
annotation with  prefix
'delay-deletion.cluster-autoscaler.kubernetes.io/'.
2019-05-17 16:06:17 +02:00
Łukasz Osipiuk db4c6f1133 Migrate filter out schedulabe to PodListProcessor 2019-04-15 16:59:13 +02:00
Łukasz Osipiuk c6115b826e Define ProcessorCallbacks interface 2019-04-15 16:59:13 +02:00
Pengfei Ni 128729bae9 Move schedulercache to package nodeinfo 2019-02-21 12:41:08 +08:00
Vivek Bagade c6b87841ce Added a new method that uses pod packing to filter schedulable pods
filterOutSchedulableByPacking is an alternative to the older
filterOutSchedulable. filterOutSchedulableByPacking sorts pods in
unschedulableCandidates by priority and filters out pods that can be
scheduled on free capacity on existing nodes. It uses a basic packing
approach to do this. Pods with nominatedNodeName set are always
filtered out.

filterOutSchedulableByPacking is set to be used by default, but, this
can be toggled off by setting filter-out-schedulable-pods-uses-packing
flag to false, which would then activate the older and more lenient
filterOutSchedulable(now called filterOutSchedulableSimple).

Added test cases for both methods.
2019-01-25 16:09:51 +05:30
Vivek Bagade 8fff0f6556 Removing nominatedNodeName annotation and moving to pod.Status.NominatedNodeName 2019-01-25 00:06:03 +05:30
Vivek Bagade 79ef3a6940 unexporting methods in utils.go 2019-01-25 00:06:03 +05:30
Jacek Kaniuk 0c64e0932a Tainting unneeded nodes as PreferNoSchedule 2019-01-21 13:06:50 +01:00
Łukasz Osipiuk 85a83b62bd Pass nodeGroup->NodeInfo map to ClusterStateRegistry
Change-Id: Ie2a51694b5731b39c8a4135355a3b4c832c26801
2019-01-08 15:52:00 +01:00
Maciej Pytel 3f0da8947a Use listers in scale-up 2019-01-02 15:56:01 +01:00
Maciej Pytel 9060014992 Use listers in scale-down 2018-12-31 14:55:38 +01:00
Kubernetes Prow Robot ab7f1e69be
Merge pull request #1464 from losipiuk/lo/stockouts2
Better quota-exceeded/stockout handling
2018-12-31 05:28:08 -08:00
Łukasz Osipiuk ddbe05b279 Add unit test for stockouts handling 2018-12-28 17:17:07 +01:00
Maciej Pytel 60babe7158 Use kubernetes lister for daemonset instead of custom one
Also migrate to using apps/v1.DaemonSet instead of old
extensions/v1beta1.
2018-12-28 13:55:41 +01:00
Maciej Pytel 40811c2f8b Add listers for more controllers 2018-12-28 13:31:21 +01:00