export ENABLE_POD_PRIORITY_PREEMPTION=true to enable Pod priority and preemption

pull/6/head
stewart-yu 2017-11-22 17:49:55 +08:00
parent afb26b9323
commit e0edce33ef
1 changed files with 16 additions and 1 deletions

View File

@ -71,6 +71,8 @@ FEATURE_GATES=${FEATURE_GATES:-"AllAlpha=false"}
STORAGE_BACKEND=${STORAGE_BACKEND:-"etcd3"} STORAGE_BACKEND=${STORAGE_BACKEND:-"etcd3"}
# enable swagger ui # enable swagger ui
ENABLE_SWAGGER_UI=${ENABLE_SWAGGER_UI:-false} ENABLE_SWAGGER_UI=${ENABLE_SWAGGER_UI:-false}
# enable Pod priority and preemption
ENABLE_POD_PRIORITY_PREEMPTION=${ENABLE_POD_PRIORITY_PREEMPTION:-""}
# enable kubernetes dashboard # enable kubernetes dashboard
ENABLE_CLUSTER_DASHBOARD=${KUBE_ENABLE_CLUSTER_DASHBOARD:-false} ENABLE_CLUSTER_DASHBOARD=${KUBE_ENABLE_CLUSTER_DASHBOARD:-false}
@ -115,11 +117,16 @@ if [ "${CLOUD_PROVIDER}" == "openstack" ]; then
fi fi
fi fi
#set feature gates if using ipvs mode # set feature gates if using ipvs mode
if [ "${KUBEPROXY_MODE}" == "ipvs" ]; then if [ "${KUBEPROXY_MODE}" == "ipvs" ]; then
FEATURE_GATES="$FEATURE_GATES,SupportIPVSProxyMode=true" FEATURE_GATES="$FEATURE_GATES,SupportIPVSProxyMode=true"
fi fi
# set feature gates if enable Pod priority and preemption
if [ "${ENABLE_POD_PRIORITY_PREEMPTION}" == true ]; then
FEATURE_GATES="$FEATURE_GATES,PodPriority=true"
fi
# warn if users are running with swap allowed # warn if users are running with swap allowed
if [ "${FAIL_SWAP_ON}" == "false" ]; then if [ "${FAIL_SWAP_ON}" == "false" ]; then
echo "WARNING : The kubelet is configured to not fail if swap is enabled; production deployments should disable swap." echo "WARNING : The kubelet is configured to not fail if swap is enabled; production deployments should disable swap."
@ -417,6 +424,14 @@ function start_apiserver {
if [[ -n "${NODE_ADMISSION}" ]]; then if [[ -n "${NODE_ADMISSION}" ]]; then
security_admission=",NodeRestriction" security_admission=",NodeRestriction"
fi fi
if [ "${ENABLE_POD_PRIORITY_PREEMPTION}" == true ]; then
security_admission=",Priority"
if [[ -n "${RUNTIME_CONFIG}" ]]; then
RUNTIME_CONFIG+=","
fi
RUNTIME_CONFIG+="scheduling.k8s.io/v1alpha1=true"
fi
# Admission Controllers to invoke prior to persisting objects in cluster # Admission Controllers to invoke prior to persisting objects in cluster
ADMISSION_CONTROL=MutatingAdmissionWebhook,Initializers,NamespaceLifecycle,LimitRanger,ServiceAccount${security_admission},DefaultStorageClass,DefaultTolerationSeconds,ValidatingAdmissionWebhook,ResourceQuota ADMISSION_CONTROL=MutatingAdmissionWebhook,Initializers,NamespaceLifecycle,LimitRanger,ServiceAccount${security_admission},DefaultStorageClass,DefaultTolerationSeconds,ValidatingAdmissionWebhook,ResourceQuota