Skip to content

Instantly share code, notes, and snippets.

@karawitan
Created February 22, 2024 23:33
Show Gist options
  • Select an option

  • Save karawitan/92591c61e75a55389f5a2326c94b5106 to your computer and use it in GitHub Desktop.

Select an option

Save karawitan/92591c61e75a55389f5a2326c94b5106 to your computer and use it in GitHub Desktop.

Revisions

  1. karawitan created this gist Feb 22, 2024.
    13 changes: 13 additions & 0 deletions gistfile1.txt
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,13 @@

    # when deletion of Kubernetes resource is getting stuck, solve it the bad way

    kubectl patch configmap/mymap \
    --type json \
    --patch='[ { "op": "remove", "path": "/metadata/finalizers" } ]'

    #

    kubectl patch ns/longhorn-system -p '{"metadata":{"finalizers":[]}}' --type=merge


    # for a better option , read "Stop Messing with Kubernetes Finalizers" at https://martinheinz.dev/blog/74