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
4cc3b2e6
Commit
4cc3b2e6
authored
Aug 07, 2018
by
Dr. Stefan Schimanski
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
kube-controller-manager: enable secure loopback
parent
5fa8b4b2
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
17 additions
and
11 deletions
+17
-11
config.go
cmd/kube-controller-manager/app/config/config.go
+6
-0
options.go
cmd/kube-controller-manager/app/options/options.go
+7
-7
options_test.go
cmd/kube-controller-manager/app/options/options_test.go
+4
-4
No files found.
cmd/kube-controller-manager/app/config/config.go
View file @
4cc3b2e6
...
@@ -29,6 +29,9 @@ type Config struct {
...
@@ -29,6 +29,9 @@ type Config struct {
ComponentConfig
componentconfig
.
KubeControllerManagerConfiguration
ComponentConfig
componentconfig
.
KubeControllerManagerConfiguration
SecureServing
*
apiserver
.
SecureServingInfo
SecureServing
*
apiserver
.
SecureServingInfo
// LoopbackClientConfig is a config for a privileged loopback connection
LoopbackClientConfig
*
restclient
.
Config
// TODO: remove deprecated insecure serving
// TODO: remove deprecated insecure serving
InsecureServing
*
apiserver
.
DeprecatedInsecureServingInfo
InsecureServing
*
apiserver
.
DeprecatedInsecureServingInfo
Authentication
apiserver
.
AuthenticationInfo
Authentication
apiserver
.
AuthenticationInfo
...
@@ -60,5 +63,8 @@ type CompletedConfig struct {
...
@@ -60,5 +63,8 @@ type CompletedConfig struct {
// Complete fills in any fields not set that are required to have valid data. It's mutating the receiver.
// Complete fills in any fields not set that are required to have valid data. It's mutating the receiver.
func
(
c
*
Config
)
Complete
()
*
CompletedConfig
{
func
(
c
*
Config
)
Complete
()
*
CompletedConfig
{
cc
:=
completedConfig
{
c
}
cc
:=
completedConfig
{
c
}
apiserver
.
AuthorizeClientBearerToken
(
c
.
LoopbackClientConfig
,
&
c
.
Authentication
,
&
c
.
Authorization
)
return
&
CompletedConfig
{
&
cc
}
return
&
CompletedConfig
{
&
cc
}
}
}
cmd/kube-controller-manager/app/options/options.go
View file @
4cc3b2e6
...
@@ -83,9 +83,9 @@ type KubeControllerManagerOptions struct {
...
@@ -83,9 +83,9 @@ type KubeControllerManagerOptions struct {
Controllers
[]
string
Controllers
[]
string
ExternalCloudVolumePlugin
string
ExternalCloudVolumePlugin
string
SecureServing
*
apiserveroptions
.
SecureServingOptions
SecureServing
*
apiserveroptions
.
SecureServingOptions
WithLoopback
// TODO: remove insecure serving mode
// TODO: remove insecure serving mode
InsecureServing
*
apiserveroptions
.
DeprecatedInsecureServingOptions
InsecureServing
*
apiserveroptions
.
DeprecatedInsecureServingOptions
WithLoopback
Authentication
*
apiserveroptions
.
DelegatingAuthenticationOptions
Authentication
*
apiserveroptions
.
DelegatingAuthenticationOptions
Authorization
*
apiserveroptions
.
DelegatingAuthorizationOptions
Authorization
*
apiserveroptions
.
DelegatingAuthorizationOptions
...
@@ -179,12 +179,12 @@ func NewKubeControllerManagerOptions() (*KubeControllerManagerOptions, error) {
...
@@ -179,12 +179,12 @@ func NewKubeControllerManagerOptions() (*KubeControllerManagerOptions, error) {
ConcurrentServiceSyncs
:
componentConfig
.
ServiceController
.
ConcurrentServiceSyncs
,
ConcurrentServiceSyncs
:
componentConfig
.
ServiceController
.
ConcurrentServiceSyncs
,
},
},
Controllers
:
componentConfig
.
Controllers
,
Controllers
:
componentConfig
.
Controllers
,
SecureServing
:
apiserveroptions
.
NewSecureServingOptions
(),
SecureServing
:
apiserveroptions
.
NewSecureServingOptions
()
.
WithLoopback
()
,
InsecureServing
:
&
apiserveroptions
.
DeprecatedInsecureServingOptions
{
InsecureServing
:
(
&
apiserveroptions
.
DeprecatedInsecureServingOptions
{
BindAddress
:
net
.
ParseIP
(
componentConfig
.
KubeCloudShared
.
Address
),
BindAddress
:
net
.
ParseIP
(
componentConfig
.
KubeCloudShared
.
Address
),
BindPort
:
int
(
componentConfig
.
KubeCloudShared
.
Port
),
BindPort
:
int
(
componentConfig
.
KubeCloudShared
.
Port
),
BindNetwork
:
"tcp"
,
BindNetwork
:
"tcp"
,
},
}
)
.
WithLoopback
()
,
Authentication
:
apiserveroptions
.
NewDelegatingAuthenticationOptions
(),
Authentication
:
apiserveroptions
.
NewDelegatingAuthenticationOptions
(),
Authorization
:
apiserveroptions
.
NewDelegatingAuthorizationOptions
(),
Authorization
:
apiserveroptions
.
NewDelegatingAuthorizationOptions
(),
}
}
...
@@ -347,10 +347,10 @@ func (s *KubeControllerManagerOptions) ApplyTo(c *kubecontrollerconfig.Config) e
...
@@ -347,10 +347,10 @@ func (s *KubeControllerManagerOptions) ApplyTo(c *kubecontrollerconfig.Config) e
if
err
:=
s
.
ServiceController
.
ApplyTo
(
&
c
.
ComponentConfig
.
ServiceController
);
err
!=
nil
{
if
err
:=
s
.
ServiceController
.
ApplyTo
(
&
c
.
ComponentConfig
.
ServiceController
);
err
!=
nil
{
return
err
return
err
}
}
if
err
:=
s
.
InsecureServing
.
ApplyTo
(
&
c
.
InsecureServing
);
err
!=
nil
{
if
err
:=
s
.
InsecureServing
.
ApplyTo
(
&
c
.
InsecureServing
,
&
c
.
LoopbackClientConfig
);
err
!=
nil
{
return
err
return
err
}
}
if
err
:=
s
.
SecureServing
.
ApplyTo
(
&
c
.
SecureServing
);
err
!=
nil
{
if
err
:=
s
.
SecureServing
.
ApplyTo
(
&
c
.
SecureServing
,
&
c
.
LoopbackClientConfig
);
err
!=
nil
{
return
err
return
err
}
}
if
s
.
SecureServing
.
BindPort
!=
0
||
s
.
SecureServing
.
Listener
!=
nil
{
if
s
.
SecureServing
.
BindPort
!=
0
||
s
.
SecureServing
.
Listener
!=
nil
{
...
...
cmd/kube-controller-manager/app/options/options_test.go
View file @
4cc3b2e6
...
@@ -250,7 +250,7 @@ func TestAddFlags(t *testing.T) {
...
@@ -250,7 +250,7 @@ func TestAddFlags(t *testing.T) {
ConcurrentServiceSyncs
:
2
,
ConcurrentServiceSyncs
:
2
,
},
},
Controllers
:
[]
string
{
"foo"
,
"bar"
},
Controllers
:
[]
string
{
"foo"
,
"bar"
},
SecureServing
:
&
apiserveroptions
.
SecureServingOptions
{
SecureServing
:
(
&
apiserveroptions
.
SecureServingOptions
{
BindPort
:
10001
,
BindPort
:
10001
,
BindAddress
:
net
.
ParseIP
(
"192.168.4.21"
),
BindAddress
:
net
.
ParseIP
(
"192.168.4.21"
),
ServerCert
:
apiserveroptions
.
GeneratableKeyCert
{
ServerCert
:
apiserveroptions
.
GeneratableKeyCert
{
...
@@ -258,12 +258,12 @@ func TestAddFlags(t *testing.T) {
...
@@ -258,12 +258,12 @@ func TestAddFlags(t *testing.T) {
PairName
:
"kube-controller-manager"
,
PairName
:
"kube-controller-manager"
,
},
},
HTTP2MaxStreamsPerConnection
:
47
,
HTTP2MaxStreamsPerConnection
:
47
,
},
}
)
.
WithLoopback
()
,
InsecureServing
:
&
apiserveroptions
.
DeprecatedInsecureServingOptions
{
InsecureServing
:
(
&
apiserveroptions
.
DeprecatedInsecureServingOptions
{
BindAddress
:
net
.
ParseIP
(
"192.168.4.10"
),
BindAddress
:
net
.
ParseIP
(
"192.168.4.10"
),
BindPort
:
int
(
10000
),
BindPort
:
int
(
10000
),
BindNetwork
:
"tcp"
,
BindNetwork
:
"tcp"
,
},
}
)
.
WithLoopback
()
,
Authentication
:
&
apiserveroptions
.
DelegatingAuthenticationOptions
{
Authentication
:
&
apiserveroptions
.
DelegatingAuthenticationOptions
{
CacheTTL
:
10
*
time
.
Second
,
CacheTTL
:
10
*
time
.
Second
,
ClientCert
:
apiserveroptions
.
ClientCertAuthenticationOptions
{},
ClientCert
:
apiserveroptions
.
ClientCertAuthenticationOptions
{},
...
...
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