Skip to content

Commit

Permalink
Add legacy/ directories to tests
Browse files Browse the repository at this point in the history
  • Loading branch information
wojtek-t committed Apr 10, 2019
1 parent 54c1a39 commit cf8d61b
Show file tree
Hide file tree
Showing 11 changed files with 566 additions and 0 deletions.
31 changes: 31 additions & 0 deletions clusterloader2/testing/density/legacy/100_nodes/constraints.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
# NOTE: If you're here to update the constraints please err on the side of using higher limits
# rather than lower limits. The point of these constraints is to detect changes in resource
# consumption but not at the expense of test flakiness. Thus, the constrains should be significantly
# higher than the actual consumption, e.g. we should get notified if a component starts using 5x
# more resources, but not necessarily if it starts using 10% more resources as it may lead to
# test flakiness.

coredns:
cpuConstraint: 0.05
memoryConstraint: 31457280 #30 * (1024 * 1024)
fluentd-gcp:
cpuConstraint: 1
memoryConstraint: 241172480 #230 * (1024 * 1024)
heapster:
cpuConstraint: 0.15
nemoryConstraint: 367001600 #350 * (1024 * 1024)
kube-apiserver:
cpuConstraint: 2.2
memoryConstraint: 1258291200 #1200 * (1024 * 1024)
kube-controller-manager:
cpuConstraint: 1.1
memoryConstraint: 314572800 #300 * (1024 * 1024)
kube-proxy:
cpuConstraint: 0.1
memoryConstraint: 31457280 #30 * (1024 * 1024)
kube-scheduler:
cpuConstraint: 0.35
memoryConstraint: 125829120 #120 * (1024 * 1024)
l7-lb-controller:
cpuConstraint: 0.20
memoryConstraint: 83886080 #80 * (1024 * 1024)
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
DENSITY_RESOURCE_CONSTRAINTS_FILE: ./100_nodes/constraints.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
NODE_MODE: masteranddns
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
NODE_MODE: masteranddns
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
PODS_PER_NODE: 95
192 changes: 192 additions & 0 deletions clusterloader2/testing/density/legacy/config.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,192 @@
# ASSUMPTIONS:
# - Underlying cluster should have 100+ nodes.
# - Number of nodes should be divisible by NODES_PER_NAMESPACE (default 100).

#Constants
{{$DENSITY_RESOURCE_CONSTRAINTS_FILE := DefaultParam .DENSITY_RESOURCE_CONSTRAINTS_FILE ""}}
{{$NODE_MODE := DefaultParam .NODE_MODE "allnodes"}}
{{$NODES_PER_NAMESPACE := DefaultParam .NODES_PER_NAMESPACE 100}}
{{$PODS_PER_NODE := DefaultParam .PODS_PER_NODE 30}}
{{$DENSITY_TEST_THROUGHPUT := DefaultParam .DENSITY_TEST_THROUGHPUT 20}}
# LATENCY_POD_MEMORY and LATENCY_POD_CPU are calculated for 1-core 4GB node.
# Increasing allocation of both memory and cpu by 10%
# decreases the value of priority function in scheduler by one point.
# This results in decreased probability of choosing the same node again.
{{$LATENCY_POD_CPU := DefaultParam .LATENCY_POD_CPU 100}}
{{$LATENCY_POD_MEMORY := DefaultParam .LATENCY_POD_MEMORY 400}}
{{$MIN_LATENCY_PODS := 500}}
{{$MIN_SATURATION_PODS_TIMEOUT := 180}}
{{$ENABLE_CHAOSMONKEY := DefaultParam .ENABLE_CHAOSMONKEY false}}
#Variables
{{$namespaces := DivideInt .Nodes $NODES_PER_NAMESPACE}}
{{$podsPerNamespace := MultiplyInt $PODS_PER_NODE $NODES_PER_NAMESPACE}}
{{$totalPods := MultiplyInt $podsPerNamespace $namespaces}}
{{$latencyReplicas := DivideInt (MaxInt $MIN_LATENCY_PODS .Nodes) $namespaces}}
{{$totalLatencyPods := MultiplyInt $namespaces $latencyReplicas}}
{{$saturationRCTimeout := DivideFloat $totalPods $DENSITY_TEST_THROUGHPUT | AddInt $MIN_SATURATION_PODS_TIMEOUT}}
# saturationRCHardTimeout must be at least 20m to make sure that ~10m node
# failure won't fail the test. See https://github.com/kubernetes/kubernetes/issues/73461#issuecomment-467338711
{{$saturationRCHardTimeout := MaxInt $saturationRCTimeout 1200}}

