Unverified Commit 57ea592c authored by Kubernetes Prow Robot's avatar Kubernetes Prow Robot Committed by GitHub

Merge pull request #72052 from mborsz/taints

Add node notready/unreachable tolerations to load/density pods.
parents 8ab955f8 25c24409
...@@ -3,6 +3,7 @@ load("@io_bazel_rules_go//go:def.bzl", "go_library") ...@@ -3,6 +3,7 @@ load("@io_bazel_rules_go//go:def.bzl", "go_library")
go_library( go_library(
name = "go_default_library", name = "go_default_library",
srcs = [ srcs = [
"common.go",
"density.go", "density.go",
"framework.go", "framework.go",
"load.go", "load.go",
......
/*
Copyright 2018 The Kubernetes Authors.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*/
package scalability
import "time"
const (
// UnreadyNodeToleration denotes time the node can be unreachable/not ready.
UnreadyNodeToleration = 15 * time.Minute
)
...@@ -637,7 +637,11 @@ var _ = SIGDescribe("Density", func() { ...@@ -637,7 +637,11 @@ var _ = SIGDescribe("Density", func() {
// Since all RCs are created at the same time, timeout for each config // Since all RCs are created at the same time, timeout for each config
// has to assume that it will be run at the very end. // has to assume that it will be run at the very end.
podThroughput := 20 podThroughput := 20
timeout := time.Duration(totalPods/podThroughput)*time.Second + 3*time.Minute timeout := time.Duration(totalPods/podThroughput) * time.Second
if timeout < UnreadyNodeToleration {
timeout = UnreadyNodeToleration
}
timeout += 3 * time.Minute
// createClients is defined in load.go // createClients is defined in load.go
clients, internalClients, scalesClients, err := createClients(numberOfCollections) clients, internalClients, scalesClients, err := createClients(numberOfCollections)
framework.ExpectNoError(err) framework.ExpectNoError(err)
...@@ -688,6 +692,19 @@ var _ = SIGDescribe("Density", func() { ...@@ -688,6 +692,19 @@ var _ = SIGDescribe("Density", func() {
SecretNames: secretNames, SecretNames: secretNames,
ConfigMapNames: configMapNames, ConfigMapNames: configMapNames,
ServiceAccountTokenProjections: itArg.svcacctTokenProjectionsPerPod, ServiceAccountTokenProjections: itArg.svcacctTokenProjectionsPerPod,
Tolerations: []v1.Toleration{
{
Key: "node.kubernetes.io/not-ready",
Operator: v1.TolerationOpExists,
Effect: v1.TaintEffectNoExecute,
TolerationSeconds: func(i int64) *int64 { return &i }(int64(UnreadyNodeToleration / time.Second)),
}, {
Key: "node.kubernetes.io/unreachable",
Operator: v1.TolerationOpExists,
Effect: v1.TaintEffectNoExecute,
TolerationSeconds: func(i int64) *int64 { return &i }(int64(UnreadyNodeToleration / time.Second)),
},
},
} }
switch itArg.kind { switch itArg.kind {
case api.Kind("ReplicationController"): case api.Kind("ReplicationController"):
......
...@@ -541,7 +541,7 @@ func GenerateConfigsForGroup( ...@@ -541,7 +541,7 @@ func GenerateConfigsForGroup(
InternalClient: nil, // this will be overwritten later InternalClient: nil, // this will be overwritten later
Name: groupName + "-" + strconv.Itoa(i), Name: groupName + "-" + strconv.Itoa(i),
Namespace: namespace, Namespace: namespace,
Timeout: 10 * time.Minute, Timeout: UnreadyNodeToleration,
Image: image, Image: image,
Command: command, Command: command,
Replicas: size, Replicas: size,
...@@ -551,6 +551,19 @@ func GenerateConfigsForGroup( ...@@ -551,6 +551,19 @@ func GenerateConfigsForGroup(
ConfigMapNames: configMapNames, ConfigMapNames: configMapNames,
// Define a label to group every 2 RCs into one service. // Define a label to group every 2 RCs into one service.
Labels: map[string]string{svcLabelKey: groupName + "-" + strconv.Itoa((i+1)/2)}, Labels: map[string]string{svcLabelKey: groupName + "-" + strconv.Itoa((i+1)/2)},
Tolerations: []v1.Toleration{
{
Key: "node.kubernetes.io/not-ready",
Operator: v1.TolerationOpExists,
Effect: v1.TaintEffectNoExecute,
TolerationSeconds: func(i int64) *int64 { return &i }(int64(UnreadyNodeToleration / time.Second)),
}, {
Key: "node.kubernetes.io/unreachable",
Operator: v1.TolerationOpExists,
Effect: v1.TaintEffectNoExecute,
TolerationSeconds: func(i int64) *int64 { return &i }(int64(UnreadyNodeToleration / time.Second)),
},
},
} }
if kind == randomKind { if kind == randomKind {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment