Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
K
k3s
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Jacklull
k3s
Commits
8e8e32fa
Commit
8e8e32fa
authored
Nov 17, 2017
by
Chao Xu
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
move the MutatingAdmissionWebhook to the last in the mutating amdission
plugin chain.
parent
6b1b6d50
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
13 additions
and
7 deletions
+13
-7
config-test.sh
cluster/gce/config-test.sh
+2
-2
options_test.go
cmd/kube-apiserver/app/options/options_test.go
+2
-2
local-up-cluster.sh
hack/local-up-cluster.sh
+3
-1
admission.go
staging/src/k8s.io/apiserver/pkg/server/options/admission.go
+6
-2
No files found.
cluster/gce/config-test.sh
View file @
8e8e32fa
...
@@ -316,12 +316,12 @@ if [[ -n "${GCE_GLBC_IMAGE:-}" ]]; then
...
@@ -316,12 +316,12 @@ if [[ -n "${GCE_GLBC_IMAGE:-}" ]]; then
fi
fi
if
[[
-z
"
${
KUBE_ADMISSION_CONTROL
:-}
"
]]
;
then
if
[[
-z
"
${
KUBE_ADMISSION_CONTROL
:-}
"
]]
;
then
ADMISSION_CONTROL
=
"
MutatingAdmissionWebhook,
Initializers,NamespaceLifecycle,LimitRanger,ServiceAccount,PersistentVolumeLabel,PodPreset,DefaultStorageClass,DefaultTolerationSeconds,NodeRestriction,Priority"
ADMISSION_CONTROL
=
"Initializers,NamespaceLifecycle,LimitRanger,ServiceAccount,PersistentVolumeLabel,PodPreset,DefaultStorageClass,DefaultTolerationSeconds,NodeRestriction,Priority"
if
[[
"
${
ENABLE_POD_SECURITY_POLICY
:-}
"
==
"true"
]]
;
then
if
[[
"
${
ENABLE_POD_SECURITY_POLICY
:-}
"
==
"true"
]]
;
then
ADMISSION_CONTROL
=
"
${
ADMISSION_CONTROL
}
,PodSecurityPolicy"
ADMISSION_CONTROL
=
"
${
ADMISSION_CONTROL
}
,PodSecurityPolicy"
fi
fi
# 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
=
"
${
ADMISSION_CONTROL
}
,ValidatingAdmissionWebhook,ResourceQuota"
ADMISSION_CONTROL
=
"
${
ADMISSION_CONTROL
}
,
MutatingAdmissionWebhook,
ValidatingAdmissionWebhook,ResourceQuota"
else
else
ADMISSION_CONTROL
=
${
KUBE_ADMISSION_CONTROL
}
ADMISSION_CONTROL
=
${
KUBE_ADMISSION_CONTROL
}
fi
fi
...
...
cmd/kube-apiserver/app/options/options_test.go
View file @
8e8e32fa
...
@@ -104,8 +104,8 @@ func TestAddFlags(t *testing.T) {
...
@@ -104,8 +104,8 @@ func TestAddFlags(t *testing.T) {
MinRequestTimeout
:
1800
,
MinRequestTimeout
:
1800
,
},
},
Admission
:
&
apiserveroptions
.
AdmissionOptions
{
Admission
:
&
apiserveroptions
.
AdmissionOptions
{
RecommendedPluginOrder
:
[]
string
{
"
MutatingAdmissionWebhook"
,
"NamespaceLifecycle"
,
"Initializers
"
,
"ValidatingAdmissionWebhook"
},
RecommendedPluginOrder
:
[]
string
{
"
NamespaceLifecycle"
,
"Initializers"
,
"MutatingAdmissionWebhook
"
,
"ValidatingAdmissionWebhook"
},
DefaultOffPlugins
:
[]
string
{
"
MutatingAdmissionWebhook"
,
"Initializers
"
,
"ValidatingAdmissionWebhook"
},
DefaultOffPlugins
:
[]
string
{
"
Initializers"
,
"MutatingAdmissionWebhook
"
,
"ValidatingAdmissionWebhook"
},
PluginNames
:
[]
string
{
"AlwaysDeny"
},
PluginNames
:
[]
string
{
"AlwaysDeny"
},
ConfigFile
:
"/admission-control-config"
,
ConfigFile
:
"/admission-control-config"
,
Plugins
:
s
.
Admission
.
Plugins
,
Plugins
:
s
.
Admission
.
Plugins
,
...
...
hack/local-up-cluster.sh
View file @
8e8e32fa
...
@@ -419,7 +419,9 @@ function start_apiserver {
...
@@ -419,7 +419,9 @@ function start_apiserver {
fi
fi
# Admission Controllers to invoke prior to persisting objects in cluster
# Admission Controllers to invoke prior to persisting objects in cluster
ADMISSION_CONTROL
=
MutatingAdmissionWebhook,Initializers,NamespaceLifecycle,LimitRanger,ServiceAccount
${
security_admission
}
,DefaultStorageClass,DefaultTolerationSeconds,ValidatingAdmissionWebhook,ResourceQuota
#
# 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
# 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
...
...
staging/src/k8s.io/apiserver/pkg/server/options/admission.go
View file @
8e8e32fa
...
@@ -61,8 +61,12 @@ func NewAdmissionOptions() *AdmissionOptions {
...
@@ -61,8 +61,12 @@ func NewAdmissionOptions() *AdmissionOptions {
options
:=
&
AdmissionOptions
{
options
:=
&
AdmissionOptions
{
Plugins
:
admission
.
NewPlugins
(),
Plugins
:
admission
.
NewPlugins
(),
PluginNames
:
[]
string
{},
PluginNames
:
[]
string
{},
RecommendedPluginOrder
:
[]
string
{
mutatingwebhook
.
PluginName
,
lifecycle
.
PluginName
,
initialization
.
PluginName
,
validatingwebhook
.
PluginName
},
// This list is mix of mutating admission plugins and validating
DefaultOffPlugins
:
[]
string
{
mutatingwebhook
.
PluginName
,
initialization
.
PluginName
,
validatingwebhook
.
PluginName
},
// admission plugins. The apiserver always runs the validating ones
// after all the mutating ones, so their relative order in this list
// doesn't matter.
RecommendedPluginOrder
:
[]
string
{
lifecycle
.
PluginName
,
initialization
.
PluginName
,
mutatingwebhook
.
PluginName
,
validatingwebhook
.
PluginName
},
DefaultOffPlugins
:
[]
string
{
initialization
.
PluginName
,
mutatingwebhook
.
PluginName
,
validatingwebhook
.
PluginName
},
}
}
apiserverapi
.
AddToScheme
(
options
.
Plugins
.
ConfigScheme
)
apiserverapi
.
AddToScheme
(
options
.
Plugins
.
ConfigScheme
)
apiserverapiv1alpha1
.
AddToScheme
(
options
.
Plugins
.
ConfigScheme
)
apiserverapiv1alpha1
.
AddToScheme
(
options
.
Plugins
.
ConfigScheme
)
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment