mirror of
https://github.com/kata-containers/kata-containers.git
synced 2026-07-01 14:38:33 +00:00
tests: harden sandbox sizing manifests for k8s cpu workloads
Route runtime-rs tests to dedicated manifests/templates and ensure the CPU allocation workloads always carry explicit memory limits, avoiding Dragonball sandbox startup failures from InvalidMemorySize(0). Signed-off-by: Fabiano Fidêncio <ffidencio@nvidia.com> Assisted-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
@@ -31,8 +31,14 @@ setup() {
|
||||
# Create the pods
|
||||
kubectl create -f "${yaml_file}"
|
||||
|
||||
# Wait for completion
|
||||
kubectl wait --for=jsonpath='{.status.phase}'=Succeeded --timeout=$timeout pod --all
|
||||
# Wait for each test container to terminate successfully. Using container
|
||||
# termination state is more robust than pod phase checks, which can lag.
|
||||
for pod in "${pods[@]}"; do
|
||||
kubectl wait \
|
||||
--for=jsonpath='{.status.containerStatuses[0].state.terminated.reason}'=Completed \
|
||||
--timeout=$timeout \
|
||||
"pod/${pod}"
|
||||
done
|
||||
|
||||
# Check the pods
|
||||
for i in {0..2}; do
|
||||
|
||||
@@ -13,3 +13,8 @@ spec:
|
||||
- name: default-cpu-demo-ctr
|
||||
image: quay.io/prometheus/busybox:latest
|
||||
command: ["tail", "-f", "/dev/null"]
|
||||
resources:
|
||||
limits:
|
||||
memory: "128Mi"
|
||||
requests:
|
||||
memory: "64Mi"
|
||||
|
||||
@@ -18,5 +18,7 @@ spec:
|
||||
resources:
|
||||
limits:
|
||||
cpu: "1"
|
||||
memory: "128Mi"
|
||||
requests:
|
||||
cpu: "500m"
|
||||
memory: "64Mi"
|
||||
|
||||
@@ -16,6 +16,7 @@ spec:
|
||||
resources:
|
||||
limits:
|
||||
cpu: "500m"
|
||||
memory: "128Mi"
|
||||
- name: c2
|
||||
image: quay.io/prometheus/busybox:latest
|
||||
command:
|
||||
@@ -24,3 +25,4 @@ spec:
|
||||
resources:
|
||||
limits:
|
||||
cpu: "500m"
|
||||
memory: "128Mi"
|
||||
|
||||
@@ -15,6 +15,9 @@ spec:
|
||||
containers:
|
||||
- name: vcpus-less-than-one-with-no-limits
|
||||
image: quay.io/prometheus/busybox:latest
|
||||
resources:
|
||||
limits:
|
||||
memory: "128Mi"
|
||||
command: ['nproc', '--all']
|
||||
restartPolicy: Never
|
||||
---
|
||||
@@ -32,6 +35,7 @@ spec:
|
||||
resources:
|
||||
limits:
|
||||
cpu: "0.25"
|
||||
memory: "128Mi"
|
||||
command: ['nproc', '--all']
|
||||
restartPolicy: Never
|
||||
---
|
||||
@@ -49,5 +53,6 @@ spec:
|
||||
resources:
|
||||
limits:
|
||||
cpu: "1.2"
|
||||
memory: "128Mi"
|
||||
command: ['nproc', '--all']
|
||||
restartPolicy: Never
|
||||
|
||||
@@ -223,7 +223,7 @@ remove_kata_runtime_config_dropin_file() {
|
||||
}
|
||||
|
||||
is_runtime_rs() {
|
||||
[[ "${KATA_HYPERVISOR}" == *-runtime-rs ]]
|
||||
[[ "${KATA_HYPERVISOR}" == *-runtime-rs ]] || [[ "${KATA_HYPERVISOR}" == "dragonball" ]]
|
||||
}
|
||||
|
||||
# Copy the right combination of drop-ins from drop-in-examples/ into
|
||||
|
||||
Reference in New Issue
Block a user