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
08305f12
Commit
08305f12
authored
Jul 06, 2016
by
Janet Kuo
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Log available pods of deployments when scaling down old RS
parent
8c8c5d97
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
3 additions
and
0 deletions
+3
-0
rolling.go
pkg/controller/deployment/rolling.go
+2
-0
deployment.go
pkg/util/deployment/deployment.go
+1
-0
No files found.
pkg/controller/deployment/rolling.go
View file @
08305f12
...
@@ -93,6 +93,7 @@ func (dc *DeploymentController) reconcileOldReplicaSets(allRSs []*extensions.Rep
...
@@ -93,6 +93,7 @@ func (dc *DeploymentController) reconcileOldReplicaSets(allRSs []*extensions.Rep
if
err
!=
nil
{
if
err
!=
nil
{
return
false
,
fmt
.
Errorf
(
"could not find available pods: %v"
,
err
)
return
false
,
fmt
.
Errorf
(
"could not find available pods: %v"
,
err
)
}
}
glog
.
V
(
4
)
.
Infof
(
"New RS %s/%s has %d available pods."
,
newRS
.
Namespace
,
newRS
.
Name
,
newRSAvailablePodCount
)
maxUnavailable
:=
maxUnavailable
(
*
deployment
)
maxUnavailable
:=
maxUnavailable
(
*
deployment
)
// Check if we can scale down. We can scale down in the following 2 cases:
// Check if we can scale down. We can scale down in the following 2 cases:
...
@@ -172,6 +173,7 @@ func (dc *DeploymentController) cleanupUnhealthyReplicas(oldRSs []*extensions.Re
...
@@ -172,6 +173,7 @@ func (dc *DeploymentController) cleanupUnhealthyReplicas(oldRSs []*extensions.Re
if
err
!=
nil
{
if
err
!=
nil
{
return
nil
,
totalScaledDown
,
fmt
.
Errorf
(
"could not find available pods: %v"
,
err
)
return
nil
,
totalScaledDown
,
fmt
.
Errorf
(
"could not find available pods: %v"
,
err
)
}
}
glog
.
V
(
4
)
.
Infof
(
"Found %d available pods in old RS %s/%s"
,
availablePodCount
,
targetRS
.
Namespace
,
targetRS
.
Name
)
if
targetRS
.
Spec
.
Replicas
==
availablePodCount
{
if
targetRS
.
Spec
.
Replicas
==
availablePodCount
{
// no unhealthy replicas found, no scaling required.
// no unhealthy replicas found, no scaling required.
continue
continue
...
...
pkg/util/deployment/deployment.go
View file @
08305f12
...
@@ -356,6 +356,7 @@ func countAvailablePods(pods []api.Pod, minReadySeconds int32) int32 {
...
@@ -356,6 +356,7 @@ func countAvailablePods(pods []api.Pod, minReadySeconds int32) int32 {
for
_
,
pod
:=
range
pods
{
for
_
,
pod
:=
range
pods
{
// TODO: Make the time.Now() as argument to allow unit test this.
// TODO: Make the time.Now() as argument to allow unit test this.
if
IsPodAvailable
(
&
pod
,
minReadySeconds
,
time
.
Now
())
{
if
IsPodAvailable
(
&
pod
,
minReadySeconds
,
time
.
Now
())
{
glog
.
V
(
4
)
.
Infof
(
"Pod %s/%s is available."
,
pod
.
Namespace
,
pod
.
Name
)
availablePodCount
++
availablePodCount
++
}
}
}
}
...
...
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