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
0a230fad
Commit
0a230fad
authored
Jan 20, 2018
by
hzxuzhonghu
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
kube-apiserver flag --admision-control is deprecated, use the new --enable-admission-plugins
parent
2f4cca73
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
12 additions
and
12 deletions
+12
-12
options_test.go
cmd/kube-apiserver/app/options/options_test.go
+2
-2
local-up-cluster.sh
hack/local-up-cluster.sh
+8
-8
test-cmd.sh
hack/make-rules/test-cmd.sh
+2
-2
No files found.
cmd/kube-apiserver/app/options/options_test.go
View file @
0a230fad
...
...
@@ -43,7 +43,7 @@ func TestAddFlags(t *testing.T) {
s
.
AddFlags
(
f
)
args
:=
[]
string
{
"--
admission-control
=AlwaysDeny"
,
"--
enable-admission-plugins
=AlwaysDeny"
,
"--admission-control-config-file=/admission-control-config"
,
"--advertise-address=192.168.10.10"
,
"--allow-privileged=false"
,
...
...
@@ -111,10 +111,10 @@ func TestAddFlags(t *testing.T) {
MinRequestTimeout
:
1800
,
},
Admission
:
&
kubeoptions
.
AdmissionOptions
{
PluginNames
:
[]
string
{
"AlwaysDeny"
},
GenericAdmission
:
&
apiserveroptions
.
AdmissionOptions
{
RecommendedPluginOrder
:
s
.
Admission
.
GenericAdmission
.
RecommendedPluginOrder
,
DefaultOffPlugins
:
s
.
Admission
.
GenericAdmission
.
DefaultOffPlugins
,
EnablePlugins
:
[]
string
{
"AlwaysDeny"
},
ConfigFile
:
"/admission-control-config"
,
Plugins
:
s
.
Admission
.
GenericAdmission
.
Plugins
,
},
...
...
hack/local-up-cluster.sh
View file @
0a230fad
...
...
@@ -97,7 +97,8 @@ 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
:-
""
}
ENABLE_ADMISSION_PLUGINS
=
${
ENABLE_ADMISSION_PLUGINS
:-
""
}
DISABLE_ADMISSION_PLUGINS
=
${
DISABLE_ADMISSION_PLUGINS
:-
""
}
ADMISSION_CONTROL_CONFIG_FILE
=
${
ADMISSION_CONTROL_CONFIG_FILE
:-
""
}
# START_MODE can be 'all', 'kubeletonly', or 'nokubelet'
...
...
@@ -436,10 +437,8 @@ function start_apiserver {
# 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.
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
# which should be able to be used as the CA to verify itself
# The order defined here dose not matter.
ENABLE_ADMISSION_PLUGINS
=
Initializers,LimitRanger,ServiceAccount
${
security_admission
}
,DefaultStorageClass,DefaultTolerationSeconds,MutatingAdmissionWebhook,ValidatingAdmissionWebhook,ResourceQuota,PodPreset
audit_arg
=
""
APISERVER_BASIC_AUDIT_LOG
=
""
...
...
@@ -473,14 +472,14 @@ function start_apiserver {
priv_arg
=
"--allow-privileged "
fi
if
[[
${
ADMISSION_CONTROL
}
==
*
"Initializers"
*
]]
;
then
if
[[
${
ENABLE_ADMISSION_PLUGINS
}
==
*
"Initializers"
*
]]
;
then
if
[[
-n
"
${
RUNTIME_CONFIG
}
"
]]
;
then
RUNTIME_CONFIG+
=
","
fi
RUNTIME_CONFIG+
=
"admissionregistration.k8s.io/v1alpha1"
fi
if
[[
${
ADMISSION_CONTROL
}
==
*
"PodPreset"
*
]]
;
then
if
[[
${
ENABLE_ADMISSION_PLUGINS
}
==
*
"PodPreset"
*
]]
;
then
if
[[
-n
"
${
RUNTIME_CONFIG
}
"
]]
;
then
RUNTIME_CONFIG+
=
","
fi
...
...
@@ -548,7 +547,8 @@ function start_apiserver {
--client-ca-file
=
"
${
CERT_DIR
}
/client-ca.crt"
\
--service-account-key-file
=
"
${
SERVICE_ACCOUNT_KEY
}
"
\
--service-account-lookup
=
"
${
SERVICE_ACCOUNT_LOOKUP
}
"
\
--admission-control
=
"
${
ADMISSION_CONTROL
}
"
\
--enable-admission-plugins
=
"
${
ENABLE_ADMISSION_PLUGINS
}
"
\
--disable-admission-plugins
=
"
${
DISABLE_ADMISSION_PLUGINS
}
"
\
--admission-control-config-file
=
"
${
ADMISSION_CONTROL_CONFIG_FILE
}
"
\
--bind-address
=
"
${
API_BIND_ADDR
}
"
\
--secure-port
=
"
${
API_SECURE_PORT
}
"
\
...
...
hack/make-rules/test-cmd.sh
View file @
0a230fad
...
...
@@ -34,7 +34,7 @@ function run_kube_apiserver() {
kube::log::status
"Starting kube-apiserver"
# Admission Controllers to invoke prior to persisting objects in cluster
ADMISSION_CONTROL
=
"Initializers,NamespaceLifecycle
,LimitRanger,ResourceQuota"
ENABLE_ADMISSION_PLUGINS
=
"Initializers
,LimitRanger,ResourceQuota"
# Include RBAC (to exercise bootstrapping), and AlwaysAllow to allow all actions
AUTHORIZATION_MODE
=
"RBAC,AlwaysAllow"
...
...
@@ -45,7 +45,7 @@ function run_kube_apiserver() {
--insecure-port
=
"
${
API_PORT
}
"
\
--authorization-mode
=
"
${
AUTHORIZATION_MODE
}
"
\
--secure-port
=
"
${
SECURE_API_PORT
}
"
\
--
admission-control
=
"
${
ADMISSION_CONTROL
}
"
\
--
enable-admission-plugins
=
"
${
ENABLE_ADMISSION_PLUGINS
}
"
\
--etcd-servers
=
"http://
${
ETCD_HOST
}
:
${
ETCD_PORT
}
"
\
--runtime-config
=
api/v1
\
--storage-media-type
=
"
${
KUBE_TEST_API_STORAGE_TYPE
-
}
"
\
...
...
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