finalizers icon indicating copy to clipboard operation
finalizers copied to clipboard

[Feature request] Add ability to delete finalizers

Open todaywasawesome opened this issue 3 years ago • 2 comments

Maybe something like this? https://medium.com/pareture/script-to-force-remove-kubernetes-namespace-finalizer-57b72bd9460d

todaywasawesome avatar Feb 17 '22 22:02 todaywasawesome

I managed to delete all pending deletion resources blocked by a finalizer using this script:

finalizers | tail -n +2 | while read -r line; do
  namespace=$(echo "$line" | awk '{print $1}')
  name=$(echo "$line" | awk '{print $2}')
  kind=$(echo "$line" | awk '{print $4}')
  kubectl patch "$kind" "$name" -n "$namespace" --type=json -p='[{"op": "remove", "path": "/metadata/finalizers"}]'
done

bennesp avatar Jun 08 '23 11:06 bennesp

finalizers | awk '{print "kubectl patch -n " $1 " " $4 "/" $2 " --type json --patch='\''[ { \"op\": \"remove\", \"path\": \"/metadata/finalizers\" } ]'\''" }' | sh -x

kvaps avatar Feb 04 '24 16:02 kvaps