From f37aec6c57f2d3f47e6142da33a6cd2b8fa854c2 Mon Sep 17 00:00:00 2001 From: Itamar Holder Date: Wed, 15 Mar 2023 13:31:08 +0200 Subject: [PATCH] Add LIMITED_SWAP env var to enable limited swap Signed-off-by: Itamar Holder --- hack/local-up-cluster.sh | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/hack/local-up-cluster.sh b/hack/local-up-cluster.sh index 62117a9e8d6..e6195d73383 100755 --- a/hack/local-up-cluster.sh +++ b/hack/local-up-cluster.sh @@ -47,6 +47,8 @@ CGROUP_DRIVER=${CGROUP_DRIVER:-""} CGROUP_ROOT=${CGROUP_ROOT:-""} # owner of client certs, default to current user if not specified USER=${USER:-$(whoami)} +# if true, limited swap is being used instead of unlimited swap (default) +LIMITED_SWAP=${LIMITED_SWAP:-""} # required for cni installation CNI_CONFIG_DIR=${CNI_CONFIG_DIR:-/etc/cni/net.d} @@ -832,6 +834,13 @@ tracing: EOF fi + if [[ "$LIMITED_SWAP" == "true" ]]; then + cat <> "${TMP_DIR}"/kubelet.yaml +memorySwap: + swapBehavior: LimitedSwap +EOF + fi + { # authentication echo "authentication:"