Commit Graph

146 Commits

Author SHA1 Message Date
Marcin Wielgus b0d603e548 Expand test cloud provider with autoprovisioning options 2017-09-05 13:39:59 +02:00
Marcin Wielgus 8c1f356cc9 Merge pull request #287 from alok87/run_in_master_ca_Aws
Run CA in master node - aws
2017-09-05 04:57:48 +05:30
Marcin Wielgus e04e880ee7 Merge pull request #298 from sergeylanzman/patch-1
Move regexp.MustCompile in AWS provider to global variable
2017-09-05 04:10:24 +05:30
Sergey Lanzman 41c7901647 Fix typo GetAvilableMachineTypes() => GetAvailableMachineTypes() 2017-09-04 22:17:17 +03:00
Sergey Lanzman 4bc1f7291b Move regexp.MustCompile in AWS provider to global variable
Function AwsRefFromProviderId call many times. If scale down enable this call default every 10 seconds per each node.
regexp.MustCompile it very heavy function and not need call each time
2017-09-04 20:43:22 +03:00
Clayton Coleman 035e667eb1
Allow use of Default Application Credentials for GCE
Also allows project and zone to be specified by the config file, rather
than automatically overwritten. This allows local testing against the
GCE API without having to run on a GCE instance. The default credentials
take priority over the token source, but less priority than a token
source in the config.

