initial checkin
This commit is contained in:
commit
30253f1e40
|
@ -0,0 +1,6 @@
|
||||||
|
# k8s_cleanup-replicasets repo
|
||||||
|
|
||||||
|
## Introduction
|
||||||
|
|
||||||
|
This is a simple script to clean up orphaned replicaset objects.
|
||||||
|
|
|
@ -0,0 +1,10 @@
|
||||||
|
#!/bin/bash
|
||||||
|
|
||||||
|
nslist="default delfax guacamole home-automation homer k8stv nagios navidrome pihole tiddlywiki"
|
||||||
|
|
||||||
|
for i in $nslist
|
||||||
|
do
|
||||||
|
echo "Cleaning up orphaned replicasets in namespace ${i}."
|
||||||
|
kubectl -n $i delete rs $(kubectl -n $i get rs | awk '{if ($2 + $3 + $4 == 0) print $1}' | grep -v 'NAME') 2>/dev/null
|
||||||
|
done
|
||||||
|
|
Loading…
Reference in New Issue