mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-08-02 16:29:21 +00:00
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.
This commit is contained in:
parent
64ed037e68
commit
6a7aca3129
@ -421,7 +421,7 @@ function start_apiserver {
|
|||||||
# Admission Controllers to invoke prior to persisting objects in cluster
|
# 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.
|
# 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
|
# 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
|
# 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"
|
RUNTIME_CONFIG+="admissionregistration.k8s.io/v1alpha1"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
if [[ ${ADMISSION_CONTROL} == *"PodPreset"* ]]; then
|
||||||
|
if [[ -n "${RUNTIME_CONFIG}" ]]; then
|
||||||
|
RUNTIME_CONFIG+=","
|
||||||
|
fi
|
||||||
|
RUNTIME_CONFIG+="settings.k8s.io/v1alpha1"
|
||||||
|
fi
|
||||||
|
|
||||||
runtime_config=""
|
runtime_config=""
|
||||||
if [[ -n "${RUNTIME_CONFIG}" ]]; then
|
if [[ -n "${RUNTIME_CONFIG}" ]]; then
|
||||||
runtime_config="--runtime-config=${RUNTIME_CONFIG}"
|
runtime_config="--runtime-config=${RUNTIME_CONFIG}"
|
||||||
|
Loading…
Reference in New Issue
Block a user