mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-07-27 21:47:07 +00:00
Add admission controller API to config and externalize ADMISSION_CONTROL
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. Fixes 47385
This commit is contained in:
parent
4a73f19aed
commit
13558335bd
@ -92,6 +92,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'
|
||||
@ -447,6 +448,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}"
|
||||
|
Loading…
Reference in New Issue
Block a user