list

list redundant rs

$ kubectl -n <namespace> get rs | awk '{if ($2 + $3 + $4 == 0) print $1}'

remove useless replicasets

$ kubectl -n <namespaced> delete rs $(kubectl -n <namespace> get rs | awk '{if ($2 + $3 + $4 == 0) print $1}')
Copyright © marslo 2020-2023 all right reserved,powered by GitbookLast Modified: 2024-03-12 15:01:30

results matching ""

    No results matching ""