diff --git a/README.md b/README.md index 689d9a4..ff3fefe 100644 --- a/README.md +++ b/README.md @@ -39,6 +39,8 @@ * [Node maintenance](#node-maintenance) * [What happens if a node goes down?](#what-happens-node-down) * [Dealing with disruptions](#disruptions) +* [Troubleshooting](#troubleshooting) + * [Deleting a stuck namespace](#ts-delete-stuck-namespace) # kubectl - BASH autocompletion For current shell only: @@ -881,3 +883,10 @@ node/k3s-node2 uncordoned * https://kubernetes.io/docs/concepts/workloads/pods/disruptions/ * https://kubernetes.io/docs/tasks/administer-cluster/safely-drain-node/ +# Troubleshooting +## Deleting a stuck namespace +``` +kubectl get namespace "stucked-namespace" -o json \ + | tr -d "\n" | sed "s/\"finalizers\": \[[^]]\+\]/\"finalizers\": []/" \ + | kubectl replace --raw /api/v1/namespaces/stucked-namespace/finalize -f - +``` \ No newline at end of file