Skip to content
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

Avoid second run of bootstrap script for flatcar with cloud-init #365

Merged
merged 1 commit into from
Feb 27, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 10 additions & 0 deletions deploy/osps/default/osp-flatcar-cloud-init.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -201,6 +201,12 @@ spec:
#!/bin/bash
set -xeuo pipefail

# Check if bootstrap phase has already completed. This is required when we run `cloud-init init` again since it tries to re-run
# the bootstrap cloud-config as well, from the userdata.
if [ -f /etc/bootstrap-complete ]; then
exit 0
fi

{{- /* Configure proxy as the first step to ensure that all the phases of provisioning respect the proxy environment. */}}
{{- template "configureProxyScript" }}

Expand Down Expand Up @@ -262,6 +268,10 @@ spec:

systemctl enable --now kubelet
systemctl enable --now --no-block kubelet-healthcheck.service

# Bootstrap phase for the machine is complete.
touch /etc/bootstrap-complete

systemctl disable setup.service

- path: /opt/bin/health-monitor.sh
Expand Down