Created
August 3, 2020 10:33
-
-
Save jpbochi/3138e6fff7f8ab7c3aee717c5c00cb4a to your computer and use it in GitHub Desktop.
kubectl force delete
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
# Start a kubectl proxy | |
kubectl proxy | |
# Get a json with the resource you want to delete | |
kubectl get challenges.acme.cert-manager.io quickstart-example-tls-1016717128-3781756796-4176224615 -o json > bad.json | |
# Make a PUT call removing any finalizer | |
cat bad.json | jq '. | setpath(["metadata","finalizers"]; [])' | curl -kD- -H "Content-Type: application/json" -X PUT --data-binary @- "127.0.0.1:8001$(cat bad.json | jq -r '.metadata.selfLink')" |
alternative:
kubectl -n {ns} delete pod/{pod-name} --grace-period=0 --force
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
source (I think) was kubernetes/kubernetes#77086 (comment)