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
e1147184
Commit
e1147184
authored
Feb 23, 2015
by
Vishnu Kannan
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Increase the timeout on apiserver requests to fetch node stats.
parent
e1865822
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
15 additions
and
3 deletions
+15
-3
cadvisor.go
test/e2e/cadvisor.go
+15
-3
No files found.
test/e2e/cadvisor.go
View file @
e1147184
...
...
@@ -25,6 +25,12 @@ import (
.
"github.com/onsi/ginkgo"
)
const
(
timeout
=
1
*
time
.
Minute
maxRetries
=
10
sleepDuration
=
time
.
Minute
)
var
_
=
Describe
(
"Cadvisor"
,
func
()
{
var
c
*
client
.
Client
...
...
@@ -44,14 +50,15 @@ func CheckCadvisorHealthOnAllNodes(c *client.Client, timeout time.Duration) {
nodeList
,
err
:=
c
.
Nodes
()
.
List
()
expectNoError
(
err
)
var
errors
[]
error
for
start
:=
time
.
Now
();
time
.
Since
(
start
)
<
timeout
;
time
.
Sleep
(
5
*
time
.
Second
)
{
retries
:=
maxRetries
for
{
errors
=
[]
error
{}
for
_
,
node
:=
range
nodeList
.
Items
{
// cadvisor is not accessible directly unless its port (4194 by default) is exposed.
// Here, we access '/stats/' REST endpoint on the kubelet which polls cadvisor internally.
statsResource
:=
fmt
.
Sprintf
(
"api/v1beta1/proxy/minions/%s/stats/"
,
node
.
Name
)
By
(
fmt
.
Sprintf
(
"Querying stats from node %s using url %s"
,
node
.
Name
,
statsResource
))
_
,
err
=
c
.
Get
()
.
AbsPath
(
statsResource
)
.
Timeout
(
1
*
time
.
Second
)
.
Do
()
.
Raw
()
_
,
err
=
c
.
Get
()
.
AbsPath
(
statsResource
)
.
Timeout
(
timeout
)
.
Do
()
.
Raw
()
if
err
!=
nil
{
errors
=
append
(
errors
,
err
)
}
...
...
@@ -59,6 +66,11 @@ func CheckCadvisorHealthOnAllNodes(c *client.Client, timeout time.Duration) {
if
len
(
errors
)
==
0
{
return
}
if
retries
--
;
retries
<=
0
{
break
}
Logf
(
"failed to retrieve kubelet stats -
\n
%v"
,
errors
)
time
.
Sleep
(
sleepDuration
)
}
Failf
(
"
Timed out after %v waiting for cadvisor to be healthy on all nodes. Errors:
\n
%v"
,
timeout
,
errors
)
Failf
(
"
Failed after retrying %d times for cadvisor to be healthy on all nodes. Errors:
\n
%v"
,
maxRetries
,
errors
)
}
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