-
Notifications
You must be signed in to change notification settings - Fork 49
Flexible instance types #314
base: master
Are you sure you want to change the base?
Conversation
This adds some validation to the instance types and restricts the master instance types. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@JoshVanL general gist. I think this is what we want. I made some extra comments.
It would also be great if we can document this feature in the docs.
pkg/tarmak/cluster/cluster.go
Outdated
// Verify cluster | ||
func (c *Cluster) Verify() (result error) { | ||
return c.VerifyInstancePools() | ||
if err := c.Environment().Provider().ValidateInstanceTypes(c.InstancePools()); err != nil { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think this needs to become a verify check and not an validate check. This will contact AWS and is a more expensive call. This is to keep working in line with #280
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done
pkg/tarmak/cluster/cluster.go
Outdated
// Verify instance pools | ||
func (c *Cluster) VerifyInstancePools() (result error) { | ||
// Verify cluster | ||
func (c *Cluster) Verify() error { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why remove the VerifyInstancePools?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done
pkg/tarmak/provider/amazon/amazon.go
Outdated
return []string{"io1", "gp2", "st1", "sc1"} | ||
} | ||
|
||
func (a *Amazon) awsInstanceTypes() []string { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think you are missing some newer instance types, is there a way to make this dynamic and check this through an AWS call?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I've had a look and I can't find a straight forward way of achieving this. I've updated this list though
pkg/tarmak/provider/amazon/amazon.go
Outdated
} | ||
|
||
if err := a.verifyInstanceType(instanceType, instance.Zones(), svc); err != nil { | ||
result = multierror.Append(result, err) | ||
} | ||
|
||
if instance.Name() == "master" { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think we also should do a check for vault and etcd. I don't think we should run these on burstable (t) types.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done
f9af401
to
33d4de2
Compare
I tested this and this works great. Currently we set etcd to For etcd I would switch the default to an |
I have bumped up etcd instances to use medium (m4.large) as default at init. I think there should be some consensus though on these sizes and what vault should have / be burstable. |
@JoshVanL I discussed this a bit with @simonswine. We agreed that denying of certain instance types shouldn't happen. |
@MattiasGees yes that can be done easily |
/lgtm |
@JoshVanL I tried bringing up a cluster with smallest instances for etcd and master, but couldn't see any warnings displayed. So I think there is something wrong with the warning logger. |
@MattiasGees |
Works now |
d495954
to
cef7b12
Compare
New changes are detected. LGTM label has been removed. |
/assign @simonswine |
cef7b12
to
0e6576b
Compare
0e6576b
to
48c42e9
Compare
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: If they are not already assigned, you can assign the PR to them by writing The full list of commands accepted by this bot can be found here. The pull request process is described here
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
48c42e9
to
f606621
Compare
Signed-off-by: JoshVanL <[email protected]>
Signed-off-by: JoshVanL <[email protected]>
Signed-off-by: JoshVanL <[email protected]>
Signed-off-by: JoshVanL <[email protected]>
Signed-off-by: JoshVanL <[email protected]>
Signed-off-by: JoshVanL <[email protected]>
Signed-off-by: JoshVanL <[email protected]>
Signed-off-by: JoshVanL <[email protected]>
f606621
to
650ca81
Compare
@JoshVanL: PR needs rebase. 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. |
@JoshVanL: The following test failed, say
Full PR test history. Your PR dashboard. Please help us cut down on flakes by linking to an open issue when you hit one in your PR. 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. I understand the commands that are listed here. |
What this PR does / why we need it:
Although users are already able to chose their own instance types, this validates the supported types and restricts the types available to master
Which issue this PR fixes (optional, in
fixes #<issue number>(, fixes #<issue_number>, ...)
format, will close that issue when PR gets merged): fixes #310