From 17c3b1ff568ff7603f8f3fb59918b6d1c1c0ad6e Mon Sep 17 00:00:00 2001 From: Derek Carr Date: Mon, 21 Aug 2017 18:57:26 -0400 Subject: [PATCH] hack/local-up-cluster.sh defaults to allow swap --- hack/local-up-cluster.sh | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/hack/local-up-cluster.sh b/hack/local-up-cluster.sh index 01b2541942a..7fa308657bc 100755 --- a/hack/local-up-cluster.sh +++ b/hack/local-up-cluster.sh @@ -31,6 +31,8 @@ KUBELET_AUTHORIZATION_WEBHOOK=${KUBELET_AUTHORIZATION_WEBHOOK:-""} KUBELET_AUTHENTICATION_WEBHOOK=${KUBELET_AUTHENTICATION_WEBHOOK:-""} POD_MANIFEST_PATH=${POD_MANIFEST_PATH:-"/var/run/kubernetes/static-pods"} KUBELET_FLAGS=${KUBELET_FLAGS:-""} +# many dev environments run with swap on, so we don't fail in this env +FAIL_SWAP_ON=${FAIL_SWAP_ON:-"false"} # Name of the network plugin, eg: "kubenet" NET_PLUGIN=${NET_PLUGIN:-""} # Place the config files and binaries required by NET_PLUGIN in these directory, @@ -112,6 +114,11 @@ if [ "${CLOUD_PROVIDER}" == "openstack" ]; then fi fi +# warn if users are running with swap allowed +if [ "${FAIL_SWAP_ON}" == "false" ]; then + echo "WARNING : The kubelet is configured to not fail if swap is enabled; production deployments should disable swap." +fi + if [ "$(id -u)" != "0" ]; then echo "WARNING : This script MAY be run as root for docker socket / iptables functionality; if failures occur, retry as root." 2>&1 fi @@ -665,6 +672,7 @@ function start_kubelet { --eviction-soft=${EVICTION_SOFT} \ --eviction-pressure-transition-period=${EVICTION_PRESSURE_TRANSITION_PERIOD} \ --pod-manifest-path="${POD_MANIFEST_PATH}" \ + --fail-swap-on="${FAIL_SWAP_ON}" \ ${auth_args} \ ${dns_args} \ ${cni_conf_dir_args} \