Commit Graph

56 Commits

Author SHA1 Message Date
Maciej Pytel 849b3a2712 Function to compare nodeinfos to find similar nodegroups 2017-05-31 13:21:27 +02:00
Marcin Wielgus e9ebfb1c35 Preferred node in price-preferred expander 2017-05-30 20:33:10 +02:00
Marcin Wielgus 80bf191f02 GCE pricing model 2017-05-26 17:37:32 +02:00
Maciej Pytel 7f5c7ed3a2 Used typed errors in scale up code
Updated some of the functions called by scale up
to return new errors as required.
2017-05-18 14:09:15 +02:00
Maciej Pytel f716a7e496 Add typed errors; add errors_total metric
To keep reasonable commit size only top-level files use
new errors. Will add them in other files in next commits.
2017-05-18 14:09:15 +02:00
Matthew Walter f64a73429a Correct typos for `deamon` -> `daemon` as in `DaemonSet` 2017-05-12 13:27:40 -04:00
Marcin Wielgus f015ef1853 Merge pull request #62 from mwielgus/zero-4
Daemonset helper function that returns pods that DaemonSet controller would start on the given node.
2017-05-12 11:59:04 +02:00
Marcin Wielgus 6d578132b9 Daemonset helper functions 2017-05-12 11:37:11 +02:00
Marcin Wielgus 0a0129f511 Daemonset listers 2017-05-11 12:30:27 +02:00
Yusuke Kuoka 5304e9af21 cluster-autoscaler: Fix typos in comments 2017-05-10 11:22:15 +09:00
Maciej Pytel 6b2ea76973 Added UT for CA simulator 2017-04-19 19:12:30 +02:00
Maciej Pytel 4d40222b63 Fix gofmt 2017-04-18 16:45:27 +02:00
Marcin Wielgus 34eb4973f8 Fix imports in cluster autoscaler after migrating it from contrib 2017-04-18 15:42:04 +02:00
Maciej Pytel 1590789292 Cluster-Autoscaler: "unknown" readiness -> unready 2017-03-15 11:16:17 +01:00
Maciej Pytel 0379a73828 Cluster-Autoscaler: fix delete taint failing 2017-03-10 12:02:52 +01:00
Kubernetes Submit Queue b171566401 Merge pull request https://github.com/kubernetes/contrib/pull/2461 from mwielgus/lister-fix
Automatic merge from submit-queue

Cluster-autoscaler: ready node lister fix

cc: @MaciekPytel @jszczepkowski
2017-03-09 08:32:45 -08:00
Marcin Wielgus 95bad10311 Cluster-autoscaler: ready node lister fix 2017-03-09 19:18:49 +03:00
Kubernetes Submit Queue 7fcab2d18e Merge pull request https://github.com/kubernetes/contrib/pull/2460 from mwielgus/pdb-typo
Automatic merge from submit-queue

Cluster-autoscaler: fix typo in pdb listener

cc: @MaciekPytel @jszczepkowski
2017-03-09 07:53:12 -08:00
Marcin Wielgus 10f848b049 Cluster-autoscaler: fix typo in pdb listener 2017-03-09 18:38:50 +03:00
Maciej Pytel d305a0021a Cluster-Autoscaler: fix delete taint value format 2017-03-09 15:24:52 +01:00
Marcin Wielgus 27b797f541 Cluster-Autoscaler: skip nodes currently under deletion in scale down 2017-03-07 14:59:15 +01:00
Marcin Wielgus 5b4441083a Cluster-autoscaler: include PodDisruptionBudget in drain - part 1/2 2017-03-06 17:15:04 +01:00
Marcin Wielgus 2ffaddb7c0 Cluster-autoscaler: lint 2017-03-02 15:15:07 +01:00
Marcin Wielgus 72a47dc2b2 Cluster-autoscaler: update code for 1.6 k8s sync 2017-03-02 14:34:49 +01:00
fate-grand-order 82e148507f fix misspell "being" in drain.go 2017-02-28 18:20:06 +08:00
Yusuke Kuoka baee799524 cluster-autoscaler: Dynamic Reconfiguration via ConfigMaps
Adds a new optional flag named `configmap` to specify the name of a configmap containing node group specs.

The configmap is polled every `scan-interval` seconds to reconfigure cluster-autoscaler dynamically at runtime.

Example usage:

```
./cluster-autoscaler --v=4 --cloud-provider=aws --skip-nodes-with-local-storage=false --logtostderr --leader-elect=false --configmap=cluster-autoscaler --logtostderr
```

The configmap would look like:

```yaml
kind: ConfigMap
apiVersion: v1
metadata:
  name: cluster-autoscaler
  namespace: kube-system
data:
  settings: |-
    {
      "nodeGroups": [
        {
          "minSize": 1,
          "maxSize": 2,
          "name": "kubeawstest-nodepool1-AutoScaleWorker-1VWD4GAVG35L5"
        }
      ]
    }
 ```

Other notes:

* Make namespace defaults to "kube-system"
according to https://github.com/kubernetes/contrib/pull/2226#discussion_r94144267

