-
Notifications
You must be signed in to change notification settings - Fork 16
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
making day1 solutin configurable via systemd services (#1069)
1) adding environment variables to systemd services and making executable using those variables. This ways the scripts themselves do not change. in addition, it allows manual update of the MC in the cluster, since no parts that are based64-ed are needed to be changed 2) removing a separate pulling service for OCP on-prem. pull service will now wait for network-online and NetworkManager-dispatcher to be completed in every type of OCP cluster
- Loading branch information
1 parent
31afdc4
commit 73fe579
Showing
13 changed files
with
121 additions
and
243 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
#!/bin/bash | ||
|
||
|
||
kernel_module_image_filepath="$KERNEL_MODULE_IMAGE_FILEPATH" | ||
worker_image="$WORKER_IMAGE" | ||
kernel_module_image="$KERNEL_MODULE_IMAGE" | ||
|
||
if [ -e $kernel_module_image_filepath ]; then | ||
echo "File $kernel_module_image_filepath found.Nothing to do, the file was handled, removing it" | ||
rm -f $kernel_module_image_filepath | ||
else | ||
podman pull --authfile /var/lib/kubelet/config.json $worker_image | ||
if [ $? -eq 0 ]; then | ||
echo "Image $worker_image has been successfully pulled" | ||
else | ||
echo "Failed to pull image $worker_image" | ||
exit 1 | ||
fi | ||
|
||
echo "File $kernel_module_image_filepath is not on the filesystem, pulling image " | ||
podman pull --authfile /var/lib/kubelet/config.json $kernel_module_image | ||
if [ $? -eq 0 ]; then | ||
echo "Image $kernel_module_image has been successfully pulled" | ||
else | ||
echo "Failed to pull image $kernel_module_image" | ||
exit 1 | ||
fi | ||
echo "Saving image $kernel_module_image into a file $kernel_module_image_filepath" | ||
podman save -o $kernel_module_image_filepath $kernel_module_image | ||
if [ $? -eq 0 ]; then | ||
echo "Image $kernel_module_image has been successfully save on file $kernel_module_image_filepath, rebooting..." | ||
reboot | ||
else | ||
echo "Failed to save image $kernel_module_image to file $kernel_module_image_filepath" | ||
fi | ||
fi |
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,35 @@ | ||
#!/bin/bash | ||
|
||
kmm_config_file_filepath="$WORKER_CONFIG_FILEPATH" | ||
kernel_module_image_filepath="$KERNEL_MODULE_IMAGE_FILEPATH" | ||
in_tree_module_to_remove="$IN_TREE_MODULE_TO_REMOVE" | ||
kernel_module="$KERNEL_MODULE" | ||
worker_image="$WORKER_IMAGE" | ||
|
||
create_kmm_config() { | ||
# Write YAML content to the file | ||
cat <<EOF > "$kmm_config_file_filepath" | ||
containerImage: $kernel_module_image_filepath | ||
inTreeModuleToRemove: $in_tree_module_to_remove | ||
modprobe: | ||
dirName: /opt | ||
moduleName: $kernel_module | ||
EOF | ||
echo "logging contents of the worker config file:" | ||
cat "$kmm_config_file_filepath" | ||
} | ||
|
||
echo "before checking image tar file presence" | ||
if [ -e $kernel_module_image_filepath ]; then | ||
echo "Image file $kernel_module_image_filepath found on the local file system, creating kmm config file" | ||
create_kmm_config | ||
echo "running kernel-management worker image" | ||
podman run --user=root --privileged -v /lib/modules:/lib/modules -v $kmm_config_file_filepath:/etc/kmm-worker/config.yaml -v $kernel_module_image_filepath:$kernel_module_image_filepath $worker_image kmod load --tarball /etc/kmm-worker/config.yaml | ||
if [ $? -eq 0 ]; then | ||
echo "OOT kernel module $kernel_module is inserted" | ||
else | ||
echo "failed to insert OOT kernel module $kernel_module" | ||
fi | ||
else | ||
echo "Image file $kernel_module_image_filepath is not present in local registry, will try after reboot" | ||
fi |
File renamed without changes.
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 was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.