forked from openshift/machine-config-operator
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Render osImageURL and implement earlier pivot
Have the MCC take `osImageURL` as provided by the cluster update/release payload and generate a `00-{master,worker}-osimageurl` MC from it, which ensures the MCD will update the node to it. However, we need special handling for the *initial* case where we boot into a target config, but we may be using an old OS image. Change the MCC to write the target osImageURL from the MC it uses for bootstrapping to `/etc/rhcos-initial-pivot-target`. This will then be handled by the `rhcos-initial-pivot.service` systemd unit. Closes: openshift#183
- Loading branch information
Showing
17 changed files
with
326 additions
and
14 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
19 changes: 19 additions & 0 deletions
19
...oller/template/test_data/templates/master/00-master/aws/units/rhcos-initial-pivot.service
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
contents: | | ||
[Unit] | ||
Description=RHCOS initial pivot | ||
# Before we join the cluster | ||
Before=kubelet.service | ||
# But be sure that we've finished Ignition before we reboot | ||
After=ignition-firstboot-complete.service | ||
ConditionPathExists=/etc/rhcos-initial-pivot-target | ||
|
||
[Service] | ||
Type=simple | ||
ExecStart=/usr/bin/sh -c 'pivot --reboot $(cat /etc/rhcos-initial-pivot-target) && rm /etc/rhcos-initial-pivot-target' | ||
Restart=on-failure | ||
RestartSec=30 | ||
|
||
[Install] | ||
WantedBy=multi-user.target | ||
enabled: true | ||
name: rhcos-initial-pivot.service |
19 changes: 19 additions & 0 deletions
19
...r/template/test_data/templates/master/00-master/libvirt/units/rhcos-initial-pivot.service
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
contents: | | ||
[Unit] | ||
Description=RHCOS initial pivot | ||
# Before we join the cluster | ||
Before=kubelet.service | ||
# But be sure that we've finished Ignition before we reboot | ||
After=ignition-firstboot-complete.service | ||
ConditionPathExists=/etc/rhcos-initial-pivot-target | ||
|
||
[Service] | ||
Type=simple | ||
ExecStart=/usr/bin/sh -c 'pivot --reboot $(cat /etc/rhcos-initial-pivot-target) && rm /etc/rhcos-initial-pivot-target' | ||
Restart=on-failure | ||
RestartSec=30 | ||
|
||
[Install] | ||
WantedBy=multi-user.target | ||
enabled: true | ||
name: rhcos-initial-pivot.service |
19 changes: 19 additions & 0 deletions
19
...ller/template/test_data/templates/master/00-master/none/units/rhcos-initial-pivot.service
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
contents: | | ||
[Unit] | ||
Description=RHCOS initial pivot | ||
# Before we join the cluster | ||
Before=kubelet.service | ||
# But be sure that we've finished Ignition before we reboot | ||
After=ignition-firstboot-complete.service | ||
ConditionPathExists=/etc/rhcos-initial-pivot-target | ||
|
||
[Service] | ||
Type=simple | ||
ExecStart=/usr/bin/sh -c 'pivot --reboot $(cat /etc/rhcos-initial-pivot-target) && rm /etc/rhcos-initial-pivot-target' | ||
Restart=on-failure | ||
RestartSec=30 | ||
|
||
[Install] | ||
WantedBy=multi-user.target | ||
enabled: true | ||
name: rhcos-initial-pivot.service |
19 changes: 19 additions & 0 deletions
19
...template/test_data/templates/master/00-master/openstack/units/rhcos-initial-pivot.service
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
contents: | | ||
[Unit] | ||
Description=RHCOS initial pivot | ||
# Before we join the cluster | ||
Before=kubelet.service | ||
# But be sure that we've finished Ignition before we reboot | ||
After=ignition-firstboot-complete.service | ||
ConditionPathExists=/etc/rhcos-initial-pivot-target | ||
|
||
[Service] | ||
Type=simple | ||
ExecStart=/usr/bin/sh -c 'pivot --reboot $(cat /etc/rhcos-initial-pivot-target) && rm /etc/rhcos-initial-pivot-target' | ||
Restart=on-failure | ||
RestartSec=30 | ||
|
||
[Install] | ||
WantedBy=multi-user.target | ||
enabled: true | ||
name: rhcos-initial-pivot.service |
19 changes: 19 additions & 0 deletions
19
...oller/template/test_data/templates/worker/00-worker/aws/units/rhcos-initial-pivot.service
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
contents: | | ||
[Unit] | ||
Description=RHCOS initial pivot | ||
# Before we join the cluster | ||
Before=kubelet.service | ||
# But be sure that we've finished Ignition before we reboot | ||
After=ignition-firstboot-complete.service | ||
ConditionPathExists=/etc/rhcos-initial-pivot-target | ||
|
||
[Service] | ||
Type=simple | ||
ExecStart=/usr/bin/sh -c 'pivot --reboot $(cat /etc/rhcos-initial-pivot-target) && rm /etc/rhcos-initial-pivot-target' | ||
Restart=on-failure | ||
RestartSec=30 | ||
|
||
[Install] | ||
WantedBy=multi-user.target | ||
enabled: true | ||
name: rhcos-initial-pivot.service |
19 changes: 19 additions & 0 deletions
19
...r/template/test_data/templates/worker/00-worker/libvirt/units/rhcos-initial-pivot.service
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
contents: | | ||
[Unit] | ||
Description=RHCOS initial pivot | ||
# Before we join the cluster | ||
Before=kubelet.service | ||
# But be sure that we've finished Ignition before we reboot | ||
After=ignition-firstboot-complete.service | ||
ConditionPathExists=/etc/rhcos-initial-pivot-target | ||
|
||
[Service] | ||
Type=simple | ||
ExecStart=/usr/bin/sh -c 'pivot --reboot $(cat /etc/rhcos-initial-pivot-target) && rm /etc/rhcos-initial-pivot-target' | ||
Restart=on-failure | ||
RestartSec=30 | ||
|
||
[Install] | ||
WantedBy=multi-user.target | ||
enabled: true | ||
name: rhcos-initial-pivot.service |
19 changes: 19 additions & 0 deletions
19
...ller/template/test_data/templates/worker/00-worker/none/units/rhcos-initial-pivot.service
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
contents: | | ||
[Unit] | ||
Description=RHCOS initial pivot | ||
# Before we join the cluster | ||
Before=kubelet.service | ||
# But be sure that we've finished Ignition before we reboot | ||
After=ignition-firstboot-complete.service | ||
ConditionPathExists=/etc/rhcos-initial-pivot-target | ||
|
||
[Service] | ||
Type=simple | ||
ExecStart=/usr/bin/sh -c 'pivot --reboot $(cat /etc/rhcos-initial-pivot-target) && rm /etc/rhcos-initial-pivot-target' | ||
Restart=on-failure | ||
RestartSec=30 | ||
|
||
[Install] | ||
WantedBy=multi-user.target | ||
enabled: true | ||
name: rhcos-initial-pivot.service |
19 changes: 19 additions & 0 deletions
19
...template/test_data/templates/worker/00-worker/openstack/units/rhcos-initial-pivot.service
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
contents: | | ||
[Unit] | ||
Description=RHCOS initial pivot | ||
# Before we join the cluster | ||
Before=kubelet.service | ||
# But be sure that we've finished Ignition before we reboot | ||
After=ignition-firstboot-complete.service | ||
ConditionPathExists=/etc/rhcos-initial-pivot-target | ||
|
||
[Service] | ||
Type=simple | ||
ExecStart=/usr/bin/sh -c 'pivot --reboot $(cat /etc/rhcos-initial-pivot-target) && rm /etc/rhcos-initial-pivot-target' | ||
Restart=on-failure | ||
RestartSec=30 | ||
|
||
[Install] | ||
WantedBy=multi-user.target | ||
enabled: true | ||
name: rhcos-initial-pivot.service |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
19 changes: 19 additions & 0 deletions
19
templates/master/00-master/_base/units/rhcos-initial-pivot.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
name: "rhcos-initial-pivot.service" | ||
enabled: true | ||
contents: | | ||
[Unit] | ||
Description=RHCOS initial pivot | ||
# Before we join the cluster | ||
Before=kubelet.service | ||
# But be sure that we've finished Ignition before we reboot | ||
After=ignition-firstboot-complete.service | ||
ConditionPathExists=/etc/rhcos-initial-pivot-target | ||
[Service] | ||
Type=simple | ||
ExecStart=/usr/bin/sh -c 'pivot --reboot $(cat /etc/rhcos-initial-pivot-target) && rm /etc/rhcos-initial-pivot-target' | ||
Restart=on-failure | ||
RestartSec=30 | ||
[Install] | ||
WantedBy=multi-user.target |
19 changes: 19 additions & 0 deletions
19
templates/worker/00-worker/_base/units/rhcos-initial-pivot.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
name: "rhcos-initial-pivot.service" | ||
enabled: true | ||
contents: | | ||
[Unit] | ||
Description=RHCOS initial pivot | ||
# Before we join the cluster | ||
Before=kubelet.service | ||
# But be sure that we've finished Ignition before we reboot | ||
After=ignition-firstboot-complete.service | ||
ConditionPathExists=/etc/rhcos-initial-pivot-target | ||
[Service] | ||
Type=simple | ||
ExecStart=/usr/bin/sh -c 'pivot --reboot $(cat /etc/rhcos-initial-pivot-target) && rm /etc/rhcos-initial-pivot-target' | ||
Restart=on-failure | ||
RestartSec=30 | ||
[Install] | ||
WantedBy=multi-user.target |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.