Created
April 27, 2021 16:03
-
-
Save ikurni/b231c1ff32f8c98325af3376c1e616ca 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