-
Notifications
You must be signed in to change notification settings - Fork 1.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
asset/ignition: add event on bootstrap completion #459
Conversation
From my tests: $ kubectl --kubeconfig=crawford-libvirt/auth/kubeconfig -n kube-system get events bootstrap-complete
LAST SEEN FIRST SEEN COUNT NAME KIND SUBOBJECT TYPE REASON SOURCE MESSAGE
7m 7m 1 bootstrap-complete bootstrap, crawford-libvirt-bootstrap cluster bootstrapping has completed This was way more difficult than it should have been. |
|
||
const ( | ||
// ReportSystemdContents is a service that reports the bootstrap progress | ||
// via a ConfigMap. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
via an Event
/approve |
The content package only contains bootstrap assets. It's more clear that that is the case if that package is under the bootstrap package, rather than being adjacent to it.
Adding a line break before and after the closing and opening grave ticks makes this a little more readable and is the style that the rest of the codebase uses. This does result in an empty line at the top and bottom of the file, which is why this style cannot be applied to the shell scripts.
In order to allow the installer to eventually track the installation progress, this adds a reporting service which inserts an event when the bootstrap process has completed. This event can be used to determine when it is safe to remove the bootstrap node, since it signifies that the bootstrap control plane has pivoted to the scheduled control plane and that all of the OpenShift manifests have been inserted. This no longer enables `tectonic.service` because `progress.service` is enabled and lists both `tectonic.service` and `bootkube.service` as dependencies. systemd will start all three services as a result. In an ideal world, this would make use of sd-notify to signal the completion of prerequisites but this doesn't work for two reasons. First, runc doesn't support passing the extra file descriptor used by sd-notify [1]. Second, systemd doesn't support retrying activations when a dependency has failed [2]. This change makes use of "breadcrumb" files to signal completion as a workaround. In the creation of the event, `date` is invoked and passed a custom format. This was necessary because Golang requires the `T` separator in the time package [3] but GNU's `date` uses a space separator. ISO8601 was also tried, but Golang doesn't seem to parse that correctly either (`date` uses "+0000" to specify timezone but Golang expects "+00:00"). [1]: opencontainers/runc#1807 [2]: systemd/systemd#1312 [3]: golang/go#25937
/retest |
/lgtm |
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: abhinavdahiya, crawford, wking The full list of commands accepted by this bot can be found here. The pull request process is described here
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
In order to allow the installer to eventually track the installation
progress, this adds a reporting service which inserts an event when the
bootstrap process has completed. This event can be used to determine
when it is safe to remove the bootstrap node, since it signifies that
the bootstrap control plane has pivoted to the scheduled control plane
and that all of the OpenShift manifests have been inserted.
This no longer enables
tectonic.service
becauseprogress.service
isenabled and lists both
tectonic.service
andbootkube.service
asdependencies. systemd will start all three services as a result.
In an ideal world, this would make use of sd-notify to signal the
completion of prerequisites but this doesn't work for two reasons.
First, runc doesn't support passing the extra file descriptor used by
sd-notify 1. Second, systemd doesn't support retrying activations when
a dependency has failed 2. This change makes use of "breadcrumb" files
to signal completion as a workaround.
In the creation of the event,
date
is invoked and passed a customformat. This was necessary because Golang requires the
T
separator inthe time package 3 but GNU's
date
uses a space separator. ISO8601was also tried, but Golang doesn't seem to parse that correctly either
(
date
uses "+0000" to specify timezone but Golang expects "+00:00").