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
a47e99e3
Commit
a47e99e3
authored
Jan 11, 2019
by
ksubrmnn
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add Windows flags for KubeProxyConfiguration
parent
a4272099
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
110 additions
and
0 deletions
+110
-0
init_windows.go
cmd/kube-proxy/app/init_windows.go
+3
-0
server_windows.go
cmd/kube-proxy/app/server_windows.go
+1
-0
types.go
pkg/proxy/apis/config/types.go
+16
-0
zz_generated.conversion.go
pkg/proxy/apis/config/v1alpha1/zz_generated.conversion.go
+40
-0
zz_generated.deepcopy.go
pkg/proxy/apis/config/zz_generated.deepcopy.go
+17
-0
types.go
staging/src/k8s.io/kube-proxy/config/v1alpha1/types.go
+16
-0
zz_generated.deepcopy.go
...8s.io/kube-proxy/config/v1alpha1/zz_generated.deepcopy.go
+17
-0
No files found.
cmd/kube-proxy/app/init_windows.go
View file @
a47e99e3
...
...
@@ -37,4 +37,7 @@ func initForOS(windowsService bool) error {
func
(
o
*
Options
)
addOSFlags
(
fs
*
pflag
.
FlagSet
)
{
fs
.
BoolVar
(
&
o
.
WindowsService
,
"windows-service"
,
o
.
WindowsService
,
"Enable Windows Service Control Manager API integration"
)
fs
.
StringVar
(
&
o
.
config
.
Winkernel
.
SourceVip
,
"source-vip"
,
o
.
config
.
Winkernel
.
SourceVip
,
"The IP address of the source VIP for non-DSR."
)
fs
.
StringVar
(
&
o
.
config
.
Winkernel
.
NetworkName
,
"network-name"
,
o
.
config
.
Winkernel
.
NetworkName
,
"The name of the cluster network."
)
fs
.
BoolVar
(
&
o
.
config
.
Winkernel
.
EnableDSR
,
"enable-dsr"
,
o
.
config
.
Winkernel
.
EnableDSR
,
"If true make kube-proxy apply DSR policies for service VIP"
)
}
cmd/kube-proxy/app/server_windows.go
View file @
a47e99e3
...
...
@@ -110,6 +110,7 @@ func newProxyServer(config *proxyconfigapi.KubeProxyConfiguration, cleanupAndExi
utilnode
.
GetNodeIP
(
client
,
hostname
),
recorder
,
healthzUpdater
,
config
.
Winkernel
,
)
if
err
!=
nil
{
return
nil
,
fmt
.
Errorf
(
"unable to create proxier: %v"
,
err
)
...
...
pkg/proxy/apis/config/types.go
View file @
a47e99e3
...
...
@@ -78,6 +78,20 @@ type KubeProxyConntrackConfiguration struct {
TCPCloseWaitTimeout
*
metav1
.
Duration
}
// KubeProxyWinkernelConfiguration contains Windows/HNS settings for
// the Kubernetes proxy server.
type
KubeProxyWinkernelConfiguration
struct
{
// networkName is the name of the network kube-proxy will use
// to create endpoints and policies
NetworkName
string
// sourceVip is the IP address of the source VIP endoint used for
// NAT when loadbalancing
SourceVip
string
// enableDSR tells kube-proxy whether HNS policies should be created
// with DSR
EnableDSR
bool
}
// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object
// KubeProxyConfiguration contains everything necessary to configure the
...
...
@@ -140,6 +154,8 @@ type KubeProxyConfiguration struct {
// If set it to a non-zero IP block, kube-proxy will filter that down to just the IPs that applied to the node.
// An empty string slice is meant to select all network interfaces.
NodePortAddresses
[]
string
// winkernel contains winkernel-related configuration options.
Winkernel
KubeProxyWinkernelConfiguration
}
// Currently, three modes of proxy are available in Linux platform: 'userspace' (older, going to be EOL), 'iptables'
...
...
pkg/proxy/apis/config/v1alpha1/zz_generated.conversion.go
View file @
a47e99e3
...
...
@@ -78,6 +78,16 @@ func RegisterConversions(s *runtime.Scheme) error {
});
err
!=
nil
{
return
err
}
if
err
:=
s
.
AddGeneratedConversionFunc
((
*
v1alpha1
.
KubeProxyWinkernelConfiguration
)(
nil
),
(
*
config
.
KubeProxyWinkernelConfiguration
)(
nil
),
func
(
a
,
b
interface
{},
scope
conversion
.
Scope
)
error
{
return
Convert_v1alpha1_KubeProxyWinkernelConfiguration_To_config_KubeProxyWinkernelConfiguration
(
a
.
(
*
v1alpha1
.
KubeProxyWinkernelConfiguration
),
b
.
(
*
config
.
KubeProxyWinkernelConfiguration
),
scope
)
});
err
!=
nil
{
return
err
}
if
err
:=
s
.
AddGeneratedConversionFunc
((
*
config
.
KubeProxyWinkernelConfiguration
)(
nil
),
(
*
v1alpha1
.
KubeProxyWinkernelConfiguration
)(
nil
),
func
(
a
,
b
interface
{},
scope
conversion
.
Scope
)
error
{
return
Convert_config_KubeProxyWinkernelConfiguration_To_v1alpha1_KubeProxyWinkernelConfiguration
(
a
.
(
*
config
.
KubeProxyWinkernelConfiguration
),
b
.
(
*
v1alpha1
.
KubeProxyWinkernelConfiguration
),
scope
)
});
err
!=
nil
{
return
err
}
return
nil
}
...
...
@@ -108,6 +118,9 @@ func autoConvert_v1alpha1_KubeProxyConfiguration_To_config_KubeProxyConfiguratio
}
out
.
ConfigSyncPeriod
=
in
.
ConfigSyncPeriod
out
.
NodePortAddresses
=
*
(
*
[]
string
)(
unsafe
.
Pointer
(
&
in
.
NodePortAddresses
))
if
err
:=
Convert_v1alpha1_KubeProxyWinkernelConfiguration_To_config_KubeProxyWinkernelConfiguration
(
&
in
.
Winkernel
,
&
out
.
Winkernel
,
s
);
err
!=
nil
{
return
err
}
return
nil
}
...
...
@@ -143,6 +156,9 @@ func autoConvert_config_KubeProxyConfiguration_To_v1alpha1_KubeProxyConfiguratio
}
out
.
ConfigSyncPeriod
=
in
.
ConfigSyncPeriod
out
.
NodePortAddresses
=
*
(
*
[]
string
)(
unsafe
.
Pointer
(
&
in
.
NodePortAddresses
))
if
err
:=
Convert_config_KubeProxyWinkernelConfiguration_To_v1alpha1_KubeProxyWinkernelConfiguration
(
&
in
.
Winkernel
,
&
out
.
Winkernel
,
s
);
err
!=
nil
{
return
err
}
return
nil
}
...
...
@@ -230,3 +246,27 @@ func autoConvert_config_KubeProxyIPVSConfiguration_To_v1alpha1_KubeProxyIPVSConf
func
Convert_config_KubeProxyIPVSConfiguration_To_v1alpha1_KubeProxyIPVSConfiguration
(
in
*
config
.
KubeProxyIPVSConfiguration
,
out
*
v1alpha1
.
KubeProxyIPVSConfiguration
,
s
conversion
.
Scope
)
error
{
return
autoConvert_config_KubeProxyIPVSConfiguration_To_v1alpha1_KubeProxyIPVSConfiguration
(
in
,
out
,
s
)
}
func
autoConvert_v1alpha1_KubeProxyWinkernelConfiguration_To_config_KubeProxyWinkernelConfiguration
(
in
*
v1alpha1
.
KubeProxyWinkernelConfiguration
,
out
*
config
.
KubeProxyWinkernelConfiguration
,
s
conversion
.
Scope
)
error
{
out
.
NetworkName
=
in
.
NetworkName
out
.
SourceVip
=
in
.
SourceVip
out
.
EnableDSR
=
in
.
EnableDSR
return
nil
}
// Convert_v1alpha1_KubeProxyWinkernelConfiguration_To_config_KubeProxyWinkernelConfiguration is an autogenerated conversion function.
func
Convert_v1alpha1_KubeProxyWinkernelConfiguration_To_config_KubeProxyWinkernelConfiguration
(
in
*
v1alpha1
.
KubeProxyWinkernelConfiguration
,
out
*
config
.
KubeProxyWinkernelConfiguration
,
s
conversion
.
Scope
)
error
{
return
autoConvert_v1alpha1_KubeProxyWinkernelConfiguration_To_config_KubeProxyWinkernelConfiguration
(
in
,
out
,
s
)
}
func
autoConvert_config_KubeProxyWinkernelConfiguration_To_v1alpha1_KubeProxyWinkernelConfiguration
(
in
*
config
.
KubeProxyWinkernelConfiguration
,
out
*
v1alpha1
.
KubeProxyWinkernelConfiguration
,
s
conversion
.
Scope
)
error
{
out
.
NetworkName
=
in
.
NetworkName
out
.
SourceVip
=
in
.
SourceVip
out
.
EnableDSR
=
in
.
EnableDSR
return
nil
}
// Convert_config_KubeProxyWinkernelConfiguration_To_v1alpha1_KubeProxyWinkernelConfiguration is an autogenerated conversion function.
func
Convert_config_KubeProxyWinkernelConfiguration_To_v1alpha1_KubeProxyWinkernelConfiguration
(
in
*
config
.
KubeProxyWinkernelConfiguration
,
out
*
v1alpha1
.
KubeProxyWinkernelConfiguration
,
s
conversion
.
Scope
)
error
{
return
autoConvert_config_KubeProxyWinkernelConfiguration_To_v1alpha1_KubeProxyWinkernelConfiguration
(
in
,
out
,
s
)
}
pkg/proxy/apis/config/zz_generated.deepcopy.go
View file @
a47e99e3
...
...
@@ -74,6 +74,7 @@ func (in *KubeProxyConfiguration) DeepCopyInto(out *KubeProxyConfiguration) {
*
out
=
make
([]
string
,
len
(
*
in
))
copy
(
*
out
,
*
in
)
}
out
.
Winkernel
=
in
.
Winkernel
return
}
...
...
@@ -181,3 +182,19 @@ func (in *KubeProxyIPVSConfiguration) DeepCopy() *KubeProxyIPVSConfiguration {
in
.
DeepCopyInto
(
out
)
return
out
}
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
func
(
in
*
KubeProxyWinkernelConfiguration
)
DeepCopyInto
(
out
*
KubeProxyWinkernelConfiguration
)
{
*
out
=
*
in
return
}
// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new KubeProxyWinkernelConfiguration.
func
(
in
*
KubeProxyWinkernelConfiguration
)
DeepCopy
()
*
KubeProxyWinkernelConfiguration
{
if
in
==
nil
{
return
nil
}
out
:=
new
(
KubeProxyWinkernelConfiguration
)
in
.
DeepCopyInto
(
out
)
return
out
}
staging/src/k8s.io/kube-proxy/config/v1alpha1/types.go
View file @
a47e99e3
...
...
@@ -74,6 +74,20 @@ type KubeProxyConntrackConfiguration struct {
TCPCloseWaitTimeout
*
metav1
.
Duration
`json:"tcpCloseWaitTimeout"`
}
// KubeProxyWinkernelConfiguration contains Windows/HNS settings for
// the Kubernetes proxy server.
type
KubeProxyWinkernelConfiguration
struct
{
// networkName is the name of the network kube-proxy will use
// to create endpoints and policies
NetworkName
string
`json:"networkName"`
// sourceVip is the IP address of the source VIP endoint used for
// NAT when loadbalancing
SourceVip
string
`json:"sourceVip"`
// enableDSR tells kube-proxy whether HNS policies should be created
// with DSR
EnableDSR
bool
`json:"enableDSR"`
}
// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object
// KubeProxyConfiguration contains everything necessary to configure the
...
...
@@ -136,6 +150,8 @@ type KubeProxyConfiguration struct {
// If set it to a non-zero IP block, kube-proxy will filter that down to just the IPs that applied to the node.
// An empty string slice is meant to select all network interfaces.
NodePortAddresses
[]
string
`json:"nodePortAddresses"`
// winkernel contains winkernel-related configuration options.
Winkernel
KubeProxyWinkernelConfiguration
`json:"winkernel"`
}
// Currently, three modes of proxy are available in Linux platform: 'userspace' (older, going to be EOL), 'iptables'
...
...
staging/src/k8s.io/kube-proxy/config/v1alpha1/zz_generated.deepcopy.go
View file @
a47e99e3
...
...
@@ -52,6 +52,7 @@ func (in *KubeProxyConfiguration) DeepCopyInto(out *KubeProxyConfiguration) {
*
out
=
make
([]
string
,
len
(
*
in
))
copy
(
*
out
,
*
in
)
}
out
.
Winkernel
=
in
.
Winkernel
return
}
...
...
@@ -159,3 +160,19 @@ func (in *KubeProxyIPVSConfiguration) DeepCopy() *KubeProxyIPVSConfiguration {
in
.
DeepCopyInto
(
out
)
return
out
}
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
func
(
in
*
KubeProxyWinkernelConfiguration
)
DeepCopyInto
(
out
*
KubeProxyWinkernelConfiguration
)
{
*
out
=
*
in
return
}
// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new KubeProxyWinkernelConfiguration.
func
(
in
*
KubeProxyWinkernelConfiguration
)
DeepCopy
()
*
KubeProxyWinkernelConfiguration
{
if
in
==
nil
{
return
nil
}
out
:=
new
(
KubeProxyWinkernelConfiguration
)
in
.
DeepCopyInto
(
out
)
return
out
}
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