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
5fa8b4b2
Commit
5fa8b4b2
authored
Aug 07, 2018
by
Dr. Stefan Schimanski
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
kube-controller-manager: enable delegated authz/authn if secure port is enabled
parent
eb27b61c
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
29 additions
and
7 deletions
+29
-7
options.go
cmd/kube-controller-manager/app/options/options.go
+13
-7
options_test.go
cmd/kube-controller-manager/app/options/options_test.go
+16
-0
No files found.
cmd/kube-controller-manager/app/options/options.go
View file @
5fa8b4b2
...
...
@@ -185,10 +185,14 @@ func NewKubeControllerManagerOptions() (*KubeControllerManagerOptions, error) {
BindPort
:
int
(
componentConfig
.
KubeCloudShared
.
Port
),
BindNetwork
:
"tcp"
,
},
Authentication
:
nil
,
// TODO: enable with apiserveroptions.NewDelegatingAuthenticationOptions()
Authorization
:
nil
,
// TODO: enable with apiserveroptions.NewDelegatingAuthorizationOptions()
Authentication
:
apiserveroptions
.
NewDelegatingAuthenticationOptions
(),
Authorization
:
apiserveroptions
.
NewDelegatingAuthorizationOptions
(),
}
s
.
Authentication
.
RemoteKubeConfigFileOptional
=
true
s
.
Authorization
.
RemoteKubeConfigFileOptional
=
true
s
.
Authorization
.
AlwaysAllowPaths
=
[]
string
{
"/healthz"
}
s
.
SecureServing
.
ServerCert
.
CertDirectory
=
"/var/run/kubernetes"
s
.
SecureServing
.
ServerCert
.
PairName
=
"kube-controller-manager"
s
.
SecureServing
.
BindPort
=
ports
.
KubeControllerManagerPort
...
...
@@ -349,11 +353,13 @@ func (s *KubeControllerManagerOptions) ApplyTo(c *kubecontrollerconfig.Config) e
if
err
:=
s
.
SecureServing
.
ApplyTo
(
&
c
.
SecureServing
);
err
!=
nil
{
return
err
}
if
err
:=
s
.
Authentication
.
ApplyTo
(
&
c
.
Authentication
,
c
.
SecureServing
,
nil
);
err
!=
nil
{
return
err
}
if
err
:=
s
.
Authorization
.
ApplyTo
(
&
c
.
Authorization
);
err
!=
nil
{
return
err
if
s
.
SecureServing
.
BindPort
!=
0
||
s
.
SecureServing
.
Listener
!=
nil
{
if
err
:=
s
.
Authentication
.
ApplyTo
(
&
c
.
Authentication
,
c
.
SecureServing
,
nil
);
err
!=
nil
{
return
err
}
if
err
:=
s
.
Authorization
.
ApplyTo
(
&
c
.
Authorization
);
err
!=
nil
{
return
err
}
}
// sync back to component config
...
...
cmd/kube-controller-manager/app/options/options_test.go
View file @
5fa8b4b2
...
...
@@ -264,6 +264,22 @@ func TestAddFlags(t *testing.T) {
BindPort
:
int
(
10000
),
BindNetwork
:
"tcp"
,
},
Authentication
:
&
apiserveroptions
.
DelegatingAuthenticationOptions
{
CacheTTL
:
10
*
time
.
Second
,
ClientCert
:
apiserveroptions
.
ClientCertAuthenticationOptions
{},
RequestHeader
:
apiserveroptions
.
RequestHeaderAuthenticationOptions
{
UsernameHeaders
:
[]
string
{
"x-remote-user"
},
GroupHeaders
:
[]
string
{
"x-remote-group"
},
ExtraHeaderPrefixes
:
[]
string
{
"x-remote-extra-"
},
},
RemoteKubeConfigFileOptional
:
true
,
},
Authorization
:
&
apiserveroptions
.
DelegatingAuthorizationOptions
{
AllowCacheTTL
:
10
*
time
.
Second
,
DenyCacheTTL
:
10
*
time
.
Second
,
RemoteKubeConfigFileOptional
:
true
,
AlwaysAllowPaths
:
[]
string
{
"/healthz"
},
// note: this does not match /healthz/ or /healthz/*
},
Kubeconfig
:
"/kubeconfig"
,
Master
:
"192.168.4.20"
,
}
...
...
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