How can I restart or reset the custom namespace pods

Solution 1:

In two commands:

kubectl delete pod -n kube-system --all
kubectl delete pod -n xyz-system --all

In "one":

kubectl get pods -A | awk 'NR>1{print $1" "$2}' \
    | while read ns pod; do \
        kubectl delete -n $ns pod $pod; done

Or:

kubectl get ns | awk 'NR>1{print $1}' \
    | while read ns; do \
         kubectl delete pod -n $ns --all; done

Though I second @jonas comment: sounds like a weird question, with no real-life use cases that I know of.