* Trigger a full-recreate on a configuration change

according to https://github.com/kubernetes/contrib/pull/2226#issuecomment-269617410

* Introduced `autoscaler/` and moved  all the dynamic/recreatable-at-runtime parts of autoscaler into there (Update: the package is now named `core` according to https://github.com/kubernetes/contrib/pull/2226#issuecomment-273071663)

* Extracted the core of CA(=`func Run()` in `main.go`) into `Autoscaler`

* `DynamicAutoscaler` is a wrapper around `Autoscaler` which achieves reconfiguration of CA by recreating an `Autoscaler` instance on a configmap change.

* Moved `scale_down*.go`, `scale_up*.go` and `utils*.go` into the `autoscaler` package accordingly because they seemed to be meant to be collocated in the same package as the core of CA (which is now implemented as `Autoscaler`)

* Moved the `createEventRecorder` func from the `main` package to the `utils/kubernetes` package to make it importable from both `main` and `autoscaler`
2017-02-24 20:36:47 +09:00
Marcin Wielgus 89a370de1a Cluster-autoscaler: expand half-deleted pod skip logic in drain 2017-02-23 16:43:32 +01:00
Marcin Wielgus e3395fdae7 Cluster-autoscaler: skip pods that are being deleted in node drain 2017-02-22 14:09:39 +01:00
Marcin Wielgus ce45c33d29 Cluster-autoscaler: update CA code for godep refresh 2017-01-20 14:46:34 +01:00
Marcin Wielgus b57ab3b48a Cluster-autoscaler: add NodeReadyPredicate and allow unready nodes in CA 2017-01-18 15:09:59 +01:00
Marcin Wielgus 5095b12f27 Cluster-autoscaler: add stop channel to listers 2017-01-05 12:57:14 +01:00
Marcin Wielgus 36cdafad45 Cluster-autoscaler: check if cluster is healthy and add new node lister 2017-01-05 11:54:10 +01:00
Marcin Wielgus 949cf37465 Cluster-autoscaler: support unready nodes in scale down 2017-01-03 14:17:59 +01:00
Marcin Wielgus 4023750b98 Cluster-autoscaler: move ToBeDeleted taint functions to utils 2016-12-30 14:14:37 +01:00
Marcin Wielgus 5b3f67d9e1 Cluster-autoscaler: add self link to BuildTestPod/Node functions 2016-12-23 23:43:56 +01:00
Marcin Wielgus befd959c0e Cluster autoscaler: more unit tests for scale down 2016-12-22 19:48:16 +01:00
Marcin Wielgus d7a9a70bbf Cluster-autoscaler: add stateful set support in drain. 2016-12-21 12:11:32 +01:00
Marcin Wielgus 7b63b6c1f1 Cluster-autoscaler: update code to compile with K8S 1.5 2016-12-13 17:22:57 +01:00
Kubernetes Submit Queue 9f3900f466 Merge pull request https://github.com/kubernetes/contrib/pull/1909 from mwielgus/own_drain
Automatic merge from submit-queue

Cluster-autoscaler: own drain

This PR adds an own drain logic to ClusterAutoscaler. Previously we were using the code from kubectl drain command but:
* due to refactorings it was hard to update the the CA dependencies. 
* we had to add some extra logic on top of it in fast drain evaluation
* a recent feature request to check the number of replicas in rs/rc was impossible to fulfill. 

cc: @fgrzadkowski @davidopp @piosz
2016-10-27 08:31:11 -07:00
Marcin Wielgus df078c9101 Cluster-autoscaler: own drain 2016-10-27 16:58:59 +02:00
Marcin Wielgus 2560c686d5 Cluster-autoscaler: allow unschedulable nodes 2016-10-27 12:45:43 +02:00
Jan Chaloupka e028312170 Remove "All rights reserved" from all the headers 2016-09-08 13:02:39 +02:00
Piotr Szczesniak 2aaf07486c Initial implementation of rescheduler 2016-07-22 13:59:23 +02:00
Piotr Szczesniak 1275f7bfac [CA] Moved listers to util package 2016-07-22 10:36:31 +02:00
Marcin Wielgus 50f57321ff Cluster-autoscaler: use cloud provider interface in the code 2016-07-11 16:40:03 +02:00
Marcin Wielgus 1655d87caa Merge pull request https://github.com/kubernetes/contrib/pull/1282 from mwielgus/mig-node
Cluster-autoscaler: fix for multi-mig autoscaling
2016-06-28 21:15:40 +02:00
Marcin Wielgus 25fd38ccb0 Cluster-autoscaler: fix for multi-mig autoscaling 2016-06-28 21:00:44 +02:00
Piotr Szczesniak df7d010861 Use default token when tokenUrl not specified 2016-06-15 14:28:33 +02:00
Piotr Szczesniak a522004066 Added support for reading GCE token from config file 2016-05-31 12:14:08 +02:00
Piotr Szczesniak bdb8987db6 Implemented unit test for FilterOutSchedulable function 2016-05-24 20:06:29 +02:00