Created
September 7, 2019 02:40
-
-
Save kwokhou/87d3e97b60daf5653e446090ae4f1783 to your computer and use it in GitHub Desktop.
Fix kubernetes pods or namespace stuck at removing/terminating state
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Pre-requisite | |
# 1. change <my-namespace> to the namespace to alter finalizing | |
# 2. change <my-cluster-id> to the cluster id from rancher url (e.g. https://my-rancher-ip/c/<my-cluster-id>/nodes | |
# 3 Replace the following commands in a text editor and run | |
(NAMESPACE=<my-namespace>; CLUSTER=c-fm5bd; kubectl proxy & kubectl get namespace $NAMESPACE -o json |jq '.spec = {"finalizers":[]}' >temp.json; curl -k -H "Content-Type: application/json" -X PUT --data-binary @temp.json 127.0.0.1:8001/k8s/clusters/$CLUSTER/api/v1/namespaces/$NAMESPACE/finalize; ) | |
# Source: https://github.com/rancher/rancher/issues/16477 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
fix stuck terminating pv by patching the finalizers to null
or for pod
source: kubernetes/kubernetes#69697 (comment)