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

Query for available instance types #2837

Merged

Conversation

justinsb
Copy link
Member

@justinsb justinsb commented Jun 30, 2017

Allow the cloud to determine the instance type, and on AWS we query the available instance types via the reserved instance API.


This change is Reviewable

@k8s-ci-robot k8s-ci-robot added the cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. label Jun 30, 2017
@justinsb justinsb force-pushed the query_for_available_instance_types branch from e045500 to 2667787 Compare June 30, 2017 14:57
@chrislovecnm
Copy link
Contributor

Related to #2811

Copy link
Contributor

@chrislovecnm chrislovecnm left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just some nit picks for you. This is awesome


switch ig.Spec.Role {
case kops.InstanceGroupRoleMaster:
// Some regions do not (currently) support the m3 family; the c4 large is the cheapest non-burstable instance
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

c4-large is not always the cheapest instance btw. Usually, but sometimes m4.large.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Right, but we can't change now.

Copy link
Member

@geojaz geojaz Jul 4, 2017

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why can we change now... ? If we really can't change now- maybe we start by throwing an errata in the logs that lets people know that we are phasing %s instance out in x version. (and in the changelog for 1.7)

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah, I guess we can change with adequate notification/warnings, learning from the root volume size change. But: we might want to see how many people that affects negatively, and I don't want to lump that in with this change.

// Also some accounts are no longer supporting m3 in us-east-1 zones
candidates = []string{"m3.medium", "c4.large"}

// TODO: We used to have logic like the following...
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we remove this and get it into an issue?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good call

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

if zones.IsSuperset(igZones) {
return instanceType, nil
} else {
glog.V(2).Infof("can't use instance type %q, available in zones %v but need %v", instanceType, zones, igZones)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

can't use instance type %q, available in zones %v but need %v

so is this cannot use it or it is not in the az?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is not in the AZ


response, err := c.ec2.DescribeReservedInstancesOfferings(request)
if err != nil {
return zones, fmt.Errorf("error checking if instance type %q is supported in region %q: %v", instanceType, c.region, err)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should we tell them what we recommend?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm not sure what we recommend in this case?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

return a list of what is available? Not a big deal, and not for this PR. Just a thought

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ah - this is an actual error querying, but I take the point.

Let's see what happens in the real world here... whether we need special cases here also.

@justinsb justinsb force-pushed the query_for_available_instance_types branch from 2667787 to ef99e61 Compare June 30, 2017 19:38
@chrislovecnm
Copy link
Contributor

Related #2683 (comment)

@chrislovecnm
Copy link
Contributor

Related #2771

@chrislovecnm
Copy link
Contributor

Related #157

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
cncf-cla: yes Indicates the PR's author has signed the CNCF CLA.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants