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
2941aea8
Commit
2941aea8
authored
Oct 31, 2016
by
bprashanth
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Use podCIDR as a proxy for kubenet.Status
parent
11638e9e
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
13 additions
and
4 deletions
+13
-4
kubelet_network.go
pkg/kubelet/kubelet_network.go
+13
-4
No files found.
pkg/kubelet/kubelet_network.go
View file @
2941aea8
...
...
@@ -199,7 +199,10 @@ func (kl *Kubelet) syncNetworkStatus() {
// on the filesystem.
if
kl
.
networkPlugin
!=
nil
{
kl
.
runtimeState
.
setNetworkState
(
kl
.
networkPlugin
.
Status
())
}
else
{
}
else
if
kl
.
runtimeState
.
podCIDR
()
!=
""
{
// Don't mark the node ready till we've successfully executed
// the first UpdatePodCIDR call through cri. See comment above
// setPodCIDR call.
kl
.
runtimeState
.
setNetworkState
(
nil
)
}
}
...
...
@@ -213,10 +216,8 @@ func (kl *Kubelet) updatePodCIDR(cidr string) {
return
}
glog
.
Infof
(
"Setting Pod CIDR: %v -> %v"
,
podCIDR
,
cidr
)
kl
.
runtimeState
.
setPodCIDR
(
cidr
)
// kubelet -> network plugin
// cri runtime shims are responsible for their own network plugins
if
kl
.
networkPlugin
!=
nil
{
details
:=
make
(
map
[
string
]
interface
{})
details
[
network
.
NET_PLUGIN_EVENT_POD_CIDR_CHANGE_DETAIL_CIDR
]
=
cidr
...
...
@@ -224,9 +225,17 @@ func (kl *Kubelet) updatePodCIDR(cidr string) {
}
// kubelet -> generic runtime -> runtime shim -> network plugin
// docker/rkt non-cri implementations have a passthrough UpdatePodCIDR
if
err
:=
kl
.
GetRuntime
()
.
UpdatePodCIDR
(
cidr
);
err
!=
nil
{
glog
.
Errorf
(
"Failed to update pod CIDR: %v"
,
err
)
return
}
// We need to be careful about setting podCIDR. Till #35839 lands we're
// using it to indicate network plugin status for cri shims. See comment
// in syncNetworkStatus.
glog
.
Infof
(
"Setting Pod CIDR: %v -> %v"
,
podCIDR
,
cidr
)
kl
.
runtimeState
.
setPodCIDR
(
cidr
)
}
// shapingEnabled returns whether traffic shaping is enabled.
...
...
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