Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cluster-Autoscaler should query AWS meta-data to determine AWS_REGION if not set #1208

Closed
frittentheke opened this issue Sep 4, 2018 · 7 comments
Labels
area/cluster-autoscaler area/provider/aws Issues or PRs related to aws provider help wanted Denotes an issue that needs help from a contributor. Must meet "help wanted" guidelines. kind/feature Categorizes issue or PR as related to a new feature. lifecycle/stale Denotes an issue or PR has remained open with no activity and has become stale.

Comments

@frittentheke
Copy link

Currently, the cluster-autoscaler requires the AWS_REGION variable to be defined. Surely this can be done statically in the YAML or via some init container calling the meta-data service from AWS or even by using the downwardAPI at some point in the future (kubernetes/kubernetes#40610).

But with auto-discovery of the node ASG by tags and the whole scaling up and down depending on access to the AWS API anyways, why not use the ec2metadata (https://docs.aws.amazon.com/sdk-for-go/api/aws/ec2metadata/) to determine in which region we are running? Sure it should be possible to still configure this variable statically, but I believe this is then one less thing to configure when starting with cluster-autoscaling on AWS and allows the configuration to be even simpler, no matter in what region the Kubernetes Cluster lives ...

@aleksandra-malinowska aleksandra-malinowska added help wanted Denotes an issue that needs help from a contributor. Must meet "help wanted" guidelines. area/cluster-autoscaler area/provider/aws Issues or PRs related to aws provider kind/feature Categorizes issue or PR as related to a new feature. labels Sep 4, 2018
@aleksandra-malinowska
Copy link
Contributor

This sounds similar to how it works on GCP. Would you be interested in contributing this?

shatil added a commit to shatil/autoscaler that referenced this issue Sep 29, 2018
Tackles kubernetes#1208. EC2 Metadata helpfully supplies AWS
Region info, so rather than _requiring_ an environment variable, this
patch enables `aws_manager.go` to retrieve that information from EC2
itself.

Example YAMLs no longer reference the vestigial `AWS_REGION` environment
variable, but supplying it to `cluster-autoscaler` still relays it to
the AWS SDK like before.
shatil added a commit to shatil/autoscaler that referenced this issue Sep 29, 2018
Tackles kubernetes#1208. EC2 Metadata helpfully supplies AWS
Region info, so rather than _requiring_ an environment variable, this
patch enables `aws_manager.go` to retrieve that information from EC2
itself.

Example YAMLs no longer reference the vestigial `AWS_REGION` environment
variable, but supplying it to `cluster-autoscaler` still relays it to
the AWS SDK like before.
@zacharya
Copy link

It looks like this already exists, no? https://github.com/kubernetes/autoscaler/blob/master/cluster-autoscaler/cloudprovider/aws/aws_manager.go#L70

I'm happy to contribute if you can confirm the need still exists and I'm missing something.

@shatil
Copy link
Contributor

shatil commented Oct 13, 2018

@zacharya this was done in PR #1288.

@fejta-bot
Copy link

Issues go stale after 90d of inactivity.
Mark the issue as fresh with /remove-lifecycle stale.
Stale issues rot after an additional 30d of inactivity and eventually close.

If this issue is safe to close now please do so with /close.

Send feedback to sig-testing, kubernetes/test-infra and/or fejta.
/lifecycle stale

@k8s-ci-robot k8s-ci-robot added the lifecycle/stale Denotes an issue or PR has remained open with no activity and has become stale. label Jan 11, 2019
@Jeffwan
Copy link
Contributor

Jeffwan commented Feb 4, 2019

This has been supported in v1.3.x and later released. Should be safe to close.

@Jeffwan
Copy link
Contributor

Jeffwan commented Feb 4, 2019

/close

@k8s-ci-robot
Copy link
Contributor

@Jeffwan: Closing this issue.

In response to this:

/close

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository.

Jeffwan pushed a commit to Jeffwan/autoscaler that referenced this issue Feb 12, 2019
Tackles kubernetes#1208. EC2 Metadata helpfully supplies AWS
Region info, so rather than _requiring_ an environment variable, this
patch enables `aws_manager.go` to retrieve that information from EC2
itself.

Example YAMLs no longer reference the vestigial `AWS_REGION` environment
variable, but supplying it to `cluster-autoscaler` still relays it to
the AWS SDK like before.
Jeffwan pushed a commit to Jeffwan/autoscaler that referenced this issue Feb 12, 2019
Tackles kubernetes#1208. EC2 Metadata helpfully supplies AWS
Region info, so rather than _requiring_ an environment variable, this
patch enables `aws_manager.go` to retrieve that information from EC2
itself.

Example YAMLs no longer reference the vestigial `AWS_REGION` environment
variable, but supplying it to `cluster-autoscaler` still relays it to
the AWS SDK like before.
Jeffwan pushed a commit to Jeffwan/autoscaler that referenced this issue Feb 12, 2019
Tackles kubernetes#1208. EC2 Metadata helpfully supplies AWS
Region info, so rather than _requiring_ an environment variable, this
patch enables `aws_manager.go` to retrieve that information from EC2
itself.

Example YAMLs no longer reference the vestigial `AWS_REGION` environment
variable, but supplying it to `cluster-autoscaler` still relays it to
the AWS SDK like before.
Jeffwan pushed a commit to Jeffwan/autoscaler that referenced this issue Feb 12, 2019
Tackles kubernetes#1208. EC2 Metadata helpfully supplies AWS
Region info, so rather than _requiring_ an environment variable, this
patch enables `aws_manager.go` to retrieve that information from EC2
itself.

Example YAMLs no longer reference the vestigial `AWS_REGION` environment
variable, but supplying it to `cluster-autoscaler` still relays it to
the AWS SDK like before.
Jeffwan pushed a commit to Jeffwan/autoscaler that referenced this issue Feb 12, 2019
Tackles kubernetes#1208. EC2 Metadata helpfully supplies AWS
Region info, so rather than _requiring_ an environment variable, this
patch enables `aws_manager.go` to retrieve that information from EC2
itself.

Example YAMLs no longer reference the vestigial `AWS_REGION` environment
variable, but supplying it to `cluster-autoscaler` still relays it to
the AWS SDK like before.
yaroslava-serdiuk pushed a commit to yaroslava-serdiuk/autoscaler that referenced this issue Feb 22, 2024
Signed-off-by: Yuki Iwai <yuki.iwai.tz@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/cluster-autoscaler area/provider/aws Issues or PRs related to aws provider help wanted Denotes an issue that needs help from a contributor. Must meet "help wanted" guidelines. kind/feature Categorizes issue or PR as related to a new feature. lifecycle/stale Denotes an issue or PR has remained open with no activity and has become stale.
Projects
None yet
Development

No branches or pull requests

7 participants