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
4404cda7
Unverified
Commit
4404cda7
authored
Sep 26, 2018
by
k8s-ci-robot
Committed by
GitHub
Sep 26, 2018
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #68752 from krzysztof-jastrzebski/pod_sync
Start synchronizing pods after network is ready.
parents
8c1fe2e1
ad330f7d
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
32 additions
and
3 deletions
+32
-3
BUILD
pkg/kubelet/BUILD
+1
-0
errors.go
pkg/kubelet/errors.go
+21
-0
kubelet.go
pkg/kubelet/kubelet.go
+2
-2
pod_workers.go
pkg/kubelet/pod_workers.go
+8
-1
No files found.
pkg/kubelet/BUILD
View file @
4404cda7
...
...
@@ -11,6 +11,7 @@ go_library(
srcs = [
"active_deadline.go",
"doc.go",
"errors.go",
"kubelet.go",
"kubelet_getters.go",
"kubelet_network.go",
...
...
pkg/kubelet/errors.go
0 → 100644
View file @
4404cda7
/*
Copyright 2018 The Kubernetes Authors.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*/
package
kubelet
const
(
NetworkNotReadyErrorMsg
=
"network is not ready"
)
pkg/kubelet/kubelet.go
View file @
4404cda7
...
...
@@ -1561,8 +1561,8 @@ func (kl *Kubelet) syncPod(o syncPodOptions) error {
// If the network plugin is not ready, only start the pod if it uses the host network
if
rs
:=
kl
.
runtimeState
.
networkErrors
();
len
(
rs
)
!=
0
&&
!
kubecontainer
.
IsHostNetworkPod
(
pod
)
{
kl
.
recorder
.
Eventf
(
pod
,
v1
.
EventTypeWarning
,
events
.
NetworkNotReady
,
"
network is not ready: %v"
,
rs
)
return
fmt
.
Errorf
(
"
network is not ready: %v"
,
rs
)
kl
.
recorder
.
Eventf
(
pod
,
v1
.
EventTypeWarning
,
events
.
NetworkNotReady
,
"
%s: %v"
,
NetworkNotReadyErrorMsg
,
rs
)
return
fmt
.
Errorf
(
"
%s: %v"
,
NetworkNotReadyErrorMsg
,
rs
)
}
// Create Cgroups for the pod and apply resource parameters
...
...
pkg/kubelet/pod_workers.go
View file @
4404cda7
...
...
@@ -18,6 +18,7 @@ package kubelet
import
(
"fmt"
"strings"
"sync"
"time"
...
...
@@ -96,8 +97,11 @@ const (
// jitter factor for resyncInterval
workerResyncIntervalJitterFactor
=
0.5
// jitter factor for backOffPeriod
// jitter factor for backOffPeriod
and backOffOnTransientErrorPeriod
workerBackOffPeriodJitterFactor
=
0.5
// backoff period when transient error occurred.
backOffOnTransientErrorPeriod
=
time
.
Second
)
type
podWorkers
struct
{
...
...
@@ -263,6 +267,9 @@ func (p *podWorkers) wrapUp(uid types.UID, syncErr error) {
case
syncErr
==
nil
:
// No error; requeue at the regular resync interval.
p
.
workQueue
.
Enqueue
(
uid
,
wait
.
Jitter
(
p
.
resyncInterval
,
workerResyncIntervalJitterFactor
))
case
strings
.
Contains
(
syncErr
.
Error
(),
NetworkNotReadyErrorMsg
)
:
// Network is not ready; back off for short period of time and retry as network might be ready soon.
p
.
workQueue
.
Enqueue
(
uid
,
wait
.
Jitter
(
backOffOnTransientErrorPeriod
,
workerBackOffPeriodJitterFactor
))
default
:
// Error occurred during the sync; back off and then retry.
p
.
workQueue
.
Enqueue
(
uid
,
wait
.
Jitter
(
p
.
backOffPeriod
,
workerBackOffPeriodJitterFactor
))
...
...
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