Merge pull request #49808 from dims/fix-dynamic-admission-control-in-local-cluster

Automatic merge from submit-queue (batch tested with PRs 48365, 49902, 49808, 48722, 47045)

Add admission controller API to runtime config and externalize ADMISSION_CONTROL

**What this PR does / why we need it**:

Enable the dynamic admission controller registration API by
adding "admissionregistration.k8s.io/v1alpha1" to --runtime-config
to fix problems when starting up local-up-cluster. Also make sure
ADMISSION_CONTROL can be specified externally.

**Which issue this PR fixes** *(optional, in `fixes #<issue number>(, fixes #<issue_number>, ...)` format, will close that issue when PR gets merged)*: fixes #

Fixes #47385

**Special notes for your reviewer**:

**Release note**:

```release-note
NONE
```
pull/6/head
Kubernetes Submit Queue 2017-08-02 22:32:56 -07:00 committed by GitHub
commit a0fe9edd27
1 changed files with 9 additions and 0 deletions

View File

@ -91,6 +91,7 @@ export KUBE_CACHE_MUTATION_DETECTOR
KUBE_PANIC_WATCH_DECODE_ERROR="${KUBE_PANIC_WATCH_DECODE_ERROR:-true}"
export KUBE_PANIC_WATCH_DECODE_ERROR
ADMISSION_CONTROL=${ADMISSION_CONTROL:-""}
ADMISSION_CONTROL_CONFIG_FILE=${ADMISSION_CONTROL_CONFIG_FILE:-""}
# START_MODE can be 'all', 'kubeletonly', or 'nokubelet'
@ -441,6 +442,14 @@ function start_apiserver {
if [[ -n "${ALLOW_PRIVILEGED}" ]]; then
priv_arg="--allow-privileged "
fi
if [[ ${ADMISSION_CONTROL} == *"Initializers"* ]]; then
if [[ -n "${RUNTIME_CONFIG}" ]]; then
RUNTIME_CONFIG+=","
fi
RUNTIME_CONFIG+="admissionregistration.k8s.io/v1alpha1"
fi
runtime_config=""
if [[ -n "${RUNTIME_CONFIG}" ]]; then
runtime_config="--runtime-config=${RUNTIME_CONFIG}"