mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-07-24 20:24:09 +00:00
Create fresh etcd instance for each workload in scheduler_perf
This commit is contained in:
parent
1747483922
commit
3b7b50a2cc
@ -64,15 +64,17 @@ func getAvailablePort() (int, error) {
|
||||
|
||||
// startEtcd executes an etcd instance. The returned function will signal the
|
||||
// etcd process and wait for it to exit.
|
||||
func startEtcd(output io.Writer) (func(), error) {
|
||||
etcdURL := env.GetEnvAsStringOrFallback("KUBE_INTEGRATION_ETCD_URL", "http://127.0.0.1:2379")
|
||||
conn, err := net.Dial("tcp", strings.TrimPrefix(etcdURL, "http://"))
|
||||
if err == nil {
|
||||
klog.Infof("etcd already running at %s", etcdURL)
|
||||
conn.Close()
|
||||
return func() {}, nil
|
||||
func startEtcd(output io.Writer, forceCreate bool) (func(), error) {
|
||||
if !forceCreate {
|
||||
etcdURL := env.GetEnvAsStringOrFallback("KUBE_INTEGRATION_ETCD_URL", "http://127.0.0.1:2379")
|
||||
conn, err := net.Dial("tcp", strings.TrimPrefix(etcdURL, "http://"))
|
||||
if err == nil {
|
||||
klog.Infof("etcd already running at %s", etcdURL)
|
||||
_ = conn.Close()
|
||||
return func() {}, nil
|
||||
}
|
||||
klog.V(1).Infof("could not connect to etcd: %v", err)
|
||||
}
|
||||
klog.V(1).Infof("could not connect to etcd: %v", err)
|
||||
|
||||
currentURL, stop, err := RunCustomEtcd("integration_test_etcd_data", nil, output)
|
||||
if err != nil {
|
||||
@ -217,7 +219,7 @@ func EtcdMain(tests func() int) {
|
||||
goleak.IgnoreTopFunction("github.com/moby/spdystream.(*Connection).shutdown"),
|
||||
)
|
||||
|
||||
stop, err := startEtcd(nil)
|
||||
stop, err := startEtcd(nil, false)
|
||||
if err != nil {
|
||||
klog.Fatalf("cannot run integration tests: unable to start etcd: %v", err)
|
||||
}
|
||||
@ -247,8 +249,8 @@ func GetEtcdURL() string {
|
||||
//
|
||||
// Starting etcd multiple times per test run instead of once with EtcdMain
|
||||
// provides better separation between different tests.
|
||||
func StartEtcd(tb testing.TB, etcdOutput io.Writer) {
|
||||
stop, err := startEtcd(etcdOutput)
|
||||
func StartEtcd(tb testing.TB, etcdOutput io.Writer, forceCreate bool) {
|
||||
stop, err := startEtcd(etcdOutput, forceCreate)
|
||||
if err != nil {
|
||||
tb.Fatalf("unable to start etcd: %v", err)
|
||||
}
|
||||
|
@ -30,7 +30,7 @@
|
||||
initPods: 500
|
||||
measurePods: 1000
|
||||
- name: 5000Nodes
|
||||
labels: [performance, fast]
|
||||
labels: [fast]
|
||||
params:
|
||||
initNodes: 5000
|
||||
initPods: 1000
|
||||
@ -65,7 +65,7 @@
|
||||
initPods: 100
|
||||
measurePods: 400
|
||||
- name: 5000Nodes
|
||||
labels: [performance, fast]
|
||||
labels: [fast]
|
||||
params:
|
||||
initNodes: 5000
|
||||
initPods: 1000
|
||||
@ -95,7 +95,7 @@
|
||||
initPods: 500
|
||||
measurePods: 1000
|
||||
- name: 5000Nodes
|
||||
labels: [performance, fast]
|
||||
labels: [fast]
|
||||
params:
|
||||
initNodes: 5000
|
||||
initPods: 5000
|
||||
@ -108,7 +108,6 @@
|
||||
measurePods: 10000
|
||||
|
||||
- name: SchedulingInTreePVs
|
||||
labels: [performance]
|
||||
workloadTemplate:
|
||||
- opcode: createNodes
|
||||
countParam: $initNodes
|
||||
@ -134,13 +133,13 @@
|
||||
initPods: 5000
|
||||
measurePods: 1000
|
||||
- name: 5000Nodes_2000Pods
|
||||
labels: [performance]
|
||||
params:
|
||||
initNodes: 5000
|
||||
initPods: 1000
|
||||
measurePods: 2000
|
||||
|
||||
- name: SchedulingMigratedInTreePVs
|
||||
labels: [performance]
|
||||
workloadTemplate:
|
||||
- opcode: createNodes
|
||||
countParam: $initNodes
|
||||
@ -175,13 +174,13 @@
|
||||
initPods: 5000
|
||||
measurePods: 1000
|
||||
- name: 5000Nodes_5000Pods
|
||||
labels: [performance]
|
||||
params:
|
||||
initNodes: 5000
|
||||
initPods: 5000
|
||||
measurePods: 5000
|
||||
|
||||
- name: SchedulingCSIPVs
|
||||
labels: [performance]
|
||||
workloadTemplate:
|
||||
- opcode: createNodes
|
||||
countParam: $initNodes
|
||||
@ -214,6 +213,7 @@
|
||||
initPods: 5000
|
||||
measurePods: 1000
|
||||
- name: 5000Nodes_5000Pods
|
||||
labels: [performance]
|
||||
params:
|
||||
initNodes: 5000
|
||||
initPods: 5000
|
||||
@ -246,7 +246,7 @@
|
||||
initPods: 500
|
||||
measurePods: 1000
|
||||
- name: 5000Nodes
|
||||
labels: [performance, fast]
|
||||
labels: [fast]
|
||||
params:
|
||||
initNodes: 5000
|
||||
initPods: 5000
|
||||
@ -259,7 +259,6 @@
|
||||
measurePods: 5000
|
||||
|
||||
- name: SchedulingPreferredPodAffinity
|
||||
labels: [performance]
|
||||
defaultPodTemplatePath: config/templates/pod-with-preferred-pod-affinity.yaml
|
||||
workloadTemplate:
|
||||
- opcode: createNodes
|
||||
@ -287,6 +286,7 @@
|
||||
initPods: 5000
|
||||
measurePods: 1000
|
||||
- name: 5000Nodes_5000Pods
|
||||
labels: [performance]
|
||||
params:
|
||||
initNodes: 5000
|
||||
initPods: 5000
|
||||
@ -315,7 +315,7 @@
|
||||
initPods: 500
|
||||
measurePods: 1000
|
||||
- name: 5000Nodes
|
||||
labels: [performance, fast]
|
||||
labels: [fast]
|
||||
params:
|
||||
initNodes: 5000
|
||||
initPods: 5000
|
||||
@ -376,7 +376,7 @@
|
||||
initPods: 500
|
||||
measurePods: 1000
|
||||
- name: 5000Nodes
|
||||
labels: [performance, fast]
|
||||
labels: [fast]
|
||||
params:
|
||||
initNodes: 5000
|
||||
initPods: 5000
|
||||
@ -411,7 +411,7 @@
|
||||
initPods: 1000
|
||||
measurePods: 1000
|
||||
- name: 5000Nodes
|
||||
labels: [performance, fast]
|
||||
labels: [fast]
|
||||
params:
|
||||
initNodes: 5000
|
||||
initPods: 5000
|
||||
@ -424,7 +424,6 @@
|
||||
measurePods: 5000
|
||||
|
||||
- name: PreferredTopologySpreading
|
||||
labels: [performance]
|
||||
workloadTemplate:
|
||||
- opcode: createNodes
|
||||
countParam: $initNodes
|
||||
@ -452,13 +451,13 @@
|
||||
initPods: 5000
|
||||
measurePods: 2000
|
||||
- name: 5000Nodes_5000Pods
|
||||
labels: [performance]
|
||||
params:
|
||||
initNodes: 5000
|
||||
initPods: 5000
|
||||
measurePods: 5000
|
||||
|
||||
- name: MixedSchedulingBasePod
|
||||
labels: [performance]
|
||||
defaultPodTemplatePath: config/templates/pod-default.yaml
|
||||
workloadTemplate:
|
||||
- opcode: createNodes
|
||||
@ -505,6 +504,7 @@
|
||||
initPods: 2000
|
||||
measurePods: 1000
|
||||
- name: 5000Nodes_5000Pods
|
||||
labels: [performance]
|
||||
params:
|
||||
initNodes: 5000
|
||||
initPods: 2000
|
||||
@ -588,7 +588,7 @@
|
||||
initPods: 200
|
||||
measurePods: 1000
|
||||
- name: 5000Nodes/200InitPods
|
||||
labels: [performance, fast]
|
||||
labels: [fast]
|
||||
params:
|
||||
initNodes: 5000
|
||||
initPods: 200
|
||||
@ -628,7 +628,7 @@
|
||||
initNodes: 1000
|
||||
measurePods: 1000
|
||||
- name: 5000Nodes
|
||||
labels: [performance, fast]
|
||||
labels: [fast]
|
||||
params:
|
||||
initNodes: 5000
|
||||
measurePods: 2000
|
||||
@ -639,7 +639,6 @@
|
||||
measurePods: 10000
|
||||
|
||||
- name: SchedulingRequiredPodAntiAffinityWithNSSelector
|
||||
labels: [performance]
|
||||
defaultPodTemplatePath: config/templates/pod-anti-affinity-ns-selector.yaml
|
||||
workloadTemplate:
|
||||
- opcode: createNodes
|
||||
@ -677,6 +676,7 @@
|
||||
initNamespaces: 100
|
||||
measurePods: 1000
|
||||
- name: 5000Nodes_2000Pods
|
||||
labels: [performance]
|
||||
params:
|
||||
initNodes: 6000
|
||||
initPodsPerNamespace: 40
|
||||
@ -684,7 +684,6 @@
|
||||
measurePods: 2000
|
||||
|
||||
- name: SchedulingPreferredAntiAffinityWithNSSelector
|
||||
labels: [performance]
|
||||
defaultPodTemplatePath: config/templates/pod-preferred-anti-affinity-ns-selector.yaml
|
||||
workloadTemplate:
|
||||
- opcode: createNodes
|
||||
@ -722,6 +721,7 @@
|
||||
initNamespaces: 100
|
||||
measurePods: 1000
|
||||
- name: 5000Nodes_2000Pods
|
||||
labels: [performance]
|
||||
params:
|
||||
initNodes: 5000
|
||||
initPodsPerNamespace: 40
|
||||
@ -729,7 +729,6 @@
|
||||
measurePods: 2000
|
||||
|
||||
- name: SchedulingRequiredPodAffinityWithNSSelector
|
||||
labels: [performance]
|
||||
defaultPodTemplatePath: config/templates/pod-affinity-ns-selector.yaml
|
||||
workloadTemplate:
|
||||
- opcode: createNodes
|
||||
@ -770,6 +769,7 @@
|
||||
initNamespaces: 100
|
||||
measurePods: 1000
|
||||
- name: 5000Nodes_2000Pods
|
||||
labels: [performance]
|
||||
params:
|
||||
initNodes: 5000
|
||||
initPodsPerNamespace: 50
|
||||
@ -777,7 +777,6 @@
|
||||
measurePods: 2000
|
||||
|
||||
- name: SchedulingPreferredAffinityWithNSSelector
|
||||
labels: [performance]
|
||||
defaultPodTemplatePath: config/templates/pod-preferred-affinity-ns-selector.yaml
|
||||
workloadTemplate:
|
||||
- opcode: createNodes
|
||||
@ -815,6 +814,7 @@
|
||||
initNamespaces: 100
|
||||
measurePods: 1000
|
||||
- name: 5000Nodes_5000Pods
|
||||
labels: [performance]
|
||||
params:
|
||||
initNodes: 5000
|
||||
initPodsPerNamespace: 50
|
||||
|
@ -777,8 +777,8 @@ func setupTestCase(t testing.TB, tc *testCase, output io.Writer, outOfTreePlugin
|
||||
framework.GoleakCheck(t)
|
||||
|
||||
// Now that we are ready to run, start
|
||||
// etcd.
|
||||
framework.StartEtcd(t, output)
|
||||
// a brand new etcd.
|
||||
framework.StartEtcd(t, output, true)
|
||||
|
||||
for feature, flag := range tc.FeatureGates {
|
||||
featuregatetesting.SetFeatureGateDuringTest(t, utilfeature.DefaultFeatureGate, feature, flag)
|
||||
|
Loading…
Reference in New Issue
Block a user