Also, if the node template cannot be located, don't panic, just report
it.
2017-09-02 12:02:26 -04:00
Clayton Coleman 5d23189b38
Return the proper error when failing to init cloud provider 2017-09-02 12:02:19 -04:00
Marcin Wielgus c0b48e4a15 Merge pull request #285 from mwielgus/loglevel
Set verbosity for each of the glog.Info logs
2017-09-01 16:42:11 +05:30
Marcin Wielgus 2d8f59e23d Set verbosity for each of the glog.Info logs 2017-09-01 12:34:29 +02:00
alok87 694f461ae8 Information to run CA in master in aws 2017-09-01 09:30:55 +05:30
Marcin Wielgus f217d4ac93 Do not return error from exist 2017-09-01 00:24:01 +02:00
Marcin Wielgus e9261a249c Merge pull request #284 from mwielgus/nap-5
Node autoprovisioning in scale up
2017-08-31 17:47:25 +05:30
Marcin Wielgus b172926b5e NodeGroupCreate for gce cloud provider 2017-08-31 00:48:40 +02:00
Marcin Wielgus 4a3b2934ea Merge pull request #280 from pusher/name-list-bug
Check ASG name list not empty
2017-08-30 22:56:01 +05:30
Joel Speed f369843353 Check ASG name list not empty 2017-08-30 13:50:17 +01:00
Marcin Wielgus 9a4c15daaa Merge pull request #275 from mwielgus/nap-4
Create and delete node pool operations for gce_manager
2017-08-30 16:55:44 +05:30
Marcin Wielgus f8ede4cefd Lint fixes and debug level adjustment in gce cloud provider 2017-08-30 10:53:29 +02:00
Marcin Wielgus 61386eed7f Create node pool operation for gce manager 2017-08-29 22:35:42 +02:00
Marcin Wielgus bc970fdd94 Node pool delete 2017-08-29 22:14:07 +02:00
Marcin Wielgus f97b1a5b60 Unregister non-existing migs from gce_manager 2017-08-29 20:21:28 +02:00
Marcin Wielgus 36148b02b8 Don't allow node group information in GKE 2017-08-29 19:42:01 +02:00
Marcin Wielgus 6bf7012bf8 Fix basename population in gce manager 2017-08-29 18:31:39 +02:00
Marcin Wielgus 76ebca9d25 Error handling in gce/gke 2017-08-29 14:27:43 +02:00
Marcin Wielgus e93421f43e Proper locking around migs in gce manager 2017-08-29 12:54:11 +02:00
Marcin Wielgus c71fd1b37b Dont duplicate migs in GCE cloud provider, store them only in manager 2017-08-28 21:41:24 +02:00
Marcin Wielgus 51a5ad58c0 GKE NodePool support for NAP - get NP/Migs via api - part 1 2017-08-28 20:50:02 +02:00
Marcin Wielgus 540ef661d8 GCE node templates refactoring 2017-08-26 14:40:11 +02:00
Marcin Wielgus c2f039c7a6 Node autoprovisioning - CP interface impl - part 2 2017-08-25 17:53:53 +02:00
Marcin Wielgus ac2c471eb1 NAP interface implementation - part 1 2017-08-25 11:17:50 +02:00
Beata Skiba 596b165808 Cloud Provider Interface for Kubemark
This allows to run Custer Autoscaler on Kubemark.
See autoscaler/cluster-autoscaler/proposals/kubemark_integration.md
for more details.
2017-08-22 15:19:10 +02:00
Marcin Wielgus 2a3e6b498e Split kubemark cloud provider implementation to linux and non-linux 2017-08-21 11:48:20 +02:00
Marcin Wielgus a766f676ba Node Autoprovisioning expansion of CloudProvider api 2017-08-18 15:34:24 +02:00
Marcin Wielgus 139e21046e Fix kubemark boilerplate 2017-08-18 11:43:53 +02:00
Marcin Wielgus fcbd6e1ef5 Comments on blank imports 2017-08-18 11:32:18 +02:00
Marcin Wielgus cd54849a42 Kubemark placeholder 2017-08-18 00:11:59 +02:00
Marcin Wielgus 6df186aeac Remove Azure support 2017-08-17 22:36:31 +02:00
chenguoyan01 783a7abe53 Set the verbosity level for azureprovider info logs 2017-08-17 10:30:51 +08:00
chenguoyan01 a1c1ea1b93 use glog to replace fmt in azure cloudprovider 2017-08-16 16:59:55 +08:00
Marcin Wielgus 69316cbd26 Merge pull request #213 from mwielgus/godepupdate-11-08-2017
CA godeps update to K8S head at 2017-10-08
2017-08-11 22:23:28 +05:30
Marcin Wielgus 9116e4c08c Compilation fix for CA after godeps update 2017-08-11 17:56:47 +02:00
Ryan Moore 943c5acba7
bump container image version to 0.6.0 2017-08-09 16:03:09 -07:00
Ivan Towlson 902d2414b7 Fixed typoes of name 'Kubernetes' 2017-08-03 14:20:23 +12:00
Seth Pollack e855c7f698
add tests 2017-07-21 08:42:09 -04:00
Seth Pollack c3b86378a2
add taints to AWS node template 2017-07-20 22:07:20 -04:00
Ryan Walls 350ddb2b0c Update readme with permissions for scaling node groups from 0
The code used to scale node groups from 0 requires the `DescribeLaunchConfigurations` permission.
2017-07-13 16:20:13 -06:00
MaciekPytel 2ac2535a48 Merge pull request #169 from aleksandra-malinowska/test-provider-package-name
Rename testprovider package
2017-07-13 12:20:30 +02:00
Aleksandra Malinowska d9eed646f1 add taints to GCE node template 2017-07-11 16:05:30 +02:00
Seth Pollack 314ed88b14
Enable min size 0 in aws 2017-07-10 09:04:18 -04:00
Aleksandra Malinowska c159a90f04 rename test provider package 2017-07-06 16:23:15 +02:00
Marcin Wielgus fc43808149 Godeps bump for CA 2017-07-03 22:05:11 +02:00
Beata Skiba 5f442d6d71 Fix comment in cloud_provider.go 2017-06-29 10:23:26 +02:00
Yusuke Kuoka dfb481b19f cluster-autoscaler: Fix excessive calls to DescribeAutoScalingGroup
By caching AWS refs for nodes/EC2 instances already known to be not in any of ASGs managed by cluster-autoscaler(CA).

Please beware of the edge case - this method is safe as long as users don't attach nodes by calling AttachInstances API after CA cached them. I believe, even if it was necessary, a warning in the documentation about the edge case is enough for now. If we really need to support the case, I will submit an another PR to invalidate the cache periodically so that CA can detect the formerly cached nodes are attached to ASG(s).

