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

tools: periodically clean up bare-metal servers #933

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

davidweisse
Copy link
Contributor

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.

@davidweisse davidweisse added the no changelog PRs not listed in the release notes label Oct 15, 2024
Comment on lines +11 to +12
declare -a usedRuntimeClasses=()
declare -a unusedRuntimeClasses=()
Copy link
Contributor

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=(
Copy link
Contributor

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.

Comment on lines +48 to +53
# Delete unused binaries
path="${OPTEDGELESS}/${runtimeClass}"
if [ -d "${path}" ]; then
echo "Deleting binaries from ${OPTEDGELESS}/${runtimeClass} ..."
rm -rf "${path}"
fi
Copy link
Contributor

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/.

Comment on lines +163 to +165
busybox
kubectl
dasel
Copy link
Contributor

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?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
no changelog PRs not listed in the release notes
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants