-
-
Save hemanth22/a328b5537a450fbddbb52b422ca1c8d5 to your computer and use it in GitHub Desktop.
Delete pods stuck in terminating
This file contains hidden or 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
### Step 1 | |
oc delete pod <podsname> -n myproject --grace-period=0 --force | |
### Step 2 | |
oc edit pod <podsname> | |
#Remove deletionTimestamp | |
#Before: deletionTimestamp: 2019-12-31T11:40:28Z | |
#After: deletionTimestamp: null | |
#Remove Finalizers | |
#Before | |
finalizers: | |
- foregroundDeletion | |
#After | |
finalizers: null | |
### Step 3 | |
echo '{ "propagationPolicy": "Background" }' | curl -k -X DELETE -d @- -H "Authorization: Bearer Token" -H 'Accept: application/json' -H 'Content-Type: application/json' https://master.example.com:443/api/v1/namespaces/myproject/pods/my-app-123 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment