synchronization

This commit is contained in:
2025-08-25 16:04:00 +08:00
commit 33f9b3ce46
1951 changed files with 854396 additions and 0 deletions

View File

@@ -0,0 +1,31 @@
#!/usr/bin/env bash
set -e -x
backup_dir="/etc/kubernetes/manifests-backup"
public::common::log() {
echo $(date +"[%Y%m%d %H:%M:%S]: ") $1
}
public::evict::gpu-device-plugin() {
dir=/etc/kubernetes/manifests/
if [ -f /etc/kubernetes/manifests/nvidia-device-plugin.yml ]; then
backup_dir="/etc/kubernetes/manifests-backup/"
mkdir -p $backup_dir
mv /etc/kubernetes/manifests/nvidia-device-plugin.yml $backup_dir
else
public::common::log "Skip removing nvidia-device-plugin.yml, because it doesn't exist."
fi
}
main() {
public::evict::gpu-device-plugin
touch /ready
while sleep 3600; do :; done
}
main "$@"

View File

@@ -0,0 +1,11 @@
#!/usr/bin/env bash
set -xe
if [ -d "/k8s-host" ]; then
rm -rf /k8s-host/usr/local/dp-evict
mkdir -p /k8s-host/usr/local/dp-evict
cp -r /dp-evict/* /k8s-host/usr/local/dp-evict
chmod -R +x /k8s-host/usr/local/dp-evict
chroot /k8s-host /usr/local/dp-evict/dp-evict-on-host.sh "$@"
while sleep 3600; do :; done
fi