From 3d4b76d7226452aa785d2c028c6e388bb539aace Mon Sep 17 00:00:00 2001 From: Paul Morie Date: Mon, 5 Oct 2015 11:55:42 -0400 Subject: [PATCH] Add option to allow security context in local cluster --- hack/local-up-cluster.sh | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/hack/local-up-cluster.sh b/hack/local-up-cluster.sh index be29bd0c3c1..e07436d4210 100755 --- a/hack/local-up-cluster.sh +++ b/hack/local-up-cluster.sh @@ -22,6 +22,7 @@ DOCKER_NATIVE=${DOCKER_NATIVE:-""} DOCKER=(docker ${DOCKER_OPTS}) DOCKERIZE_KUBELET=${DOCKERIZE_KUBELET:-""} ALLOW_PRIVILEGED=${ALLOW_PRIVILEGED:-""} +ALLOW_SECURITY_CONTEXT=${ALLOW_SECURITY_CONTEXT:-""} RUNTIME_CONFIG=${RUNTIME_CONFIG:-""} KUBE_ROOT=$(dirname "${BASH_SOURCE}")/.. cd "${KUBE_ROOT}" @@ -201,7 +202,11 @@ function set_service_accounts { function start_apiserver { # Admission Controllers to invoke prior to persisting objects in cluster - ADMISSION_CONTROL=NamespaceLifecycle,NamespaceAutoProvision,LimitRanger,SecurityContextDeny,ServiceAccount,DenyEscalatingExec,ResourceQuota + if [[ -z "${ALLOW_SECURITY_CONTEXT}" ]]; then + ADMISSION_CONTROL=NamespaceLifecycle,NamespaceAutoProvision,LimitRanger,SecurityContextDeny,ServiceAccount,DenyEscalatingExec,ResourceQuota + else + ADMISSION_CONTROL=NamespaceLifecycle,NamespaceAutoProvision,LimitRanger,ServiceAccount,DenyEscalatingExec,ResourceQuota + fi # 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