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
4852ca23
Commit
4852ca23
authored
Dec 08, 2015
by
gmarek
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Make getSchedulingLatency use master proxy
parent
775369a8
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
39 additions
and
12 deletions
+39
-12
kube-scheduler.md
docs/admin/kube-scheduler.md
+2
-2
server.go
plugin/cmd/kube-scheduler/app/server.go
+1
-1
density.go
test/e2e/density.go
+1
-1
metrics_util.go
test/e2e/metrics_util.go
+35
-8
No files found.
docs/admin/kube-scheduler.md
View file @
4852ca23
...
...
@@ -53,7 +53,7 @@ kube-scheduler
### Options
```
--address=
127.0.0.1
: The IP address to serve on (set to 0.0.0.0 for all interfaces)
--address=
0.0.0.0
: The IP address to serve on (set to 0.0.0.0 for all interfaces)
--algorithm-provider="DefaultProvider": The scheduling algorithm provider to use, one of: DefaultProvider
--bind-pods-burst=100: Number of bindings per second scheduler is allowed to make during bursts
--bind-pods-qps=50: Number of bindings per second scheduler is allowed to continuously make
...
...
@@ -68,7 +68,7 @@ kube-scheduler
--profiling[=true]: Enable profiling via web interface host:port/debug/pprof/
```
###### Auto generated by spf13/cobra on 1
3-Oct
-2015
###### Auto generated by spf13/cobra on 1
4-Dec
-2015
<!-- BEGIN MUNGE: GENERATED_ANALYTICS -->
...
...
plugin/cmd/kube-scheduler/app/server.go
View file @
4852ca23
...
...
@@ -64,7 +64,7 @@ type SchedulerServer struct {
func
NewSchedulerServer
()
*
SchedulerServer
{
s
:=
SchedulerServer
{
Port
:
ports
.
SchedulerPort
,
Address
:
net
.
ParseIP
(
"
127.0.0.1
"
),
Address
:
net
.
ParseIP
(
"
0.0.0.0
"
),
AlgorithmProvider
:
factory
.
DefaultProvider
,
BindPodsQPS
:
50.0
,
BindPodsBurst
:
100
,
...
...
test/e2e/density.go
View file @
4852ca23
...
...
@@ -145,7 +145,7 @@ var _ = Describe("Density [Skipped]", func() {
// Verify scheduler metrics.
// TODO: Reset metrics at the beginning of the test.
// We should do something similar to how we do it for APIserver.
expectNoError
(
VerifySchedulerLatency
())
expectNoError
(
VerifySchedulerLatency
(
c
))
})
// Explicitly put here, to delete namespace at the end of the test
...
...
test/e2e/metrics_util.go
View file @
4852ca23
...
...
@@ -31,6 +31,7 @@ import (
"k8s.io/kubernetes/pkg/api"
client
"k8s.io/kubernetes/pkg/client/unversioned"
"k8s.io/kubernetes/pkg/master/ports"
"k8s.io/kubernetes/pkg/util/sets"
"github.com/prometheus/common/expfmt"
...
...
@@ -256,15 +257,41 @@ func getMetrics(c *client.Client) (string, error) {
}
// Retrieves scheduler metrics information.
func
getSchedulingLatency
()
(
SchedulingLatency
,
error
)
{
func
getSchedulingLatency
(
c
*
client
.
Client
)
(
SchedulingLatency
,
error
)
{
result
:=
SchedulingLatency
{}
cmd
:=
"curl http://localhost:10251/metrics"
sshResult
,
err
:=
SSH
(
cmd
,
getMasterHost
()
+
":22"
,
testContext
.
Provider
)
if
err
!=
nil
||
sshResult
.
Code
!=
0
{
return
result
,
fmt
.
Errorf
(
"unexpected error (code: %d) in ssh connection to master: %#v"
,
sshResult
.
Code
,
err
)
// Check if master Node is registered
nodes
,
err
:=
c
.
Nodes
()
.
List
(
api
.
ListOptions
{})
expectNoError
(
err
)
var
data
string
var
masterRegistered
=
false
for
_
,
node
:=
range
nodes
.
Items
{
if
strings
.
HasSuffix
(
node
.
Name
,
"master"
)
{
masterRegistered
=
true
}
}
if
masterRegistered
{
rawData
,
err
:=
c
.
Get
()
.
Prefix
(
"proxy"
)
.
Namespace
(
api
.
NamespaceSystem
)
.
Resource
(
"pods"
)
.
Name
(
fmt
.
Sprintf
(
"kube-scheduler-%v:%v"
,
testContext
.
CloudConfig
.
MasterName
,
ports
.
SchedulerPort
))
.
Suffix
(
"metrics"
)
.
Do
()
.
Raw
()
expectNoError
(
err
)
data
=
string
(
rawData
)
}
else
{
// If master is not registered fall back to old method of using SSH.
cmd
:=
"curl http://localhost:10251/metrics"
sshResult
,
err
:=
SSH
(
cmd
,
getMasterHost
()
+
":22"
,
testContext
.
Provider
)
if
err
!=
nil
||
sshResult
.
Code
!=
0
{
return
result
,
fmt
.
Errorf
(
"unexpected error (code: %d) in ssh connection to master: %#v"
,
sshResult
.
Code
,
err
)
}
data
=
sshResult
.
Stdout
}
samples
,
err
:=
extractMetricSamples
(
sshResult
.
Stdout
)
samples
,
err
:=
extractMetricSamples
(
data
)
if
err
!=
nil
{
return
result
,
err
}
...
...
@@ -294,8 +321,8 @@ func getSchedulingLatency() (SchedulingLatency, error) {
}
// Verifies (currently just by logging them) the scheduling latencies.
func
VerifySchedulerLatency
()
error
{
latency
,
err
:=
getSchedulingLatency
()
func
VerifySchedulerLatency
(
c
*
client
.
Client
)
error
{
latency
,
err
:=
getSchedulingLatency
(
c
)
if
err
!=
nil
{
return
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