-
Notifications
You must be signed in to change notification settings - Fork 7
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
tools: periodically clean up bare-metal servers #933
base: main
Are you sure you want to change the base?
Conversation
declare -a usedRuntimeClasses=() | ||
declare -a unusedRuntimeClasses=() |
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.
I find the logic in this script hard to follow. Have you considered just filling a temp file with runtimeclasses in use, and using comm(1)
to do the set difference?
declare -a usedRuntimeClasses=() | ||
declare -a unusedRuntimeClasses=() | ||
|
||
resourcesToCheck=( |
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.
If we checked for an existing node installer, we could tell whether a runtime is just about to be installed.
# Delete unused binaries | ||
path="${OPTEDGELESS}/${runtimeClass}" | ||
if [ -d "${path}" ]; then | ||
echo "Deleting binaries from ${OPTEDGELESS}/${runtimeClass} ..." | ||
rm -rf "${path}" | ||
fi |
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.
We also store data in /var/lib/nydus-snapshotter/
.
busybox | ||
kubectl | ||
dasel |
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.
Do we need this here or is it enough to specify this in writeShellApplication
?
This adds a cronjob to clean up the runtime classes on the bare-metal servers. All unused runtime classes get deleted and the containerd config is updated, and the corresponding folder in
/opt/edgeless
gets deleted as well.