Also refactor AwsManager for less complexity by extracting types, accordingly to the discussion made [here](https://github.com/kubernetes/autoscaler/pull/46#discussion_r117912687)
2017-06-22 16:55:15 +09:00
Yusuke Kuoka 3e8cc02243 cluster-autoscaler: Fix node group auto discovery for AWS not to mix up ASGs from different k8s clusters 2017-06-22 15:59:53 +09:00
Johannes Würbach 2ad85f224e AWS: Fixed link to the detailed explanation
https://github.com/kubernetes/contrib/pull/1552#r75532949 seems to explain the reasoning behind multiple ASGs much better then the previous link target.
2017-06-19 14:34:10 +02:00
Marcin Wielgus 1bedee5707 Update GODEPS 2017-06-13 14:48:24 +02:00
Marcin Wielgus 69c77791a2 Fix error types 2017-06-12 21:26:50 +02:00
Marcin Wielgus 2610486772 Merge pull request #84 from ejether/patch-1
Update README.md
2017-05-31 22:44:10 +02:00
Marcin Wielgus 80bf191f02 GCE pricing model 2017-05-26 17:37:32 +02:00
Marcin Wielgus e11fa3df27 Merge pull request #86 from mwielgus/price-1
Pricing model interface for CA
2017-05-26 14:22:37 +02:00
Marcin Wielgus bc86bb2676 Pricing model for CA 2017-05-25 11:01:05 +02:00
ejether a3654a2473 Update README.md
Empirically determined that the policy "autoscaling:DescribeAutoScalingTags" is actually "autoscaling:DescribeTags",
2017-05-24 14:03:42 -07:00
Jason Ansel ef173ab691 Update cluster-autoscaler version number in AWS example deployment 2017-05-23 10:18:08 -07:00
Marcin Wielgus dc7fac0340 Handle custom machine types in GCE cloud provider 2017-05-18 16:13:34 +02:00
Marcin Wielgus b432362a70 Merge pull request #73 from mwielgus/zero-7
Add manifest-run kube-proxy to GCE template node
2017-05-17 11:23:27 +02:00
Marcin Wielgus abb817177b Add manifest-run kube-proxy to GCE template node 2017-05-17 10:20:51 +02:00
Marcin Wielgus bfa105e959 Enable min size 0 in gce 2017-05-16 17:41:58 +02:00
Marcin Wielgus 95f1aa889c Set ready status in gce node template 2017-05-10 13:21:58 +02:00
Marcin Wielgus 4baa1d11aa Merge pull request #51 from mwielgus/zero-1
Build node template in GCE cloud provider
2017-05-10 12:11:19 +02:00
Marcin Wielgus 5eba73453d Build node template in GCE cloud provider 2017-05-10 11:48:23 +02:00
Marcin Wielgus 30cb7a52e5 Merge pull request #11 from mumoshu/node-group-auto-discovery-with-asg-tag
cluster-autoscaler: Re: AWS Autoscaler autodiscover ASG names and sizes
2017-05-10 11:07:58 +02:00
Yusuke Kuoka 5304e9af21 cluster-autoscaler: Fix typos in comments 2017-05-10 11:22:15 +09:00
Yusuke Kuoka e9c7cd0733 cluster-autoscaler: Re: AWS Autoscaler autodiscover ASG names and sizes
This is an alternative implementation of https://github.com/kubernetes/contrib/pull/1982

Notable differences from the original PR are:

* A new flag named `--node-group-auto-discovery` is introduced for opting in to enable the auto-discovery feature.
  * For example, specifying `--cloud-provider aws --node-group-auto-discovery asg:tag=k8s.io/cluster-autoscaler/enabled` instructs CA to auto-discover ASGs tagged with `k8s.io/cluster-autoscaler/enabled` to be used as target node groups
* The new code path introduced by this PR is executed only when `node-group-auto-discovery` is specified. There is relatively less chance to break existing features by introducing this change

Resolves https://github.com/kubernetes/contrib/issues/1956

---

Other notes:

* We rely mainly on the `DescribeTags` API rather than `DescribeAutoScalingGroups` so that AWS can filter out unnecessary ASGs which doesn't belong to the k8s cluster, for us.
  * If we relied on `DescribeAutoScalingGroups` here, as it doesn't support `Filter`ing, we'd need to iterate over ALL the ASGs available in an AWS account, which isn't desirable due to unnecessary excessive API calls and network usages

* Update cloudprovider/aws/README for the new configuration

* Warn abount invalid combination of flags
according to the review comment https://github.com/kubernetes/autoscaler/pull/11#discussion_r113713138

* Emit a validation error when both --nodes and --node-group-auto-discovery are specified
according to the review comment https://github.com/kubernetes/autoscaler/pull/11#discussion_r113958080

TODO/Possible future improvements before recommending this to everyone:

* Cache the result of an auto-discovery for a configurable period, so that we won't invoke DescribeTags and DescribeAutoScalingGroup APIs too many times
2017-05-10 08:36:02 +09:00
Marcin Wielgus e8dd60f858 Add a method to NodeGroup for providing a template NodeInfo 2017-05-09 13:36:37 +02:00
Marcin Wielgus 34eb4973f8 Fix imports in cluster autoscaler after migrating it from contrib 2017-04-18 15:42:04 +02:00
Marcin Wielgus 760477c96c Cluster-autoscaler: update aws doc with --stderrthreshold=info flag 2017-03-29 23:47:20 +02: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
Phil Kates c2cb357e7d Return correct ProviderID format from GetAsgNodes
This matches the way that the [gce does it][1] and fixes issues with the
[cluster state][2].

1: https://github.com/kubernetes/contrib/blob/master/cluster-autoscaler/cloudprovider/gce/gce_manager.go#L247
2: https://github.com/kubernetes/contrib/issues/2228#issuecomment-274896211
2017-02-21 12:06:12 -08:00
Oleg Atamanenko 451a779dfa Add support for Azure in cluster-autoscaler 2017-01-20 12:40:58 -05:00
Marcin Wielgus ce45c33d29 Cluster-autoscaler: update CA code for godep refresh 2017-01-20 14:46:34 +01:00
andrewsykim 81f5d80fae Update AWS docs to include --expander option flag and other common notes and gotchas 2017-01-17 11:22:37 -05:00
Marcin Wielgus cfc1117a17 Cluster-autoscaler: decrease target size function in cloud provider interface 2017-01-16 15:20:45 +01:00
Marcin Wielgus 40abaccd68 Cluster-autoscaler: return node names in format of gce://proj/zone/name from GceProvider 2017-01-12 11:32:48 +01:00
Marcin Wielgus be796d8218 Cluster-autoscaler: add get nodes function to cloud provider interface 2017-01-04 13:23:57 +01:00
Marcin Wielgus befd959c0e Cluster autoscaler: more unit tests for scale down 2016-12-22 19:48:16 +01:00
Marcin Wielgus 364bc5262a Cluster-autoscaler: test cloud provider for unit tests 2016-12-21 11:10:04 +01:00
Marcin Wielgus 7b63b6c1f1 Cluster-autoscaler: update code to compile with K8S 1.5 2016-12-13 17:22:57 +01:00
andrewsykim bc6cac07c0 return nil if node is not in an ASG managed by CA 2016-09-12 13:44:29 -04:00
Arnaldo de Moraes Pereira 05aed31066 Fix cluster autoscaler deployment spec, AWS implementation 2016-09-09 18:34:41 -03:00
Jan Chaloupka e028312170 Remove "All rights reserved" from all the headers 2016-09-08 13:02:39 +02:00
Kubernetes Submit Queue ef570c05f8 Merge pull request https://github.com/kubernetes/contrib/pull/1552 from Wattpad/aws_docs
Automatic merge from submit-queue

AWS Cluster Autoscaler README

under https://github.com/kubernetes/contrib/issues/1311
2016-08-25 03:43:05 -07:00
andrewsykim 8ddc95c693 add README for running CA on AWS 2016-08-23 14:39:09 -04:00
Marcin Wielgus 9de9dc57da Cluster-autoscaler: fix belongs check in gce cloud provider 2016-08-18 10:14:11 +02:00
osxi ebfc2b989f Cluster-autoscaler: cloud provider interface implementation for AWS 2016-08-16 16:37:53 -05:00
Marcin Wielgus 50f57321ff Cluster-autoscaler: use cloud provider interface in the code 2016-07-11 16:40:03 +02:00
Marcin Wielgus 73e38c1738 Cluster-autoscaler: cloud provider interface implementation for GCE 2016-07-07 14:00:48 +02:00
Marcin Wielgus cd7a3f784b Cluster-autoscaler: cloud provider interface 2016-07-05 11:04:09 +02:00