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
f690220b
Commit
f690220b
authored
Apr 06, 2016
by
Minhan Xia
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #23704 from freehan/kubenet
Update cni binary #23712 is depending on this. Not sure why this one gets in first. Hand merging this
parents
b141c690
d026d7ec
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
5 additions
and
2 deletions
+5
-2
init.sls
cluster/saltbase/salt/cni/init.sls
+2
-2
kubenet_linux.go
pkg/kubelet/network/kubenet/kubenet_linux.go
+3
-0
No files found.
cluster/saltbase/salt/cni/init.sls
View file @
f690220b
...
@@ -19,9 +19,9 @@ cni-tar:
...
@@ -19,9 +19,9 @@ cni-tar:
- user: root
- user: root
- name: /opt/cni
- name: /opt/cni
- makedirs: True
- makedirs: True
- source: https://storage.googleapis.com/kubernetes-release/network-plugins/cni-
0921492
6.tar.gz
- source: https://storage.googleapis.com/kubernetes-release/network-plugins/cni-
42c4cb842dad606a84e93aad5a4484ded48e304
6.tar.gz
- tar_options: v
- tar_options: v
- source_hash: md5=
58f8631f912dd88be6a0920775db7274
- source_hash: md5=
8cee1d59f01a27e8c2c10c120dce1e7d
- archive_format: tar
- archive_format: tar
- if_missing: /opt/cni/bin
- if_missing: /opt/cni/bin
...
...
pkg/kubelet/network/kubenet/kubenet_linux.go
View file @
f690220b
...
@@ -141,6 +141,7 @@ func (plugin *kubenetNetworkPlugin) Event(name string, details map[string]interf
...
@@ -141,6 +141,7 @@ func (plugin *kubenetNetworkPlugin) Event(name string, details map[string]interf
cidr
.
IP
.
To4
()[
3
]
+=
1
cidr
.
IP
.
To4
()[
3
]
+=
1
json
:=
fmt
.
Sprintf
(
NET_CONFIG_TEMPLATE
,
BridgeName
,
plugin
.
MTU
,
network
.
DefaultInterfaceName
,
podCIDR
,
cidr
.
IP
.
String
())
json
:=
fmt
.
Sprintf
(
NET_CONFIG_TEMPLATE
,
BridgeName
,
plugin
.
MTU
,
network
.
DefaultInterfaceName
,
podCIDR
,
cidr
.
IP
.
String
())
glog
.
V
(
2
)
.
Infof
(
"CNI network config set to %v"
,
json
)
plugin
.
netConfig
,
err
=
libcni
.
ConfFromBytes
([]
byte
(
json
))
plugin
.
netConfig
,
err
=
libcni
.
ConfFromBytes
([]
byte
(
json
))
if
err
==
nil
{
if
err
==
nil
{
glog
.
V
(
5
)
.
Infof
(
"CNI network config:
\n
%s"
,
json
)
glog
.
V
(
5
)
.
Infof
(
"CNI network config:
\n
%s"
,
json
)
...
@@ -199,6 +200,7 @@ func (plugin *kubenetNetworkPlugin) SetUpPod(namespace string, name string, id k
...
@@ -199,6 +200,7 @@ func (plugin *kubenetNetworkPlugin) SetUpPod(namespace string, name string, id k
return
fmt
.
Errorf
(
"Error building CNI config: %v"
,
err
)
return
fmt
.
Errorf
(
"Error building CNI config: %v"
,
err
)
}
}
glog
.
V
(
3
)
.
Infof
(
"Calling cni plugins to add container to network with cni runtime: %+v"
,
rt
)
res
,
err
:=
plugin
.
cniConfig
.
AddNetwork
(
plugin
.
netConfig
,
rt
)
res
,
err
:=
plugin
.
cniConfig
.
AddNetwork
(
plugin
.
netConfig
,
rt
)
if
err
!=
nil
{
if
err
!=
nil
{
return
fmt
.
Errorf
(
"Error adding container to network: %v"
,
err
)
return
fmt
.
Errorf
(
"Error adding container to network: %v"
,
err
)
...
@@ -254,6 +256,7 @@ func (plugin *kubenetNetworkPlugin) TearDownPod(namespace string, name string, i
...
@@ -254,6 +256,7 @@ func (plugin *kubenetNetworkPlugin) TearDownPod(namespace string, name string, i
}
}
delete
(
plugin
.
podCIDRs
,
id
)
delete
(
plugin
.
podCIDRs
,
id
)
glog
.
V
(
3
)
.
Infof
(
"Calling cni plugins to remove container from network with cni runtime: %+v"
,
rt
)
if
err
:=
plugin
.
cniConfig
.
DelNetwork
(
plugin
.
netConfig
,
rt
);
err
!=
nil
{
if
err
:=
plugin
.
cniConfig
.
DelNetwork
(
plugin
.
netConfig
,
rt
);
err
!=
nil
{
return
fmt
.
Errorf
(
"Error removing container from network: %v"
,
err
)
return
fmt
.
Errorf
(
"Error removing container from network: %v"
,
err
)
}
}
...
...
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