mirror of
https://github.com/Alfresco/SearchServices.git
synced 2025-09-17 14:21:20 +00:00
18 lines
383 B
Bash
Executable File
18 lines
383 B
Bash
Executable File
#!/bin/bash
|
|
# Randomly delete pods in a Kubernetes namespace.
|
|
set -ex
|
|
|
|
while true
|
|
do
|
|
kubectl \
|
|
--namespace "${NAMESPACE}" \
|
|
-o 'jsonpath={.items[*].metadata.name}' \
|
|
get pods | \
|
|
tr " " "\n" | \
|
|
shuf | \
|
|
head -n ${KILL_NR} |
|
|
xargs -t --no-run-if-empty \
|
|
kubectl --namespace "${NAMESPACE}" delete pod
|
|
sleep "${DELAY_SEC}"
|
|
done
|