mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-08-03 17:30:00 +00:00
Merge pull request #18358 from gmarek/use-proxy
Auto commit by PR queue bot
This commit is contained in:
commit
548cfbf058
@ -53,7 +53,7 @@ kube-scheduler
|
|||||||
### Options
|
### 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
|
--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-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
|
--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/
|
--profiling[=true]: Enable profiling via web interface host:port/debug/pprof/
|
||||||
```
|
```
|
||||||
|
|
||||||
###### Auto generated by spf13/cobra on 13-Oct-2015
|
###### Auto generated by spf13/cobra on 14-Dec-2015
|
||||||
|
|
||||||
|
|
||||||
<!-- BEGIN MUNGE: GENERATED_ANALYTICS -->
|
<!-- BEGIN MUNGE: GENERATED_ANALYTICS -->
|
||||||
|
@ -64,7 +64,7 @@ type SchedulerServer struct {
|
|||||||
func NewSchedulerServer() *SchedulerServer {
|
func NewSchedulerServer() *SchedulerServer {
|
||||||
s := SchedulerServer{
|
s := SchedulerServer{
|
||||||
Port: ports.SchedulerPort,
|
Port: ports.SchedulerPort,
|
||||||
Address: net.ParseIP("127.0.0.1"),
|
Address: net.ParseIP("0.0.0.0"),
|
||||||
AlgorithmProvider: factory.DefaultProvider,
|
AlgorithmProvider: factory.DefaultProvider,
|
||||||
BindPodsQPS: 50.0,
|
BindPodsQPS: 50.0,
|
||||||
BindPodsBurst: 100,
|
BindPodsBurst: 100,
|
||||||
|
@ -145,7 +145,7 @@ var _ = Describe("Density [Skipped]", func() {
|
|||||||
// Verify scheduler metrics.
|
// Verify scheduler metrics.
|
||||||
// TODO: Reset metrics at the beginning of the test.
|
// TODO: Reset metrics at the beginning of the test.
|
||||||
// We should do something similar to how we do it for APIserver.
|
// 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
|
// Explicitly put here, to delete namespace at the end of the test
|
||||||
|
@ -31,6 +31,7 @@ import (
|
|||||||
|
|
||||||
"k8s.io/kubernetes/pkg/api"
|
"k8s.io/kubernetes/pkg/api"
|
||||||
client "k8s.io/kubernetes/pkg/client/unversioned"
|
client "k8s.io/kubernetes/pkg/client/unversioned"
|
||||||
|
"k8s.io/kubernetes/pkg/master/ports"
|
||||||
"k8s.io/kubernetes/pkg/util/sets"
|
"k8s.io/kubernetes/pkg/util/sets"
|
||||||
|
|
||||||
"github.com/prometheus/common/expfmt"
|
"github.com/prometheus/common/expfmt"
|
||||||
@ -257,15 +258,41 @@ func getMetrics(c *client.Client) (string, error) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Retrieves scheduler metrics information.
|
// Retrieves scheduler metrics information.
|
||||||
func getSchedulingLatency() (SchedulingLatency, error) {
|
func getSchedulingLatency(c *client.Client) (SchedulingLatency, error) {
|
||||||
result := SchedulingLatency{}
|
result := SchedulingLatency{}
|
||||||
|
|
||||||
|
// 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"
|
cmd := "curl http://localhost:10251/metrics"
|
||||||
sshResult, err := SSH(cmd, getMasterHost()+":22", testContext.Provider)
|
sshResult, err := SSH(cmd, getMasterHost()+":22", testContext.Provider)
|
||||||
if err != nil || sshResult.Code != 0 {
|
if err != nil || sshResult.Code != 0 {
|
||||||
return result, fmt.Errorf("unexpected error (code: %d) in ssh connection to master: %#v", sshResult.Code, err)
|
return result, fmt.Errorf("unexpected error (code: %d) in ssh connection to master: %#v", sshResult.Code, err)
|
||||||
}
|
}
|
||||||
samples, err := extractMetricSamples(sshResult.Stdout)
|
data = sshResult.Stdout
|
||||||
|
}
|
||||||
|
samples, err := extractMetricSamples(data)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return result, err
|
return result, err
|
||||||
}
|
}
|
||||||
@ -295,8 +322,8 @@ func getSchedulingLatency() (SchedulingLatency, error) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Verifies (currently just by logging them) the scheduling latencies.
|
// Verifies (currently just by logging them) the scheduling latencies.
|
||||||
func VerifySchedulerLatency() error {
|
func VerifySchedulerLatency(c *client.Client) error {
|
||||||
latency, err := getSchedulingLatency()
|
latency, err := getSchedulingLatency(c)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user