Introduced kube/system reservation for the kubelet
@@ -284,10 +284,16 @@ _KUBE_NODE_NAME_ARGS="--hostname-override $_KUBE_NODE_NAME"
_KUBELET_INITD_DROPIN_PATH="/etc/systemd/system/kubelet.service.d/20-kubelet-labels.conf"
rm -f $_KUBELET_INITD_DROPIN_PATH
-## Append node-labels string to the systemd config
+
+## Configure kubelet reservations
+## FIXME: shall be moved to the preferences
+_KUBE_RESERVED_ARGS="--kube-reserved cpu=500m,memory=500Mi,storage=1Gi"
+_KUBE_SYS_RESERVED_ARGS="--system-reserved cpu=500m,memory=500Mi,storage=1Gi"
+
+## Append extra kube-config to the systemd config
cat > $_KUBELET_INITD_DROPIN_PATH <<EOF
[Service]
-Environment="KUBELET_EXTRA_ARGS=$_KUBE_NODE_INSTANCE_LABELS $_KUBE_LOG_ARGS $_KUBE_NODE_NAME_ARGS"
+Environment="KUBELET_EXTRA_ARGS=$_KUBE_NODE_INSTANCE_LABELS $_KUBE_LOG_ARGS $_KUBE_NODE_NAME_ARGS $_KUBE_RESERVED_ARGS $_KUBE_SYS_RESERVED_ARGS"
EOF
chmod +x $_KUBELET_INITD_DROPIN_PATH
