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
c1392ec5
Commit
c1392ec5
authored
Jun 03, 2016
by
k8s-merge-robot
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #26747 from freehan/kubenetdir
Automatic merge from submit-queue pass NetworkPluginDir to kubenet to unblock GCI kubenet integration #26379 cc: @andyzheng0831
parents
69e45dc3
e9f8c70e
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
8 additions
and
5 deletions
+8
-5
plugins.go
cmd/kubelet/app/plugins.go
+1
-1
kubenet_linux.go
pkg/kubelet/network/kubenet/kubenet_linux.go
+6
-3
kubenet_unsupported.go
pkg/kubelet/network/kubenet/kubenet_unsupported.go
+1
-1
No files found.
cmd/kubelet/app/plugins.go
View file @
c1392ec5
...
...
@@ -92,7 +92,7 @@ func ProbeNetworkPlugins(pluginDir string) []network.NetworkPlugin {
// for each existing plugin, add to the list
allPlugins
=
append
(
allPlugins
,
exec
.
ProbeNetworkPlugins
(
pluginDir
)
...
)
allPlugins
=
append
(
allPlugins
,
cni
.
ProbeNetworkPlugins
(
pluginDir
)
...
)
allPlugins
=
append
(
allPlugins
,
kubenet
.
NewPlugin
())
allPlugins
=
append
(
allPlugins
,
kubenet
.
NewPlugin
(
pluginDir
))
return
allPlugins
}
pkg/kubelet/network/kubenet/kubenet_linux.go
View file @
c1392ec5
...
...
@@ -77,20 +77,23 @@ type kubenetNetworkPlugin struct {
hairpinMode
componentconfig
.
HairpinMode
hostPortMap
map
[
hostport
]
closeable
iptables
utiliptables
.
Interface
// vendorDir is passed by kubelet network-plugin-dir parameter.
// kubenet will search for cni binaries in DefaultCNIDir first, then continue to vendorDir.
vendorDir
string
}
func
NewPlugin
()
network
.
NetworkPlugin
{
func
NewPlugin
(
networkPluginDir
string
)
network
.
NetworkPlugin
{
protocol
:=
utiliptables
.
ProtocolIpv4
execer
:=
utilexec
.
New
()
dbus
:=
utildbus
.
New
()
iptInterface
:=
utiliptables
.
New
(
execer
,
dbus
,
protocol
)
return
&
kubenetNetworkPlugin
{
podIPs
:
make
(
map
[
kubecontainer
.
ContainerID
]
string
),
hostPortMap
:
make
(
map
[
hostport
]
closeable
),
MTU
:
1460
,
//TODO: don't hardcode this
execer
:
utilexec
.
New
(),
iptables
:
iptInterface
,
vendorDir
:
networkPluginDir
,
}
}
...
...
@@ -98,7 +101,7 @@ func (plugin *kubenetNetworkPlugin) Init(host network.Host, hairpinMode componen
plugin
.
host
=
host
plugin
.
hairpinMode
=
hairpinMode
plugin
.
cniConfig
=
&
libcni
.
CNIConfig
{
Path
:
[]
string
{
DefaultCNIDir
},
Path
:
[]
string
{
DefaultCNIDir
,
plugin
.
vendorDir
},
}
if
link
,
err
:=
findMinMTU
();
err
==
nil
{
...
...
pkg/kubelet/network/kubenet/kubenet_unsupported.go
View file @
c1392ec5
...
...
@@ -30,7 +30,7 @@ type kubenetNetworkPlugin struct {
network
.
NoopNetworkPlugin
}
func
NewPlugin
()
network
.
NetworkPlugin
{
func
NewPlugin
(
networkPluginDir
string
)
network
.
NetworkPlugin
{
return
&
kubenetNetworkPlugin
{}
}
...
...
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