-
Notifications
You must be signed in to change notification settings - Fork 1.4k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #1768 from cgwalters/bootkube-before-kubelet
bootkube: Run before kubelet.service, start it during script
- Loading branch information
Showing
7 changed files
with
33 additions
and
17 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
16 changes: 16 additions & 0 deletions
16
data/data/bootstrap/files/usr/local/bin/crio-configure.sh.template
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,16 @@ | ||
#!/usr/bin/env bash | ||
set -euo pipefail | ||
# Before kubelet.service and crio.service start, ensure | ||
# that we're using the pause image from our payload just like the primary cluster. | ||
# The config should match the one generated by the MCO ideally: | ||
# https://github.com/openshift/machine-config-operator/blob/e861ccb12f09c7c768d51fdf0a17879fcc9a87d5/templates/master/01-master-container-runtime/_base/files/crio.yaml | ||
# But for now we're just changing the key bits: image and command. | ||
# Perhaps down the line we change this to run something like: | ||
# podman run machine-config-daemon bootstrap ... (passing the release image and the host rootfs) | ||
|
||
. /usr/local/bin/release-image.sh | ||
|
||
MACHINE_CONFIG_INFRA_IMAGE=$(image_for pod) | ||
|
||
sed --in-place --expression "s,pause_image *=.*,pause_image = \"${MACHINE_CONFIG_INFRA_IMAGE}\"," /etc/crio/crio.conf | ||
sed --in-place --expression 's,pause_command *=.*,pause_command = "/usr/bin/pod",' /etc/crio/crio.conf |
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
9 changes: 9 additions & 0 deletions
9
data/data/bootstrap/systemd/units/crio-configure.service.template
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,9 @@ | ||
[Unit] | ||
Description=Configure CRI-O to use the pause image | ||
After=release-image.service | ||
Requires=release-image.service | ||
|
||
[Service] | ||
Type=oneshot | ||
ExecStart=/usr/local/bin/crio-configure.sh | ||
RemainAfterExit=true |
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