1
0
mirror of https://github.com/openshift/installer.git synced 2026-02-05 15:47:14 +01:00

docs/user/aws/install_upi: Add 'sed' call to zero compute replicas

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
This commit is contained in:
W. Trevor King
2019-05-02 09:57:35 -07:00
parent c8951d9995
commit c22d042fe1

View File

@@ -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