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
824cf1f9
Commit
824cf1f9
authored
Oct 28, 2017
by
root
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Stop using the PersistentVolumeLabel admission controller in v1.9
parent
eff1a846
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
80 additions
and
3 deletions
+80
-3
manifests.go
cmd/kubeadm/app/phases/controlplane/manifests.go
+7
-2
manifests_test.go
cmd/kubeadm/app/phases/controlplane/manifests_test.go
+73
-1
No files found.
cmd/kubeadm/app/phases/controlplane/manifests.go
View file @
824cf1f9
...
@@ -40,8 +40,9 @@ import (
...
@@ -40,8 +40,9 @@ import (
const
(
const
(
DefaultCloudConfigPath
=
"/etc/kubernetes/cloud-config"
DefaultCloudConfigPath
=
"/etc/kubernetes/cloud-config"
defaultV18AdmissionControl
=
"Initializers,NamespaceLifecycle,LimitRanger,ServiceAccount,PersistentVolumeLabel,DefaultStorageClass,DefaultTolerationSeconds,NodeRestriction,ResourceQuota"
defaultV18AdmissionControl
=
"Initializers,NamespaceLifecycle,LimitRanger,ServiceAccount,PersistentVolumeLabel,DefaultStorageClass,DefaultTolerationSeconds,NodeRestriction,ResourceQuota"
defaultV19AdmissionControl
=
"Initializers,NamespaceLifecycle,LimitRanger,ServiceAccount,PersistentVolumeLabel,DefaultStorageClass,DefaultTolerationSeconds,NodeRestriction,Priority,ResourceQuota"
deprecatedV19AdmissionControl
=
"Initializers,NamespaceLifecycle,LimitRanger,ServiceAccount,PersistentVolumeLabel,DefaultStorageClass,DefaultTolerationSeconds,NodeRestriction,Priority,ResourceQuota"
defaultV19AdmissionControl
=
"Initializers,NamespaceLifecycle,LimitRanger,ServiceAccount,DefaultStorageClass,DefaultTolerationSeconds,NodeRestriction,Priority,ResourceQuota"
)
)
// CreateInitStaticPodManifestFiles will write all static pod manifest files needed to bring up the control plane.
// CreateInitStaticPodManifestFiles will write all static pod manifest files needed to bring up the control plane.
...
@@ -170,6 +171,10 @@ func getAPIServerCommand(cfg *kubeadmapi.MasterConfiguration, k8sVersion *versio
...
@@ -170,6 +171,10 @@ func getAPIServerCommand(cfg *kubeadmapi.MasterConfiguration, k8sVersion *versio
defaultArguments
[
"admission-control"
]
=
defaultV18AdmissionControl
defaultArguments
[
"admission-control"
]
=
defaultV18AdmissionControl
}
}
if
cfg
.
CloudProvider
==
"aws"
||
cfg
.
CloudProvider
==
"gce"
{
defaultArguments
[
"admission-control"
]
=
deprecatedV19AdmissionControl
}
command
=
append
(
command
,
kubeadmutil
.
BuildArgumentListFromMap
(
defaultArguments
,
cfg
.
APIServerExtraArgs
)
...
)
command
=
append
(
command
,
kubeadmutil
.
BuildArgumentListFromMap
(
defaultArguments
,
cfg
.
APIServerExtraArgs
)
...
)
command
=
append
(
command
,
getAuthzParameters
(
cfg
.
AuthorizationModes
)
...
)
command
=
append
(
command
,
getAuthzParameters
(
cfg
.
AuthorizationModes
)
...
)
...
...
cmd/kubeadm/app/phases/controlplane/manifests_test.go
View file @
824cf1f9
...
@@ -362,7 +362,7 @@ func TestGetAPIServerCommand(t *testing.T) {
...
@@ -362,7 +362,7 @@ func TestGetAPIServerCommand(t *testing.T) {
expected
:
[]
string
{
expected
:
[]
string
{
"kube-apiserver"
,
"kube-apiserver"
,
"--insecure-port=0"
,
"--insecure-port=0"
,
"--admission-control=Initializers,NamespaceLifecycle,LimitRanger,ServiceAccount,
PersistentVolumeLabel,
DefaultStorageClass,DefaultTolerationSeconds,NodeRestriction,Priority,ResourceQuota"
,
"--admission-control=Initializers,NamespaceLifecycle,LimitRanger,ServiceAccount,DefaultStorageClass,DefaultTolerationSeconds,NodeRestriction,Priority,ResourceQuota"
,
"--service-cluster-ip-range=bar"
,
"--service-cluster-ip-range=bar"
,
"--service-account-key-file="
+
testCertsDir
+
"/sa.pub"
,
"--service-account-key-file="
+
testCertsDir
+
"/sa.pub"
,
"--client-ca-file="
+
testCertsDir
+
"/ca.crt"
,
"--client-ca-file="
+
testCertsDir
+
"/ca.crt"
,
...
@@ -388,6 +388,78 @@ func TestGetAPIServerCommand(t *testing.T) {
...
@@ -388,6 +388,78 @@ func TestGetAPIServerCommand(t *testing.T) {
"--etcd-keyfile=faz"
,
"--etcd-keyfile=faz"
,
},
},
},
},
{
cfg
:
&
kubeadmapi
.
MasterConfiguration
{
API
:
kubeadmapi
.
API
{
BindPort
:
123
,
AdvertiseAddress
:
"1.2.3.4"
},
Networking
:
kubeadmapi
.
Networking
{
ServiceSubnet
:
"bar"
},
CertificatesDir
:
testCertsDir
,
KubernetesVersion
:
"v1.9.0-beta.0"
,
CloudProvider
:
"gce"
,
},
expected
:
[]
string
{
"kube-apiserver"
,
"--insecure-port=0"
,
"--admission-control=Initializers,NamespaceLifecycle,LimitRanger,ServiceAccount,PersistentVolumeLabel,DefaultStorageClass,DefaultTolerationSeconds,NodeRestriction,Priority,ResourceQuota"
,
"--service-cluster-ip-range=bar"
,
"--service-account-key-file="
+
testCertsDir
+
"/sa.pub"
,
"--client-ca-file="
+
testCertsDir
+
"/ca.crt"
,
"--tls-cert-file="
+
testCertsDir
+
"/apiserver.crt"
,
"--tls-private-key-file="
+
testCertsDir
+
"/apiserver.key"
,
"--kubelet-client-certificate="
+
testCertsDir
+
"/apiserver-kubelet-client.crt"
,
"--kubelet-client-key="
+
testCertsDir
+
"/apiserver-kubelet-client.key"
,
"--enable-bootstrap-token-auth=true"
,
"--secure-port=123"
,
"--allow-privileged=true"
,
"--kubelet-preferred-address-types=InternalIP,ExternalIP,Hostname"
,
"--proxy-client-cert-file=/var/lib/certs/front-proxy-client.crt"
,
"--proxy-client-key-file=/var/lib/certs/front-proxy-client.key"
,
"--requestheader-username-headers=X-Remote-User"
,
"--requestheader-group-headers=X-Remote-Group"
,
"--requestheader-extra-headers-prefix=X-Remote-Extra-"
,
"--requestheader-client-ca-file="
+
testCertsDir
+
"/front-proxy-ca.crt"
,
"--requestheader-allowed-names=front-proxy-client"
,
"--authorization-mode=Node,RBAC"
,
"--advertise-address=1.2.3.4"
,
"--etcd-servers=http://127.0.0.1:2379"
,
"--cloud-provider=gce"
,
},
},
{
cfg
:
&
kubeadmapi
.
MasterConfiguration
{
API
:
kubeadmapi
.
API
{
BindPort
:
123
,
AdvertiseAddress
:
"1.2.3.4"
},
Networking
:
kubeadmapi
.
Networking
{
ServiceSubnet
:
"bar"
},
CertificatesDir
:
testCertsDir
,
KubernetesVersion
:
"v1.9.0-beta.0"
,
CloudProvider
:
"aws"
,
},
expected
:
[]
string
{
"kube-apiserver"
,
"--insecure-port=0"
,
"--admission-control=Initializers,NamespaceLifecycle,LimitRanger,ServiceAccount,PersistentVolumeLabel,DefaultStorageClass,DefaultTolerationSeconds,NodeRestriction,Priority,ResourceQuota"
,
"--service-cluster-ip-range=bar"
,
"--service-account-key-file="
+
testCertsDir
+
"/sa.pub"
,
"--client-ca-file="
+
testCertsDir
+
"/ca.crt"
,
"--tls-cert-file="
+
testCertsDir
+
"/apiserver.crt"
,
"--tls-private-key-file="
+
testCertsDir
+
"/apiserver.key"
,
"--kubelet-client-certificate="
+
testCertsDir
+
"/apiserver-kubelet-client.crt"
,
"--kubelet-client-key="
+
testCertsDir
+
"/apiserver-kubelet-client.key"
,
"--enable-bootstrap-token-auth=true"
,
"--secure-port=123"
,
"--allow-privileged=true"
,
"--kubelet-preferred-address-types=InternalIP,ExternalIP,Hostname"
,
"--proxy-client-cert-file=/var/lib/certs/front-proxy-client.crt"
,
"--proxy-client-key-file=/var/lib/certs/front-proxy-client.key"
,
"--requestheader-username-headers=X-Remote-User"
,
"--requestheader-group-headers=X-Remote-Group"
,
"--requestheader-extra-headers-prefix=X-Remote-Extra-"
,
"--requestheader-client-ca-file="
+
testCertsDir
+
"/front-proxy-ca.crt"
,
"--requestheader-allowed-names=front-proxy-client"
,
"--authorization-mode=Node,RBAC"
,
"--advertise-address=1.2.3.4"
,
"--etcd-servers=http://127.0.0.1:2379"
,
"--cloud-provider=aws"
,
},
},
}
}
for
_
,
rt
:=
range
tests
{
for
_
,
rt
:=
range
tests
{
...
...
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