diff --git a/deploy/00-rbac.yaml b/deploy/00-rbac.yaml index 253718c..198cbfe 100644 --- a/deploy/00-rbac.yaml +++ b/deploy/00-rbac.yaml @@ -60,7 +60,7 @@ rules: verbs: ["get"] - apiGroups: [""] resources: ["pods"] - verbs: ["get", "list", "watch", "create", "update", "patch"] + verbs: ["get", "list", "watch", "create", "update", "patch", "delete"] --- kind: ClusterRoleBinding apiVersion: rbac.authorization.k8s.io/v1 diff --git a/orchestrator/k8s.py b/orchestrator/k8s.py index ff88fa0..431e0d8 100644 --- a/orchestrator/k8s.py +++ b/orchestrator/k8s.py @@ -63,3 +63,4 @@ def run_on_node(fn, node): wait_for(is_finished, "task to finish") if task_pod.obj["status"]["phase"] != "Succeeded": raise Exception(f"Task {name} failed") + task_pod.delete()