Skip to content

Commit e506646

Browse files
committed
bootkube.sh: Render kernel boot arguments for SNO
In an effort to speed up installation and avoid node reboots this command will run `tuneD` on a properly isolated environment and render a MachineConfig to apply the kernel boot args readed from `/etc/tuned/bootcmdline` Signed-off-by: Jose Luis Ojosnegros Manchón <[email protected]>
1 parent 5fe186c commit e506646

File tree

1 file changed

+39
-0
lines changed

1 file changed

+39
-0
lines changed

data/data/bootstrap/files/usr/local/bin/bootkube.sh.template

Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -340,6 +340,45 @@ then
340340
record_service_stage_success
341341
fi
342342

343+
if [ "$BOOTSTRAP_INPLACE" = true ] && [ ! -f cmdbootline-nto-bootstrap.done ]; then
344+
record_service_stage_start "cmdbootline-nto-bootstrap"
345+
346+
rm --recursive --force cmdbootline-nto-bootstrap
347+
348+
# Create folders for overlay and podman command to use them
349+
tmpfolder=$(mktemp -d)
350+
echo ${tmpfolder}
351+
podmancmd="bootkube_podman_run --attach=stderr --rm "
352+
for folder in var/lib/tuned/profile-data etc/modprobe.d etc/sysconfig etc/kubernetes etc/sysctl.d etc/systemd run sys lib/modules var/lib/kubelet usr/lib/tuned etc/tuned; do
353+
lowerfolder="/${folder}"
354+
if [ ! -d "$lowerfolder" ]; then
355+
echo "Skipping mounting $lowerfolder"
356+
continue
357+
fi
358+
upperfolder="${tmpfolder}/${folder}/upper"
359+
workfolder="${tmpfolder}/${folder}/work"
360+
mkdir -p ${upperfolder}
361+
mkdir -p ${workfolder}
362+
podmancmd="${podmancmd} -v ${lowerfolder}:/${folder}:O,upperdir=${upperfolder},workdir=${workfolder}"
363+
done
364+
365+
podmancmd="${podmancmd} --volume $PWD:/assets:z --env=CLUSTER_NODE_TUNED_BOOTSTRAP_SAFE_ENV=true --name tuned ${NODE_TUNING_OPERATOR_IMAGE}"
366+
podmancmd="${podmancmd} render-bootcmd-mc --asset-input-dir=/assets/manifests --asset-output-dir=/assets/cmdbootline-nto-bootstrap --mcp-name=master"
367+
368+
# execute podmancmd
369+
$podmancmd
370+
371+
#read machineconfig from --asset-ouput-dir
372+
# Copy over manifests if they were generated by NTO
373+
if [ -n "$(ls -A cmdbootline-nto-bootstrap)" ]; then
374+
cp cmdbootline-nto-bootstrap/* manifests/
375+
fi
376+
377+
rm -rf ${tmpfolder}
378+
touch cmdbootline-nto-bootstrap.done
379+
record_service_stage_success
380+
fi
381+
343382
if [ ! -f mco-bootstrap.done ]
344383
then
345384
record_service_stage_start "mco-bootstrap"

0 commit comments

Comments
 (0)