Skip to content

Commit

Permalink
pkg/asset/machines/worker: Default to MachineSets only where we need …
Browse files Browse the repository at this point in the history
…them

And not for additional zones.  This will keep us from consuming more
NAT gateways and associated EIPs than we need, once subsequent work
ties those resources to Machine(Set) consumption.  This means that
pools where replicas is unset or zero will receive no MachineSets, but
creating MachineSets later on is something we want to be easy anyway,
so I don't see a need to require the installer to inject a template
MachineSet into the cluster.

The "In each private subnet" -> "For each private subnet" change is
because the NAT gateways currently live *in* the public subnet, but
their purpose is to handle egress from machines in the private
subnets.
  • Loading branch information
wking committed Mar 28, 2019
1 parent 644f705 commit d21aa5c
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 6 deletions.
10 changes: 5 additions & 5 deletions docs/user/aws/limits.md
Original file line number Diff line number Diff line change
Expand Up @@ -30,20 +30,20 @@ additional clusters and deployed workloads.

## Elastic IP (EIP)

By default, the installer distributes control-plane and compute machines across [all availability zones within a region][availability-zones] to provision the cluster in a highly available configuration.
By default, the installer distributes control-plane and compute machines across [availability zones within a region][availability-zones] to provision the cluster in a highly available configuration.
Please see [this map][az-map] for a current region map with availability zone count.
We recommend selecting regions with 3 or more availability zones.
You can [provide an install-config](../overview.md#multiple-invocations) to [configure](customization.md) the installer to use specific zones to override that default.

The installer creates a public and private subnet for each configured availability zone.
In each private subnet, a separate [NAT Gateway][nat-gateways] is created and requires a separate [EC2-VPC Elastic IP (EIP)][elastic-ip].
The installer creates a public and private subnet for each availability zone that will contain machines.
For each private subnet, a separate [NAT Gateway][nat-gateways] is created and requires a separate [EC2-VPC Elastic IP (EIP)][elastic-ip].
The default limit of 5 is sufficient for a single cluster, unless you have configured your cluster to use more than five zones.
For multiple clusters, a higher limit will likely be required (and will certainly be required to support more than five clusters, even if they are each single-zone clusters).

### Example: Using North Virginia (us-east-1)

North Virginia (us-east-1) has six availablity zones, so a higher limit is required unless you configure your cluster to use fewer zones.
To support the default, all-zone installation, please submit a limit increase for VPC Elastic IPs similar to the following in the support dashboard (to create more than one cluster, a higher limit will be necessary):
North Virginia (us-east-1) has six availablity zones, so you will need to request a higher limit if you configure your cluster to use all of those zones.
You can submit a limit increase for VPC Elastic IPs similar to the following in the support dashboard (to create more than one cluster, a higher limit may be necessary):

![Increase Elastic IP limit in AWS](images/support_increase_elastic_ip.png)

Expand Down
5 changes: 4 additions & 1 deletion pkg/asset/machines/worker.go
Original file line number Diff line number Diff line change
Expand Up @@ -128,12 +128,15 @@ func (w *Worker) Generate(dependencies asset.Parents) error {
mpool.InstanceType = awsDefaultWorkerMachineType(installconfig)
mpool.Set(ic.Platform.AWS.DefaultMachinePlatform)
mpool.Set(pool.Platform.AWS)
if len(mpool.Zones) == 0 {
if pool.Replicas != nil && *pool.Replicas > 0 && len(mpool.Zones) == 0 {
azs, err := aws.AvailabilityZones(ic.Platform.AWS.Region)
if err != nil {
return errors.Wrap(err, "failed to fetch availability zones")
}
mpool.Zones = azs
if int(*pool.Replicas) < len(mpool.Zones) {
mpool.Zones = azs[:*pool.Replicas]
}
}
pool.Platform.AWS = &mpool
sets, err := aws.MachineSets(clusterID.InfraID, ic, &pool, string(*rhcosImage), "worker", "worker-user-data")
Expand Down

0 comments on commit d21aa5c

Please sign in to comment.