From eaf05ddf178a459476a809f6228e033bbc2d4bb2 Mon Sep 17 00:00:00 2001 From: JJGadgets Date: Fri, 8 Dec 2023 07:22:31 +0800 Subject: [PATCH] feat(taskfiles): send out the cops to clear pods! --- .taskfiles/k8s/Taskfile.dist.yaml | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/.taskfiles/k8s/Taskfile.dist.yaml b/.taskfiles/k8s/Taskfile.dist.yaml index e02c51fc..ac650dd8 100644 --- a/.taskfiles/k8s/Taskfile.dist.yaml +++ b/.taskfiles/k8s/Taskfile.dist.yaml @@ -119,6 +119,16 @@ tasks: - |- kubectl get crds -o jsonpath='{range .items[*]}{.spec.names.kind}: {.spec.names.shortNames}{"\n"}{end}' + clear-old-pods: + aliases: [cop] + desc: Clears all old pods remaining after a reboot + cmds: + - |- + while true; do + kubectl delete pod -A --field-selector=status.phase==Failed || true; + kubectl delete pod -A --field-selector=status.phase==Succeeded || true; + done + iperf2: desc: Start a iperf2 server on one node, and iperf2 client on another node, to benchmark network performance. dir: "/{{.ROOT_DIR}}/.taskfiles/k8s/template/iperf2"