mirror of
https://github.com/kata-containers/kata-containers.git
synced 2026-07-01 22:50:54 +00:00
Merge pull request #13164 from manuelh-dev/mahuber/remove-resource-requests
tests: use limits for Kata workload resources
This commit is contained in:
@@ -23,6 +23,9 @@ setup_yaml() {
|
||||
|
||||
|
||||
@test "Exceeding memory constraints" {
|
||||
# pod-memory-limit.yaml has a fixed 700Mi request. Rendering a lower
|
||||
# limit makes the pod invalid, so the Kubernetes API rejects it before
|
||||
# the stress workload can start.
|
||||
memory_limit_size="50Mi"
|
||||
allocated_size="250M"
|
||||
|
||||
@@ -41,6 +44,8 @@ setup_yaml() {
|
||||
}
|
||||
|
||||
@test "Running within memory constraints" {
|
||||
# Render a limit above the fixed 700Mi request. Kubernetes accepts the
|
||||
# pod, and the workload allocates less than the configured request/limit.
|
||||
memory_limit_size="800Mi"
|
||||
allocated_size="150M"
|
||||
|
||||
|
||||
@@ -15,8 +15,6 @@ spec:
|
||||
command: ["bash"]
|
||||
args: ["-c", "inotifywait --timeout 120 -r /config/ && [[ -L /config/config.toml ]] && echo success" ]
|
||||
resources:
|
||||
requests:
|
||||
memory: 50Mi
|
||||
limits:
|
||||
memory: 1024Mi
|
||||
volumeMounts:
|
||||
|
||||
@@ -33,8 +33,8 @@ spec:
|
||||
securityContext:
|
||||
runAsUser: 3000
|
||||
resources:
|
||||
requests:
|
||||
cpu: 100m
|
||||
memory: 100Mi
|
||||
limits:
|
||||
cpu: 500m
|
||||
memory: 800Mi
|
||||
ports:
|
||||
- containerPort: 6379
|
||||
|
||||
@@ -31,8 +31,8 @@ spec:
|
||||
- name: master
|
||||
image: quay.io/kata-containers/test-images/opstree/redis:sha256-2642c7b07713df6897fa88cbe6db85170690cf3650018ceb2ab16cfa0b4f8d48
|
||||
resources:
|
||||
requests:
|
||||
cpu: 100m
|
||||
memory: 100Mi
|
||||
limits:
|
||||
cpu: 500m
|
||||
memory: 800Mi
|
||||
ports:
|
||||
- containerPort: 6379
|
||||
|
||||
@@ -30,8 +30,8 @@ spec:
|
||||
- name: master
|
||||
image: quay.io/kata-containers/test-images/opstree/redis:sha256-2642c7b07713df6897fa88cbe6db85170690cf3650018ceb2ab16cfa0b4f8d48
|
||||
resources:
|
||||
requests:
|
||||
cpu: 100m
|
||||
memory: 100Mi
|
||||
limits:
|
||||
cpu: 500m
|
||||
memory: 800Mi
|
||||
ports:
|
||||
- containerPort: 6379
|
||||
|
||||
@@ -35,8 +35,8 @@ spec:
|
||||
- name: master
|
||||
image: quay.io/kata-containers/test-images/opstree/redis:sha256-2642c7b07713df6897fa88cbe6db85170690cf3650018ceb2ab16cfa0b4f8d48
|
||||
resources:
|
||||
requests:
|
||||
cpu: 100m
|
||||
memory: 100Mi
|
||||
limits:
|
||||
cpu: 500m
|
||||
memory: 800Mi
|
||||
ports:
|
||||
- containerPort: 6379
|
||||
|
||||
@@ -30,8 +30,8 @@ spec:
|
||||
- name: master
|
||||
image: quay.io/kata-containers/test-images/opstree/redis:sha256-2642c7b07713df6897fa88cbe6db85170690cf3650018ceb2ab16cfa0b4f8d48
|
||||
resources:
|
||||
requests:
|
||||
cpu: 100m
|
||||
memory: 100Mi
|
||||
limits:
|
||||
cpu: 500m
|
||||
memory: 800Mi
|
||||
ports:
|
||||
- containerPort: 6379
|
||||
|
||||
@@ -10,7 +10,5 @@ metadata:
|
||||
spec:
|
||||
limits:
|
||||
- default:
|
||||
cpu: 1
|
||||
defaultRequest:
|
||||
cpu: 0.5
|
||||
type: Container
|
||||
|
||||
@@ -15,9 +15,6 @@ spec:
|
||||
- name: numa-check
|
||||
image: "quay.io/kata-containers/numa:2026-05-15@sha256:a863fcf95fcbbf63352b0555a61a62537f74399dc4bca826a2e42d001e26accb"
|
||||
resources:
|
||||
requests:
|
||||
cpu: "1"
|
||||
memory: "1Gi"
|
||||
limits:
|
||||
cpu: "${NUMA_TEST_VCPUS}"
|
||||
memory: "${NUMA_TEST_MEMORY}"
|
||||
|
||||
@@ -15,9 +15,6 @@ spec:
|
||||
- name: numa-check
|
||||
image: "quay.io/kata-containers/numa:2026-05-15@sha256:a863fcf95fcbbf63352b0555a61a62537f74399dc4bca826a2e42d001e26accb"
|
||||
resources:
|
||||
requests:
|
||||
cpu: "1"
|
||||
memory: "1Gi"
|
||||
limits:
|
||||
cpu: "${NUMA_TEST_VCPUS}"
|
||||
memory: "${NUMA_TEST_MEMORY}"
|
||||
|
||||
@@ -16,5 +16,3 @@ spec:
|
||||
resources:
|
||||
limits:
|
||||
memory: "800Mi"
|
||||
requests:
|
||||
memory: "600Mi"
|
||||
|
||||
@@ -17,6 +17,3 @@ spec:
|
||||
limits:
|
||||
memory: "600Mi"
|
||||
cpu: "700m"
|
||||
requests:
|
||||
memory: "600Mi"
|
||||
cpu: "700m"
|
||||
|
||||
@@ -21,9 +21,6 @@ spec:
|
||||
limits:
|
||||
hugepages-${hugepages_size}: 512Mi
|
||||
memory: 512Mi
|
||||
requests:
|
||||
hugepages-${hugepages_size}: 512Mi
|
||||
memory: 512Mi
|
||||
volumes:
|
||||
- name: hugepage
|
||||
emptyDir:
|
||||
|
||||
@@ -16,6 +16,8 @@ spec:
|
||||
resources:
|
||||
limits:
|
||||
memory: "${memory_size}"
|
||||
# k8s-memory.bats renders different limits against this fixed request:
|
||||
# lower values must be rejected, valid higher values should be accepted.
|
||||
requests:
|
||||
memory: "700Mi"
|
||||
command: ["stress"]
|
||||
|
||||
@@ -20,8 +20,6 @@ spec:
|
||||
resources:
|
||||
limits:
|
||||
memory: 400Mi
|
||||
requests:
|
||||
memory: 400Mi
|
||||
- image: quay.io/kata-containers/sysbench-kata:latest
|
||||
imagePullPolicy: IfNotPresent
|
||||
name: not-oom
|
||||
@@ -30,5 +28,3 @@ spec:
|
||||
resources:
|
||||
limits:
|
||||
memory: 500Mi
|
||||
requests:
|
||||
memory: 500Mi
|
||||
|
||||
@@ -28,7 +28,7 @@ spec:
|
||||
- name: master
|
||||
image: quay.io/libpod/redis
|
||||
resources:
|
||||
requests:
|
||||
limits:
|
||||
cpu: 100m
|
||||
memory: 100Mi
|
||||
ports:
|
||||
|
||||
@@ -23,7 +23,7 @@ spec:
|
||||
- containerPort: 80
|
||||
protocol: TCP
|
||||
resources:
|
||||
requests:
|
||||
limits:
|
||||
cpu: 200m
|
||||
restartPolicy: Always
|
||||
---
|
||||
|
||||
@@ -23,7 +23,7 @@ spec:
|
||||
- containerPort: 80
|
||||
protocol: TCP
|
||||
resources:
|
||||
requests:
|
||||
limits:
|
||||
cpu: 200m
|
||||
restartPolicy: Always
|
||||
---
|
||||
|
||||
@@ -23,7 +23,7 @@ spec:
|
||||
- containerPort: 80
|
||||
protocol: TCP
|
||||
resources:
|
||||
requests:
|
||||
limits:
|
||||
cpu: 200m
|
||||
restartPolicy: Always
|
||||
---
|
||||
|
||||
@@ -23,7 +23,7 @@ spec:
|
||||
- containerPort: 8080
|
||||
protocol: TCP
|
||||
resources:
|
||||
requests:
|
||||
limits:
|
||||
cpu: 200m
|
||||
restartPolicy: Always
|
||||
---
|
||||
|
||||
@@ -23,7 +23,7 @@ spec:
|
||||
- containerPort: 80
|
||||
protocol: TCP
|
||||
resources:
|
||||
requests:
|
||||
limits:
|
||||
cpu: 200m
|
||||
restartPolicy: Always
|
||||
---
|
||||
|
||||
Reference in New Issue
Block a user