mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-07-20 02:11:09 +00:00
Add benchmark tests for nodeInclusionPolicy
Signed-off-by: kerthcet <kerthcet@gmail.com>
This commit is contained in:
parent
20492f5555
commit
48f2c9ec20
17
test/integration/scheduler_perf/config/node-with-taint.yaml
Normal file
17
test/integration/scheduler_perf/config/node-with-taint.yaml
Normal file
@ -0,0 +1,17 @@
|
|||||||
|
apiVersion: v1
|
||||||
|
kind: Node
|
||||||
|
metadata:
|
||||||
|
generateName: taint-node-
|
||||||
|
spec:
|
||||||
|
taints:
|
||||||
|
- effect: NoSchedule
|
||||||
|
key: foo
|
||||||
|
status:
|
||||||
|
capacity:
|
||||||
|
pods: "110"
|
||||||
|
cpu: "4"
|
||||||
|
memory: 32Gi
|
||||||
|
conditions:
|
||||||
|
- status: "True"
|
||||||
|
type: Ready
|
||||||
|
phase: Running
|
@ -630,3 +630,31 @@
|
|||||||
initNamespaces: 100
|
initNamespaces: 100
|
||||||
measurePods: 1000
|
measurePods: 1000
|
||||||
|
|
||||||
|
- name: SchedulingWithNodeInclusionPolicy
|
||||||
|
featureGates:
|
||||||
|
NodeInclusionPolicyInPodTopologySpread: true
|
||||||
|
defaultPodTemplatePath: config/pod-with-node-inclusion-policy.yaml
|
||||||
|
workloadTemplate:
|
||||||
|
- opcode: createNodes
|
||||||
|
countParam: $normalNodes
|
||||||
|
uniqueNodeLabelStrategy:
|
||||||
|
labelKey: kubernetes.io/hostname
|
||||||
|
- opcode: createNodes
|
||||||
|
nodeTemplatePath: config/node-with-taint.yaml
|
||||||
|
countParam: $taintNodes
|
||||||
|
uniqueNodeLabelStrategy:
|
||||||
|
labelKey: kubernetes.io/hostname
|
||||||
|
- opcode: createPods
|
||||||
|
countParam: $measurePods
|
||||||
|
collectMetrics: true
|
||||||
|
workloads:
|
||||||
|
- name: 500Nodes
|
||||||
|
params:
|
||||||
|
taintNodes: 100
|
||||||
|
normalNodes: 400
|
||||||
|
measurePods: 400
|
||||||
|
- name: 5000Nodes
|
||||||
|
params:
|
||||||
|
taintNodes: 1000
|
||||||
|
normalNodes: 4000
|
||||||
|
measurePods: 4000
|
||||||
|
@ -0,0 +1,28 @@
|
|||||||
|
apiVersion: v1
|
||||||
|
kind: Pod
|
||||||
|
metadata:
|
||||||
|
generateName: spreading-pod-with-node-inclusion-policy-
|
||||||
|
labels:
|
||||||
|
foo: bar
|
||||||
|
spec:
|
||||||
|
containers:
|
||||||
|
- image: registry.k8s.io/pause:3.8
|
||||||
|
name: pause
|
||||||
|
ports:
|
||||||
|
- containerPort: 80
|
||||||
|
resources:
|
||||||
|
limits:
|
||||||
|
cpu: 100m
|
||||||
|
memory: 500Mi
|
||||||
|
requests:
|
||||||
|
cpu: 100m
|
||||||
|
memory: 500Mi
|
||||||
|
topologySpreadConstraints:
|
||||||
|
- maxSkew: 1
|
||||||
|
topologyKey: kubernetes.io/hostname
|
||||||
|
whenUnsatisfiable: DoNotSchedule
|
||||||
|
NodeAffinityPolicy: Honor
|
||||||
|
NodeTaintsPolicy: Honor
|
||||||
|
labelSelector:
|
||||||
|
matchLabels:
|
||||||
|
foo: bar
|
@ -968,7 +968,7 @@ func waitUntilPodsScheduledInNamespace(ctx context.Context, podInformer coreinfo
|
|||||||
if len(scheduled) >= wantCount {
|
if len(scheduled) >= wantCount {
|
||||||
return true, nil
|
return true, nil
|
||||||
}
|
}
|
||||||
klog.Infof("%s: namespace %s: got %d pods, want %d", name, namespace, len(scheduled), wantCount)
|
klog.Infof("%s: namespace %s, pods: want %d, got %d", name, namespace, wantCount, len(scheduled))
|
||||||
return false, nil
|
return false, nil
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
@ -65,7 +65,7 @@ func CreatePodWithRetries(c clientset.Interface, namespace string, obj *v1.Pod)
|
|||||||
if err == nil || apierrors.IsAlreadyExists(err) {
|
if err == nil || apierrors.IsAlreadyExists(err) {
|
||||||
return true, nil
|
return true, nil
|
||||||
}
|
}
|
||||||
return false, fmt.Errorf("Failed to create object with non-retriable error: %v ", err)
|
return false, fmt.Errorf("failed to create object with non-retriable error: %v ", err)
|
||||||
}
|
}
|
||||||
return RetryWithExponentialBackOff(createFunc)
|
return RetryWithExponentialBackOff(createFunc)
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user