name: density
automanagedNamespaces: {{$namespaces}}
tuningSets:
- name: Uniform5qps
qpsLoad:
qps: 5
{{if $ENABLE_CHAOSMONKEY}}
chaosMonkey:
nodeFailure:
failureRate: 0.01
interval: 1m
jitterFactor: 10.0
simulatedDowntime: 10m
{{end}}
steps:
- measurements:
- Identifier: APIResponsiveness
Method: APIResponsiveness
Params:
action: reset
- Identifier: TestMetrics
Method: TestMetrics
Params:
action: start
nodeMode: {{$NODE_MODE}}
resourceConstraints: {{$DENSITY_RESOURCE_CONSTRAINTS_FILE}}
# Create saturation pods
- measurements:
- Identifier: SaturationPodStartupLatency
Method: PodStartupLatency
Params:
action: start
labelSelector: group = saturation
threshold: {{$saturationRCTimeout}}s
- measurements:
- Identifier: WaitForRunningSaturationRCs
Method: WaitForControlledPodsRunning
Params:
action: start
apiVersion: v1
kind: ReplicationController
labelSelector: group = saturation
operationTimeout: {{$saturationRCHardTimeout}}s
- phases:
- namespaceRange:
min: 1
max: {{$namespaces}}
replicasPerNamespace: 1
tuningSet: Uniform5qps
objectBundle:
- basename: saturation-rc
objectTemplatePath: rc.yaml
templateFillMap:
Replicas: {{$podsPerNamespace}}
Group: saturation
CpuRequest: 1m
MemoryRequest: 10M
- measurements:
- Identifier: SchedulingThroughput
Method: SchedulingThroughput
Params:
action: start
labelSelector: group = saturation
- measurements:
- Identifier: WaitForRunningSaturationRCs
Method: WaitForControlledPodsRunning
Params:
action: gather
- measurements:
- Identifier: SaturationPodStartupLatency
Method: PodStartupLatency
Params:
action: gather
- measurements:
- Identifier: SchedulingThroughput
Method: SchedulingThroughput
Params:
action: gather
- name: Creating saturation pods
# Create latency pods
- measurements:
- Identifier: PodStartupLatency
Method: PodStartupLatency
Params:
action: start
labelSelector: group = latency
- measurements:
- Identifier: WaitForRunningLatencyRCs
Method: WaitForControlledPodsRunning
Params:
action: start
apiVersion: v1
kind: ReplicationController
labelSelector: group = latency
operationTimeout: 15m
- phases:
- namespaceRange:
min: 1
max: {{$namespaces}}
replicasPerNamespace: {{$latencyReplicas}}
tuningSet: Uniform5qps
objectBundle:
- basename: latency-pod-rc
objectTemplatePath: rc.yaml
templateFillMap:
Replicas: 1
Group: latency
CpuRequest: {{$LATENCY_POD_CPU}}m
MemoryRequest: {{$LATENCY_POD_MEMORY}}M
- measurements:
- Identifier: WaitForRunningLatencyRCs
Method: WaitForControlledPodsRunning
Params:
action: gather
- name: Creating latency pods
# Remove latency pods
- phases:
- namespaceRange:
min: 1
max: {{$namespaces}}
replicasPerNamespace: 0
tuningSet: Uniform5qps
objectBundle:
- basename: latency-pod-rc
objectTemplatePath: rc.yaml
- measurements:
- Identifier: WaitForRunningLatencyRCs
Method: WaitForControlledPodsRunning
Params:
action: gather
- measurements:
- Identifier: PodStartupLatency
Method: PodStartupLatency
Params:
action: gather
- name: Deleting latency pods
# Delete pods
- phases:
- namespaceRange:
min: 1
max: {{$namespaces}}
replicasPerNamespace: 0
tuningSet: Uniform5qps
objectBundle:
- basename: saturation-rc
objectTemplatePath: rc.yaml
- measurements:
- Identifier: WaitForRunningSaturationRCs
Method: WaitForControlledPodsRunning
Params:
action: gather
- name: Deleting saturation pods
# Collect measurements
- measurements:
- Identifier: APIResponsiveness
Method: APIResponsiveness
Params:
action: gather
- Identifier: TestMetrics
Method: TestMetrics
Params:
action: gather
36 changes: 36 additions & 0 deletions clusterloader2/testing/density/legacy/rc.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
apiVersion: v1
kind: ReplicationController
metadata:
name: {{.Name}}
labels:
group: {{.Group}}
spec:
replicas: {{.Replicas}}
selector:
name: {{.Name}}
template:
metadata:
labels:
name: {{.Name}}
group: {{.Group}}
spec:
containers:
- image: k8s.gcr.io/pause:3.1
imagePullPolicy: IfNotPresent
name: {{.Name}}
ports:
resources:
requests:
cpu: {{.CpuRequest}}
memory: {{.MemoryRequest}}
# Add not-ready/unreachable tolerations for 15 minutes so that node
# failure doesn't trigger pod deletion.
tolerations:
- key: "node.kubernetes.io/not-ready"
operator: "Exists"
effect: "NoExecute"
tolerationSeconds: 900
- key: "node.kubernetes.io/unreachable"
operator: "Exists"
effect: "NoExecute"
tolerationSeconds: 900
Loading

0 comments on commit cf8d61b

Please sign in to comment.