-
Notifications
You must be signed in to change notification settings - Fork 1.4k
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
data/aws/variables-aws: Drop aws_master_ec2_type and similar defaults #1128
data/aws/variables-aws: Drop aws_master_ec2_type and similar defaults #1128
Conversation
ab9fb3f
to
580a34b
Compare
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.
looks good
580a34b
to
4dfa11f
Compare
Obviously I'm missing something, because e2e-aws is giving:
|
@wking The default values are not added to the install config for those fields. |
🤦♂️ ok, so blocked on #792. |
…upport m4 The only instance type available in all AWS regions today is i3. We prefer m4 because of the higher EBS attach limit. But for regions that don't support m4 we use m5. This also adds a CI job which checks the AWS pricing API to keep our region map up 2 date.
The previous implementation pulled from the install-config, but that missed downstream changes like AWS instance type defaults being applied in pkg/asset/machines. With this commit, we pull that information from the cluster-API types, since they're the last touch point for that data. Some remaining information still comes from the InstallConfig, but I've split it into explicit arguments to avoid confusion about where data is coming from when InstallConfig's machine pools, etc. overlap with clusterapi.Machine fields. This commit also splits the platform-specific Terraform variable generation into separate functions generating separate files. I've used *.auto.tfvars filenames because Terraform loads those automatically from the current directory [1]. But that only helps folks who are trying to run our generated Terraform by hand; as described in d19cad5 (destroy/bootstrap: explicit pass `disable-bootstrap.tfvars` for libvirt, 2018-12-13, openshift#900), the installer runs outside the Terraform directory and needs to pass this through to Terraform explicitly. I'd prefer if FileList could be an internal property (.files?), but we currently require public fields for reloading from disk during multiple-invocation creation [2]. The AWS volume defaults are from data/data/aws/variables-aws.tf. We'll be able to drop the Terraform defaults soon [3]. [1]: https://www.terraform.io/docs/configuration/variables.html#variable-files [2]: openshift#792 (comment) [3]: openshift#1128
4dfa11f
to
90e56bf
Compare
Since 9a9cd6d (pkg/tfvars: Respect install-config AWS machine pools, 2019-01-15, openshift#1076) and cbad1a4 (Add size and type support for aws volumes, 2019-01-16, openshift#1079), we should always be providing these in the Terraform variables generated by the asset graph. There's still a default for the bootstrap machine, but we plan on removing that from Terraform shortly. Dropping omitempty for the master IOPS allows the zero value (if IOPS is nil or zero in the machine config) to generate a non-empty Terraform value, avoiding: Error: Required variable not set: aws_master_root_volume_iops" I've left omitempty on the other AWS properties, because in most cases their zero values will not produce a functional cluster and we want to fail fast. In the user-tags case, we have a sane (empty set) default, so omitting the nil map is fine.
90e56bf
to
55a88f3
Compare
/lgtm |
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: staebler, wking 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 |
Since 9a9cd6d (#1076) and cbad1a4 (#1079), we should always be providing these in the Terraform variables generated by the asset graph.