Do not schedule pod to the node under PID pressure.

Signed-off-by: Da K. Ma <klaus1982.cn@gmail.com>
This commit is contained in:
Da K. Ma
2018-03-19 18:25:12 +08:00
parent 3dbcd1ddce
commit 2c10d15ae5
13 changed files with 185 additions and 13 deletions

View File

@@ -19,6 +19,7 @@ package scheduler
import (
"fmt"
"net/http"
"net/http/httptest"
"testing"
"time"
@@ -48,8 +49,6 @@ import (
"k8s.io/kubernetes/pkg/scheduler/factory"
"k8s.io/kubernetes/test/integration/framework"
imageutils "k8s.io/kubernetes/test/utils/image"
"net/http/httptest"
)
type TestContext struct {
@@ -318,6 +317,12 @@ func createNode(cs clientset.Interface, name string, res *v1.ResourceList) (*v1.
return cs.CoreV1().Nodes().Create(n)
}
// updateNodeStatus updates the status of node.
func updateNodeStatus(cs clientset.Interface, node *v1.Node) error {
_, err := cs.CoreV1().Nodes().UpdateStatus(node)
return err
}
// createNodes creates `numNodes` nodes. The created node names will be in the
// form of "`prefix`-X" where X is an ordinal.
func createNodes(cs clientset.Interface, prefix string, res *v1.ResourceList, numNodes int) ([]*v1.Node, error) {