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
96850dc6
Commit
96850dc6
authored
Dec 13, 2016
by
Lucas Käldström
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Set --anonymous-auth to false on v1.5 clusters to preserve the locked-down v1.4 behaviour
parent
bb41d770
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
13 additions
and
2 deletions
+13
-2
manifests.go
cmd/kubeadm/app/master/manifests.go
+12
-2
manifests_test.go
cmd/kubeadm/app/master/manifests_test.go
+1
-0
No files found.
cmd/kubeadm/app/master/manifests.go
View file @
96850dc6
...
@@ -53,7 +53,10 @@ const (
...
@@ -53,7 +53,10 @@ const (
var
(
var
(
// Minimum version of kube-apiserver that supports --kubelet-preferred-address-types
// Minimum version of kube-apiserver that supports --kubelet-preferred-address-types
preferredAddressMinimumVersion
=
semver
.
MustParse
(
"1.5.0-beta.2"
)
preferredAddressAPIServerMinVersion
=
semver
.
MustParse
(
"1.5.0"
)
// Minimum version of kube-apiserver that has to have --anonymous-auth=false set
anonAuthDisableAPIServerMinVersion
=
semver
.
MustParse
(
"1.5.0"
)
)
)
// WriteStaticPodManifests builds manifest objects based on user provided configuration and then dumps it to disk
// WriteStaticPodManifests builds manifest objects based on user provided configuration and then dumps it to disk
...
@@ -303,9 +306,16 @@ func getAPIServerCommand(cfg *kubeadmapi.MasterConfiguration) []string {
...
@@ -303,9 +306,16 @@ func getAPIServerCommand(cfg *kubeadmapi.MasterConfiguration) []string {
// work on bare-metal where hostnames aren't usually resolvable
// work on bare-metal where hostnames aren't usually resolvable
// Omit the "v" in the beginning, otherwise semver will fail
// Omit the "v" in the beginning, otherwise semver will fail
k8sVersion
,
err
:=
semver
.
Parse
(
cfg
.
KubernetesVersion
[
1
:
])
k8sVersion
,
err
:=
semver
.
Parse
(
cfg
.
KubernetesVersion
[
1
:
])
if
err
==
nil
&&
k8sVersion
.
GTE
(
preferredAddressMinimumVersion
)
{
// If the k8s version is greater than this version, it supports telling it which way it should contact kubelets
if
err
==
nil
&&
k8sVersion
.
GTE
(
preferredAddressAPIServerMinVersion
)
{
command
=
append
(
command
,
"--kubelet-preferred-address-types=InternalIP,ExternalIP,Hostname"
)
command
=
append
(
command
,
"--kubelet-preferred-address-types=InternalIP,ExternalIP,Hostname"
)
}
}
// This is a critical "bugfix". Any version above this is vulnarable unless a RBAC/ABAC-authorizer is provided (which kubeadm doesn't for the time being)
if
err
==
nil
&&
k8sVersion
.
GTE
(
anonAuthDisableAPIServerMinVersion
)
{
command
=
append
(
command
,
"--anonymous-auth=false"
)
}
}
}
// Check if the user decided to use an external etcd cluster
// Check if the user decided to use an external etcd cluster
...
...
cmd/kubeadm/app/master/manifests_test.go
View file @
96850dc6
...
@@ -447,6 +447,7 @@ func TestGetAPIServerCommand(t *testing.T) {
...
@@ -447,6 +447,7 @@ func TestGetAPIServerCommand(t *testing.T) {
"--allow-privileged"
,
"--allow-privileged"
,
"--advertise-address=foo"
,
"--advertise-address=foo"
,
"--kubelet-preferred-address-types=InternalIP,ExternalIP,Hostname"
,
"--kubelet-preferred-address-types=InternalIP,ExternalIP,Hostname"
,
"--anonymous-auth=false"
,
"--etcd-servers=http://127.0.0.1:2379"
,
"--etcd-servers=http://127.0.0.1:2379"
,
},
},
},
},
...
...
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