mirror of https://github.com/k3s-io/k3s
Enable StorageObjectInUseProtection by default
StorageObjectInUseProtection plugin of admission controller adds the flag `kubernetes.io/pvc-protection` or `kubernetes.io/pv-protection` to newly created PVCs or PV. In case a user deletes a PVC or PV the PVC or PV is not removed until the finalizer is removed from the PVC or PV by PVC or PV Protection Controller. We are testing this plugin on the e2e tests of "PV Protection" because most setup scripts enable that like: * cluster/centos/config-default.sh: Enabled * cluster/gce/config-default.sh: Enabled * cluster/gce/config-test.sh: Enabled * cluster/kubemark/gce/config-default.sh: Enabled * hack/local-up-cluster.sh: Enabled * cluster/juju/layers/kubernetes-master/reactive/kubernetes_master.py: Disabled As we are testing it normally, it is nice to enable the plugin by default.k3s-v1.15.3
parent
d262343acd
commit
ede5477697
|
@ -35,7 +35,7 @@ function run_kube_apiserver() {
|
||||||
|
|
||||||
# Admission Controllers to invoke prior to persisting objects in cluster
|
# Admission Controllers to invoke prior to persisting objects in cluster
|
||||||
ENABLE_ADMISSION_PLUGINS="LimitRanger,ResourceQuota"
|
ENABLE_ADMISSION_PLUGINS="LimitRanger,ResourceQuota"
|
||||||
DISABLE_ADMISSION_PLUGINS="ServiceAccount,PersistentVolumeLabel,DefaultStorageClass,DefaultTolerationSeconds,MutatingAdmissionWebhook,ValidatingAdmissionWebhook"
|
DISABLE_ADMISSION_PLUGINS="ServiceAccount,PersistentVolumeLabel,DefaultStorageClass,DefaultTolerationSeconds,MutatingAdmissionWebhook,ValidatingAdmissionWebhook,StorageObjectInUseProtection"
|
||||||
|
|
||||||
# Include RBAC (to exercise bootstrapping), and AlwaysAllow to allow all actions
|
# Include RBAC (to exercise bootstrapping), and AlwaysAllow to allow all actions
|
||||||
AUTHORIZATION_MODE="RBAC,AlwaysAllow"
|
AUTHORIZATION_MODE="RBAC,AlwaysAllow"
|
||||||
|
|
|
@ -45,7 +45,7 @@ RUNTIME_CONFIG=""
|
||||||
ETCDCTL=$(which etcdctl)
|
ETCDCTL=$(which etcdctl)
|
||||||
KUBECTL="${KUBE_OUTPUT_HOSTBIN}/kubectl"
|
KUBECTL="${KUBE_OUTPUT_HOSTBIN}/kubectl"
|
||||||
UPDATE_ETCD_OBJECTS_SCRIPT="${KUBE_ROOT}/cluster/update-storage-objects.sh"
|
UPDATE_ETCD_OBJECTS_SCRIPT="${KUBE_ROOT}/cluster/update-storage-objects.sh"
|
||||||
DISABLE_ADMISSION_PLUGINS="ServiceAccount,NamespaceLifecycle,LimitRanger,MutatingAdmissionWebhook,ValidatingAdmissionWebhook,ResourceQuota,PersistentVolumeLabel,DefaultStorageClass"
|
DISABLE_ADMISSION_PLUGINS="ServiceAccount,NamespaceLifecycle,LimitRanger,MutatingAdmissionWebhook,ValidatingAdmissionWebhook,ResourceQuota,PersistentVolumeLabel,DefaultStorageClass,StorageObjectInUseProtection"
|
||||||
|
|
||||||
function startApiServer() {
|
function startApiServer() {
|
||||||
local storage_versions=${1:-""}
|
local storage_versions=${1:-""}
|
||||||
|
|
|
@ -128,15 +128,16 @@ func RegisterAllAdmissionPlugins(plugins *admission.Plugins) {
|
||||||
// DefaultOffAdmissionPlugins get admission plugins off by default for kube-apiserver.
|
// DefaultOffAdmissionPlugins get admission plugins off by default for kube-apiserver.
|
||||||
func DefaultOffAdmissionPlugins() sets.String {
|
func DefaultOffAdmissionPlugins() sets.String {
|
||||||
defaultOnPlugins := sets.NewString(
|
defaultOnPlugins := sets.NewString(
|
||||||
lifecycle.PluginName, //NamespaceLifecycle
|
lifecycle.PluginName, //NamespaceLifecycle
|
||||||
limitranger.PluginName, //LimitRanger
|
limitranger.PluginName, //LimitRanger
|
||||||
serviceaccount.PluginName, //ServiceAccount
|
serviceaccount.PluginName, //ServiceAccount
|
||||||
setdefault.PluginName, //DefaultStorageClass
|
setdefault.PluginName, //DefaultStorageClass
|
||||||
resize.PluginName, //PersistentVolumeClaimResize
|
resize.PluginName, //PersistentVolumeClaimResize
|
||||||
defaulttolerationseconds.PluginName, //DefaultTolerationSeconds
|
defaulttolerationseconds.PluginName, //DefaultTolerationSeconds
|
||||||
mutatingwebhook.PluginName, //MutatingAdmissionWebhook
|
mutatingwebhook.PluginName, //MutatingAdmissionWebhook
|
||||||
validatingwebhook.PluginName, //ValidatingAdmissionWebhook
|
validatingwebhook.PluginName, //ValidatingAdmissionWebhook
|
||||||
resourcequota.PluginName, //ResourceQuota
|
resourcequota.PluginName, //ResourceQuota
|
||||||
|
storageobjectinuseprotection.PluginName, //StorageObjectInUseProtection
|
||||||
)
|
)
|
||||||
|
|
||||||
if utilfeature.DefaultFeatureGate.Enabled(features.PodPriority) {
|
if utilfeature.DefaultFeatureGate.Enabled(features.PodPriority) {
|
||||||
|
|
Loading…
Reference in New Issue