Skip to content

Commit

Permalink
Have the MCO manage the worker ignition stub config on baremetal
Browse files Browse the repository at this point in the history
On the baremetal platform, worker MachineSets on newly-installed
clusters will automatically use the latest version of CoreOS to
provision, as described in
https://github.com/openshift/enhancements/blob/master/enhancements/baremetal/coreos-image-in-release.md

To ensure that the MachineConfig Ignition stub always uses a compatible
version of the Ignition format, point these MachineSets at the Secret
managed by the MCO (worker-user-data-managed), which is created since
openshift/machine-config-operator#2827. Since a
non-managed version of the Secret is not required on this platform,
install the worker-user-data-managed Secret initially rather than the
previous worker-user-data Secret.

Other platforms will continue to install worker-user-data Secrets,
which are preserved as they were at cluster creation time, because they
are referenced by MachineSets that have fixed CoreOS images. When these
MachineSets are updated to always use the latest CoreOS images, they
should also be updated to point to the managed user data.

This is the part of the installer changes for the enhancement:
https://github.com/openshift/enhancements/blob/master/enhancements/machine-config/user-data-secret-managed.md

A previous version of this patch (but for all platforms) was previously
committed as 8d278d2, but later
reverted by 3920ae4.
  • Loading branch information
zaneb authored and AnnaZivkovic committed Apr 1, 2022
1 parent 23359cd commit cd1e3c9
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions pkg/asset/machines/worker.go
Original file line number Diff line number Diff line change
Expand Up @@ -383,6 +383,10 @@ func (w *Worker) Generate(dependencies asset.Parents) error {
mpool.Set(ic.Platform.BareMetal.DefaultMachinePlatform)
mpool.Set(pool.Platform.BareMetal)
pool.Platform.BareMetal = &mpool

// Use managed user data secret, since images used by MachineSet
// are always up to date
workerUserDataSecretName = "worker-user-data-managed"
sets, err := baremetal.MachineSets(clusterID.InfraID, ic, &pool, "", "worker", workerUserDataSecretName)
if err != nil {
return errors.Wrap(err, "failed to create worker machine objects")
Expand Down

0 comments on commit cd1e3c9

Please sign in to comment.