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
0c2ceeb8
Commit
0c2ceeb8
authored
Jul 05, 2017
by
Minhan Xia
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
share iptables util client within kubenet
parent
96d8ab72
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
6 additions
and
14 deletions
+6
-14
BUILD
pkg/kubelet/network/hostport/BUILD
+0
-2
hostport_manager.go
pkg/kubelet/network/hostport/hostport_manager.go
+2
-5
hostport_syncer.go
pkg/kubelet/network/hostport/hostport_syncer.go
+2
-5
kubenet_linux.go
pkg/kubelet/network/kubenet/kubenet_linux.go
+2
-2
No files found.
pkg/kubelet/network/hostport/BUILD
View file @
0c2ceeb8
...
@@ -19,8 +19,6 @@ go_library(
...
@@ -19,8 +19,6 @@ go_library(
tags = ["automanaged"],
tags = ["automanaged"],
deps = [
deps = [
"//pkg/proxy/iptables:go_default_library",
"//pkg/proxy/iptables:go_default_library",
"//pkg/util/dbus:go_default_library",
"//pkg/util/exec:go_default_library",
"//pkg/util/iptables:go_default_library",
"//pkg/util/iptables:go_default_library",
"//vendor/github.com/golang/glog:go_default_library",
"//vendor/github.com/golang/glog:go_default_library",
"//vendor/k8s.io/api/core/v1:go_default_library",
"//vendor/k8s.io/api/core/v1:go_default_library",
...
...
pkg/kubelet/network/hostport/hostport_manager.go
View file @
0c2ceeb8
...
@@ -27,8 +27,6 @@ import (
...
@@ -27,8 +27,6 @@ import (
"github.com/golang/glog"
"github.com/golang/glog"
utilerrors
"k8s.io/apimachinery/pkg/util/errors"
utilerrors
"k8s.io/apimachinery/pkg/util/errors"
iptablesproxy
"k8s.io/kubernetes/pkg/proxy/iptables"
iptablesproxy
"k8s.io/kubernetes/pkg/proxy/iptables"
utildbus
"k8s.io/kubernetes/pkg/util/dbus"
utilexec
"k8s.io/kubernetes/pkg/util/exec"
utiliptables
"k8s.io/kubernetes/pkg/util/iptables"
utiliptables
"k8s.io/kubernetes/pkg/util/iptables"
)
)
...
@@ -51,11 +49,10 @@ type hostportManager struct {
...
@@ -51,11 +49,10 @@ type hostportManager struct {
mu
sync
.
Mutex
mu
sync
.
Mutex
}
}
func
NewHostportManager
()
HostPortManager
{
func
NewHostportManager
(
iptables
utiliptables
.
Interface
)
HostPortManager
{
iptInterface
:=
utiliptables
.
New
(
utilexec
.
New
(),
utildbus
.
New
(),
utiliptables
.
ProtocolIpv4
)
return
&
hostportManager
{
return
&
hostportManager
{
hostPortMap
:
make
(
map
[
hostport
]
closeable
),
hostPortMap
:
make
(
map
[
hostport
]
closeable
),
iptables
:
ipt
Interface
,
iptables
:
ipt
ables
,
portOpener
:
openLocalPort
,
portOpener
:
openLocalPort
,
}
}
}
}
...
...
pkg/kubelet/network/hostport/hostport_syncer.go
View file @
0c2ceeb8
...
@@ -27,8 +27,6 @@ import (
...
@@ -27,8 +27,6 @@ import (
"github.com/golang/glog"
"github.com/golang/glog"
iptablesproxy
"k8s.io/kubernetes/pkg/proxy/iptables"
iptablesproxy
"k8s.io/kubernetes/pkg/proxy/iptables"
utildbus
"k8s.io/kubernetes/pkg/util/dbus"
utilexec
"k8s.io/kubernetes/pkg/util/exec"
utiliptables
"k8s.io/kubernetes/pkg/util/iptables"
utiliptables
"k8s.io/kubernetes/pkg/util/iptables"
)
)
...
@@ -49,11 +47,10 @@ type hostportSyncer struct {
...
@@ -49,11 +47,10 @@ type hostportSyncer struct {
portOpener
hostportOpener
portOpener
hostportOpener
}
}
func
NewHostportSyncer
()
HostportSyncer
{
func
NewHostportSyncer
(
iptables
utiliptables
.
Interface
)
HostportSyncer
{
iptInterface
:=
utiliptables
.
New
(
utilexec
.
New
(),
utildbus
.
New
(),
utiliptables
.
ProtocolIpv4
)
return
&
hostportSyncer
{
return
&
hostportSyncer
{
hostPortMap
:
make
(
map
[
hostport
]
closeable
),
hostPortMap
:
make
(
map
[
hostport
]
closeable
),
iptables
:
ipt
Interface
,
iptables
:
ipt
ables
,
portOpener
:
openLocalPort
,
portOpener
:
openLocalPort
,
}
}
}
}
...
...
pkg/kubelet/network/kubenet/kubenet_linux.go
View file @
0c2ceeb8
...
@@ -118,8 +118,8 @@ func NewPlugin(networkPluginDir string) network.NetworkPlugin {
...
@@ -118,8 +118,8 @@ func NewPlugin(networkPluginDir string) network.NetworkPlugin {
iptables
:
iptInterface
,
iptables
:
iptInterface
,
sysctl
:
sysctl
,
sysctl
:
sysctl
,
vendorDir
:
networkPluginDir
,
vendorDir
:
networkPluginDir
,
hostportSyncer
:
hostport
.
NewHostportSyncer
(),
hostportSyncer
:
hostport
.
NewHostportSyncer
(
iptInterface
),
hostportManager
:
hostport
.
NewHostportManager
(),
hostportManager
:
hostport
.
NewHostportManager
(
iptInterface
),
nonMasqueradeCIDR
:
"10.0.0.0/8"
,
nonMasqueradeCIDR
:
"10.0.0.0/8"
,
}
}
}
}
...
...
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