Skip to content
Snippets Groups Projects
Commit 9b3aad79 authored by Pierre Ozoux's avatar Pierre Ozoux
Browse files

Adds rebalance script.

parent 9755eeb5
No related branches found
No related tags found
No related merge requests found
#!/bin/bash
for ns in `kubectl get ns --no-headers | cut -d" " -f1`; do
web=""
app=""
web=`kubectl -n $ns get po -l app.kubernetes.io/name=nextcloud,app.kubernetes.io/component=web --no-headers -o wide | grep "pw5\|pw6" | cut -d" " -f1 | head -n1`
app=`kubectl -n $ns get po -l app.kubernetes.io/name=nextcloud,app.kubernetes.io/component=app --no-headers -o wide | grep "pw5\|pw6" | cut -d" " -f1 | head -n1`
if [ ! -z "$web" ]; then
kubectl -n $ns --wait=false delete po $web
fi
if [ ! -z "$app" ]; then
kubectl -n $ns --wait=false delete po $app
fi
done
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment