Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

250
Views
How to force delete resources in a non-existant namespace?

This question is a follow up of: How to list really all objects of a nonexistant namespace?

Long story short:

$ kubectl get namespaces
NAME              STATUS   AGE
argo              Active   27d
default           Active   27d
kube-node-lease   Active   27d
kube-public       Active   27d
kube-system       Active   27d

$ kubectl get eventbus -n argo-events
NAME      AGE
default   17h

$ kubectl get eventsource -n argo-events
NAME                  AGE
pubsub-event-source   14h

There are two resources in namespace argo-events which actually no longer exits because I deleted it and expected it to be gone with all resources in it. Obviously something didn't work as expected.

Now (after listing potentially more objects - first question) I want to really get rid of those resources because they seem to block a redeployment.

But this ...

$ kubectl delete eventbus default -n argo-events
eventbus.argoproj.io "default" deleted
^C
$ kubectl delete eventsource pubsub-event-source -n argo-events
eventsource.argoproj.io "pubsub-event-source" deleted
^C

... doesn't work.

So, how do I force their deletion?


UPDATE:

$ kubectl describe eventbus default -n argo-events | grep -A 3 final
        f:finalizers:
          .:
          v:"eventbus-controller":
      f:status:
$ kubectl describe eventsource pubsub-event-source -n argo-events | grep -A 3 final
        f:finalizers:
          .:
          v:"eventsource-controller":
      f:spec:
over 4 years ago · Santiago Trujillo
2 answers
Answer question

0

This worked:

$ kubectl create namespace argo-events
namespace/argo-events created

$ kubectl patch eventsource/pubsub-event-source -p '{"metadata":{"finalizers":[]}}' --type=merge -n argo-events
eventsource.argoproj.io/pubsub-event-source patched

$ kubectl patch eventbus/default -p '{"metadata":{"finalizers":[]}}' --type=merge -n argo-events
eventbus.argoproj.io/default patched

$ kubectl delete namespace argo-events
namespace "argo-events" deleted

If somebody stumbles upon this answer and knows why this works - please add an explanation in a comment. That would be cool, thanks.

over 4 years ago · Santiago Trujillo Report

0

What about:

kubectl delete eventsource pubsub-event-source -n argo-events --grace-period=0 --force

?

over 4 years ago · Santiago Trujillo Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!