Skip to content

Commit

Permalink
docs/user/aws/install_upi: Add 'sed' call to zero compute replicas
Browse files Browse the repository at this point in the history
This isn't strictly required, because we're removing the resulting
MachineSets right afterwards.  It's setting the stage for a future
where 'replicas: 0' means "no MachineSets" instead of "we'll make you
some dummy MachineSets".  And we can always remove the sed later if
that future ends up not happening.

The sed is based on [1], to replace 'replicas' only for the compute
pool (and not the control-plane pool).  While it should be
POSIX-compliant (and not specific to GNU sed or other
implementations), it is a bit finicky for a few reasons:

* The range matching will not detect matches in the first line, but
  'replicas' will always follow its parent 'compute', so we don't have
  to worry about first-line matches.

* 'compute' sorts before 'controlPlane', so we don't have to worry
  about their 'replicas: ' coming first.

* 'baseDomain' is the only other property that sorts before 'compute',
  but 'replicas: ' is not a legal substring for its domain-name value,
  so we don't have to worry about accidentally matching that.

* While all of the above mean we're safe for now, this approach could
  break down if we add additional properties in the future that sort
  before 'compute' but do allow 'replicas: ' as a valid substring.

[1]: https://stackoverflow.com/a/33416489
  • Loading branch information
wking committed May 2, 2019
1 parent c8951d9 commit c22d042
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions docs/user/aws/install_upi.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,12 @@ $ openshift-install create install-config
? Pull Secret [? for help]
```

Edit the resulting `openshift-install.yaml` to set `replicas` to 0 for the `compute` pool:

```console
$ sed -i '1,/replicas: / s/replicas: .*/replicas: 0/' install-config.yaml
```

Create manifests to get access to the control-plane Machines and compute MachineSets:

```console
Expand Down

0 comments on commit c22d042

Please sign in to comment.