forked from kata-containers/kata-containers
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request kata-containers#10193 from GabyCT/topic/k8ssoak
stability: Add kubernetes parallel test
- Loading branch information
Showing
2 changed files
with
70 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
#!/bin/bash | ||
# | ||
# Copyright (c) 2024 Intel Corporation | ||
# | ||
# SPDX-License-Identifier: Apache-2.0 | ||
# | ||
|
||
SCRIPT_PATH=$(dirname "$(readlink -f "$0")") | ||
source "${SCRIPT_PATH}/../metrics/lib/common.bash" | ||
|
||
set -x | ||
|
||
replicas="${replicas:-8}" | ||
deployment_name="${deployment_name:-deploymenttest}" | ||
# How many times will we run the test loop... | ||
iterations="${iterations:-20}" | ||
|
||
function delete_deployment() { | ||
kubectl delete deployment "${deployment_name}" | ||
} | ||
|
||
function go() { | ||
kubectl scale deployment/"${deployment_name}" --replicas="${replicas}" | ||
cmd="kubectl get deployment/${deployment_name} -o yaml | grep 'availableReplicas: ${replicas}'" | ||
waitForProcess "300" "30" "${cmd}" | ||
} | ||
|
||
function init() { | ||
kubectl create -f "${SCRIPT_PATH}/runtimeclass_workloads/pod-deployment.yaml" | ||
kubectl wait --for=condition=Available --timeout=30s deployment/"${deployment_name}" | ||
} | ||
|
||
function main() { | ||
check_processes | ||
local i=0 | ||
for (( i=1; i<="${iterations}"; i++ )); do | ||
info "Start iteration $i of $iterations" | ||
init | ||
#spin them up | ||
go | ||
#shut them all down | ||
delete_deployment | ||
done | ||
} | ||
|
||
main "$@" |
24 changes: 24 additions & 0 deletions
24
tests/stability/runtimeclass_workloads/pod-deployment.yaml
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 @@ | ||
# Copyright (c) 2024 Intel Corporation | ||
# | ||
# SPDX-License-Identifier: Apache-2.0 | ||
# | ||
apiVersion: apps/v1 | ||
kind: Deployment | ||
metadata: | ||
name: deploymenttest | ||
spec: | ||
selector: | ||
matchLabels: | ||
purpose: pod-test | ||
replicas: 2 | ||
template: | ||
metadata: | ||
labels: | ||
purpose: pod-test | ||
spec: | ||
terminationGracePeriodSeconds: 0 | ||
runtimeClassName: kata | ||
containers: | ||
- name: pod-test | ||
image: quay.io/prometheus/busybox:latest | ||
command: ["tail", "-f", "/dev/null"] |