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
5d6abf59
Commit
5d6abf59
authored
Aug 09, 2016
by
Girish Kalele
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
kube-proxy: Propagate hostname to iptables proxier
parent
4d9762e7
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
4 additions
and
2 deletions
+4
-2
server.go
cmd/kube-proxy/app/server.go
+1
-1
proxier.go
pkg/proxy/iptables/proxier.go
+3
-1
No files found.
cmd/kube-proxy/app/server.go
View file @
5d6abf59
...
...
@@ -205,7 +205,7 @@ func NewProxyServerDefault(config *options.ProxyServerConfig) (*ProxyServer, err
return
nil
,
fmt
.
Errorf
(
"Unable to read IPTablesMasqueradeBit from config"
)
}
proxierIptables
,
err
:=
iptables
.
NewProxier
(
iptInterface
,
execer
,
config
.
IPTablesSyncPeriod
.
Duration
,
config
.
MasqueradeAll
,
int
(
*
config
.
IPTablesMasqueradeBit
),
config
.
ClusterCIDR
)
proxierIptables
,
err
:=
iptables
.
NewProxier
(
iptInterface
,
execer
,
config
.
IPTablesSyncPeriod
.
Duration
,
config
.
MasqueradeAll
,
int
(
*
config
.
IPTablesMasqueradeBit
),
config
.
ClusterCIDR
,
hostname
)
if
err
!=
nil
{
glog
.
Fatalf
(
"Unable to create proxier: %v"
,
err
)
}
...
...
pkg/proxy/iptables/proxier.go
View file @
5d6abf59
...
...
@@ -163,6 +163,7 @@ type Proxier struct {
masqueradeMark
string
exec
utilexec
.
Interface
clusterCIDR
string
hostname
string
}
type
localPort
struct
{
...
...
@@ -188,7 +189,7 @@ var _ proxy.ProxyProvider = &Proxier{}
// An error will be returned if iptables fails to update or acquire the initial lock.
// Once a proxier is created, it will keep iptables up to date in the background and
// will not terminate if a particular iptables call fails.
func
NewProxier
(
ipt
utiliptables
.
Interface
,
exec
utilexec
.
Interface
,
syncPeriod
time
.
Duration
,
masqueradeAll
bool
,
masqueradeBit
int
,
clusterCIDR
string
)
(
*
Proxier
,
error
)
{
func
NewProxier
(
ipt
utiliptables
.
Interface
,
exec
utilexec
.
Interface
,
syncPeriod
time
.
Duration
,
masqueradeAll
bool
,
masqueradeBit
int
,
clusterCIDR
string
,
hostname
string
)
(
*
Proxier
,
error
)
{
// Set the route_localnet sysctl we need for
if
err
:=
utilsysctl
.
SetSysctl
(
sysctlRouteLocalnet
,
1
);
err
!=
nil
{
return
nil
,
fmt
.
Errorf
(
"can't set sysctl %s: %v"
,
sysctlRouteLocalnet
,
err
)
...
...
@@ -218,6 +219,7 @@ func NewProxier(ipt utiliptables.Interface, exec utilexec.Interface, syncPeriod
masqueradeMark
:
masqueradeMark
,
exec
:
exec
,
clusterCIDR
:
clusterCIDR
,
hostname
:
hostname
,
},
nil
}
...
...
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