mirror of https://github.com/k3s-io/k3s
Add node notready/unreachable tolerations to load/density pods.
parent
1c04caa043
commit
25c2440996
|
@ -3,6 +3,7 @@ load("@io_bazel_rules_go//go:def.bzl", "go_library")
|
|||
go_library(
|
||||
name = "go_default_library",
|
||||
srcs = [
|
||||
"common.go",
|
||||
"density.go",
|
||||
"framework.go",
|
||||
"load.go",
|
||||
|
|
|
@ -0,0 +1,24 @@
|
|||
/*
|
||||
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() {
|
|||
// 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.
|
||||
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
|
||||
clients, internalClients, scalesClients, err := createClients(numberOfCollections)
|
||||
framework.ExpectNoError(err)
|
||||
|
@ -688,6 +692,19 @@ var _ = SIGDescribe("Density", func() {
|
|||
SecretNames: secretNames,
|
||||
ConfigMapNames: configMapNames,
|
||||
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 {
|
||||
case api.Kind("ReplicationController"):
|
||||
|
|
|
@ -541,7 +541,7 @@ func GenerateConfigsForGroup(
|
|||
InternalClient: nil, // this will be overwritten later
|
||||
Name: groupName + "-" + strconv.Itoa(i),
|
||||
Namespace: namespace,
|
||||
Timeout: 10 * time.Minute,
|
||||
Timeout: UnreadyNodeToleration,
|
||||
Image: image,
|
||||
Command: command,
|
||||
Replicas: size,
|
||||
|
@ -551,6 +551,19 @@ func GenerateConfigsForGroup(
|
|||
ConfigMapNames: configMapNames,
|
||||
// Define a label to group every 2 RCs into one service.
|
||||
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 {
|
||||
|
|
Loading…
Reference in New Issue