argo-events: Unable to kubectl delete the event-bus

Describe the bug Installing the event bus through the docs works fine, but when deleting it using:

kubectl delete -n argo-events -f https://raw.githubusercontent.com/argoproj/argo-events/stable/examples/eventbus/native.yaml
eventbus.argoproj.io "default" deleted
kubectl apply -n argo-events -f https://raw.githubusercontent.com/argoproj/argo-events/stable/examples/eventbus/native.yaml
Warning: Detected changes to resource default which is currently being deleted.
eventbus.argoproj.io/default unchanged

it hangs on the deleted portion and seems to be stuck there, is there anyway that I can force delete this and reapply?

About this issue

  • Original URL
  • State: closed
  • Created 3 years ago
  • Reactions: 6
  • Comments: 16 (11 by maintainers)

Most upvoted comments

Had to delete EventBus thru patching finalisation:

kubectl edit eventbus -n argo-events

Find the stuck finalizer:

    finalizers:
    - eventbus-controller

And replace by

    finalizers: null

It is a big nuisance for automated installations. Most CI/CD tools are not clever enough to remove objects in a specified order.

@whynowy we have the corresponding controllers running. having to manually manipulate the finalizers to get an automated cleanup is unfortunate. Can you please describe why having the controllers running wouldn’t signal the finalizers deletion is permitted?

If the workloads are left but the controllers get deleted, something is out of order IMO.

Locally running skaffold delete (in our local environment) everything gets deleted but the event bus. That seems like a valid bug.

I’m fully aware “PRs are welcome” but as a core contributor could you confirm the bug first? Thank you

@whynowy I got clarification on this from others. This is a common approach. TIL 😄

For those interested, we have this in a make file to actually remove the finalizers (1 event bus, 1 sensor, 1 github event source):

.PHONY : clean
clean : ## delete all the things
	@skaffold delete
	@kubectl get eventsource github-event-source -o yaml | yq e 'del(.metadata.finalizers)' - | kubectl replace -f -
	@kubectl get sensor x-pr-updated -o yaml | yq e 'del(.metadata.finalizers)' - | kubectl replace -f -
	@kubectl get eb x-event-bus -o yaml | yq e 'del(.metadata.finalizers)' - | kubectl replace -f -

Credit for yq one liners goes to @em-jones Dependent on yq tool.

I’ve run into this issue aplenty. I wish argocd was intelligent enough to remove these properly… but here are my notes on the issue.

Stuck Terminating

argo-events

event bus

kubectl -n argo-events delete eb default

kubectl -n argo-events get eb default -o json > eb.json

# remove finalizer from eb.json

kubectl -n argo-events replace -f ./eb.json

eventsource

kubectl -n argo-events delete eventsource github

kubectl -n argo-events get eventsource github -o json > gh-eventsource.json

# remove finalizer from gh-eventsource.json

kubectl -n argo-events replace -f gh-eventsource.json

sensor

kubectl -n argo-events delete sensor github

kubectl -n argo-events get sensor github -o json > gh-sensor.json

# remove finalizer from gh-sensor.json

kubectl -n argo-events replace -f gh-sensor.json

namespace

kubectl delete ns argo-events

kubectl get ns argo-events -o json > argo-events.json

# remove finalizer from argo-events.json

kubectl replace -f ./argo-events.json