Uploaded image for project: 'OpenShift Hive'
  1. OpenShift Hive
  2. HIVE-2227

Creating an AWS MachinePool with subnets but no zones is invalid

XMLWordPrintable

    • Icon: Story Story
    • Resolution: Unresolved
    • Icon: Undefined Undefined
    • None
    • None
    • None
    • False
    • None
    • False

      Discussed/discovered via https://github.com/openshift/hive/pull/1984

      If you don't specify any subnets, hive (actually the installer code) generates a MachineSet per zone. If zones are not specified in this scenario, it defaults to "all of them", but you can enumerate zones and you get the matching private subnet for each. However, if you omit zones but specify subnets – even all of them – it bounces.

      Hive's implementation wants len(zones) == len(subnets) so Hive could block creation (via validating webhook) of MachinePools which specify subnets but do not specify zones, requiring that both be specified. Alternatively, if so desired, change the implementation to infer zones from the provided subnet IDs.

      See: https://github.com/openshift/hive/blob/6765d3a878fab7ef2f90cc25aa8171f80bbada04/pkg/controller/machinepool/awsactuator.go#L158-L167 where ALL zones are fetched when no zones are set. If a number of subnets are provided which do not align with the zone count of ALL zones, then we bounce.

      Also consider adding a check for duplicate zones, per https://issues.redhat.com/browse/HIVE-2196?focusedId=22332231&page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#comment-22332231

            leah_leshchinsky Leah Leshchinsky
            abutcher@redhat.com Andrew Butcher
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

              Created:
              Updated: