-
Notifications
You must be signed in to change notification settings - Fork 25
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
e2e: add balloons container match expression tests.
Signed-off-by: Krisztian Litkey <[email protected]>
- Loading branch information
Showing
3 changed files
with
54 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
config: | ||
reservedResources: | ||
cpu: 750m | ||
pinCPU: true | ||
pinMemory: true | ||
idleCPUClass: normal | ||
allocatorTopologyBalancing: true | ||
balloonTypes: | ||
- name: special | ||
matchExpressions: | ||
- key: pod/labels/app.kubernetes.io/component | ||
operator: Equals | ||
values: [ "precious" ] | ||
minCPUs: 2 | ||
maxCPUs: 2 | ||
- name: default | ||
namespaces: | ||
- default | ||
minCPUs: 1 | ||
maxCPUs: 1 | ||
allocatorPriority: normal | ||
reservedPoolNamespaces: | ||
- kube-system | ||
log: | ||
debug: | ||
- policy | ||
- expression |
24 changes: 24 additions & 0 deletions
24
test/e2e/policies.test-suite/balloons/n4c16/test11-match-expression/code.var.sh
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
# Test placing containers with and without annotations to correct balloons | ||
# reserved and shared CPUs. | ||
|
||
helm-terminate | ||
helm_config=${TEST_DIR}/../../match-config.yaml helm-launch balloons | ||
|
||
cleanup() { | ||
vm-command "kubectl delete pods --all --now" | ||
return 0 | ||
} | ||
|
||
cleanup | ||
|
||
# pod0: run precious workload | ||
POD_LABEL="app.kubernetes.io/component: precious" CONTCOUNT=1 create balloons-busybox | ||
report allowed | ||
verify 'len(cpus["pod0c0"]) == 2' | ||
|
||
# pod1: run ordinary workload | ||
CONTCOUNT=1 create balloons-busybox | ||
report allowed | ||
verify 'len(cpus["pod1c0"]) == 1' | ||
|
||
cleanup |