Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

246
Visualizações
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 Respostas
Responde à pergunta

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 Relatório

0

What about:

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

?

over 4 years ago · Santiago Trujillo Relatório
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda