From e44d0f7fddea43250929c45cad68a57fe92eaeb3 Mon Sep 17 00:00:00 2001 From: Roman Gorshunov Date: Thu, 17 Jan 2019 14:29:32 +0100 Subject: [PATCH] Verify VM disk size and relax kubelet disk reqs Stop running airship-in-a-bottle.sh if minimum disk size requirements are not met. Relax kubelet's default disk thresholds. Change-Id: Id4cd251c585233b1b8e741b8c4f56a77ffd4e0c0 --- deployment_files/global/v1.0demo/software/config/Kubelet.yaml | 4 +++- deployment_files/global/v1.0dev/software/config/Kubelet.yaml | 2 ++ manifests/dev_single_node/airship-in-a-bottle.sh | 4 +++- 3 files changed, 8 insertions(+), 2 deletions(-) diff --git a/deployment_files/global/v1.0demo/software/config/Kubelet.yaml b/deployment_files/global/v1.0demo/software/config/Kubelet.yaml index 67612eb2..8c644c18 100644 --- a/deployment_files/global/v1.0demo/software/config/Kubelet.yaml +++ b/deployment_files/global/v1.0demo/software/config/Kubelet.yaml @@ -26,8 +26,10 @@ data: - --cni-bin-dir=/opt/cni/bin - --cni-conf-dir=/etc/cni/net.d - --eviction-max-pod-grace-period=-1 + - --eviction-hard="nodefs.available<1Gi,imagefs.available<1Gi" + - --eviction-minimum-reclaim="nodefs.available=1Gi,imagefs.available=1Gi" - --network-plugin=cni - --node-status-update-frequency=5s + - --seccomp-profile-root=SECCOMP_PROFILE_ROOT - --serialize-image-pulls=false - --v=5 - - --seccomp-profile-root=SECCOMP_PROFILE_ROOT diff --git a/deployment_files/global/v1.0dev/software/config/Kubelet.yaml b/deployment_files/global/v1.0dev/software/config/Kubelet.yaml index 89aac09c..b85654d5 100644 --- a/deployment_files/global/v1.0dev/software/config/Kubelet.yaml +++ b/deployment_files/global/v1.0dev/software/config/Kubelet.yaml @@ -19,6 +19,8 @@ data: - --cni-bin-dir=/opt/cni/bin - --cni-conf-dir=/etc/cni/net.d - --eviction-max-pod-grace-period=-1 + - --eviction-hard="nodefs.available<1Gi,imagefs.available<1Gi" + - --eviction-minimum-reclaim="nodefs.available=1Gi,imagefs.available=1Gi" - --network-plugin=cni - --node-status-update-frequency=5s - --serialize-image-pulls=false diff --git a/manifests/dev_single_node/airship-in-a-bottle.sh b/manifests/dev_single_node/airship-in-a-bottle.sh index 83198633..fa2504fb 100755 --- a/manifests/dev_single_node/airship-in-a-bottle.sh +++ b/manifests/dev_single_node/airship-in-a-bottle.sh @@ -66,8 +66,10 @@ echo "" echo "The minimum recommended size of the Ubuntu 16.04 VM is 4 vCPUs, 20GB of RAM with 32GB disk space." CPU_COUNT=$(grep -c processor /proc/cpuinfo) RAM_TOTAL=$(awk '/MemTotal/ {print $2}' /proc/meminfo) +# Blindly assume that all storage on this VM is under root FS +DISK_SIZE=$(df --output=source,size / | awk '/dev/ {print $2}') source /etc/os-release -if [[ $CPU_COUNT -lt 4 || $RAM_TOTAL -lt 20000000 || $NAME != "Ubuntu" || $VERSION_ID != "16.04" ]]; then +if [[ $CPU_COUNT -lt 4 || $RAM_TOTAL -lt 20000000 || $DISK_SIZE -lt 30000000 || $NAME != "Ubuntu" || $VERSION_ID != "16.04" ]]; then echo "Error: minimum VM recommendations are not met. Exiting." exit 1 fi