From 6a7aca31297da840cf452676fc86bddbb613cb82 Mon Sep 17 00:00:00 2001 From: Suraj Deshmukh Date: Thu, 23 Nov 2017 11:08:28 +0530 Subject: [PATCH] enable podpreset by default in local up cluster This commit enables PodPreset in Admission control and also for that to work on the apiserver level enalbes the API group settings.k8s.io/v1alpha1. --- hack/local-up-cluster.sh | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/hack/local-up-cluster.sh b/hack/local-up-cluster.sh index 31399f8102d..0a3560d9610 100755 --- a/hack/local-up-cluster.sh +++ b/hack/local-up-cluster.sh @@ -421,7 +421,7 @@ function start_apiserver { # Admission Controllers to invoke prior to persisting objects in cluster # # ResourceQuota must come last, or a creation is recorded, but the pod may be forbidden. - ADMISSION_CONTROL=Initializers,NamespaceLifecycle,LimitRanger,ServiceAccount${security_admission},DefaultStorageClass,DefaultTolerationSeconds,MutatingAdmissionWebhook,ValidatingAdmissionWebhook,ResourceQuota + ADMISSION_CONTROL=Initializers,NamespaceLifecycle,LimitRanger,ServiceAccount${security_admission},DefaultStorageClass,DefaultTolerationSeconds,MutatingAdmissionWebhook,ValidatingAdmissionWebhook,ResourceQuota,PodPreset # This is the default dir and filename where the apiserver will generate a self-signed cert # which should be able to be used as the CA to verify itself @@ -464,6 +464,13 @@ function start_apiserver { RUNTIME_CONFIG+="admissionregistration.k8s.io/v1alpha1" fi + if [[ ${ADMISSION_CONTROL} == *"PodPreset"* ]]; then + if [[ -n "${RUNTIME_CONFIG}" ]]; then + RUNTIME_CONFIG+="," + fi + RUNTIME_CONFIG+="settings.k8s.io/v1alpha1" + fi + runtime_config="" if [[ -n "${RUNTIME_CONFIG}" ]]; then runtime_config="--runtime-config=${RUNTIME_CONFIG}"