Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add docs about how to avoid hanging finalizers during shut down #563

Open
kaganjd opened this issue Jan 8, 2025 · 0 comments
Open

Add docs about how to avoid hanging finalizers during shut down #563

kaganjd opened this issue Jan 8, 2025 · 0 comments
Assignees
Labels
enhancement New feature or request needs-triage Issues that need triage

Comments

@kaganjd
Copy link

kaganjd commented Jan 8, 2025

Description

If you are running the operator in the same namespace as your application, and you delete the entire namespace, you may end up with hanging finalizers like this:

  NamespaceContentRemaining                    True    Tue, 07 Jan 2025 14:55:19 -0800  SomeResourcesRemain   Some resources are remaining: domains.ingress.k8s.ngrok.com has 1 resource instances, httpsedges.ingress.k8s.ngrok.com has 1 resource instances, ingresses.networking.k8s.io has 1 resource instances, tunnels.ingress.k8s.ngrok.com has 1 resource instances
  NamespaceFinalizersRemaining                 True    Tue, 07 Jan 2025 14:55:19 -0800  SomeFinalizersRemain  Some content in the namespace has finalizers remaining: k8s.ngrok.com/finalizer in 4 resource instances

We should add docs suggesting:

  1. running the ngrok-operator in its own namespace
  2. shut down ngrok-operator namespace first, then application namespace
  3. if this isn't possible, run a script to delete all the finalizers on ngrok custom resources. @Alice-Lilith had the idea to make this a Helm pre-delete hook

script:

  1. first, set your namespace: namespace=set-your-namespace
  2. then run:
declare -a crds=("domains" "ingresses" "tunnels" "httpsedges")

for i in "${crds[@]}"; do for j in $(kubectl get $i -n $namespace -o name | cut -d '/' -f 2-); do kubectl patch $i $j -n $namespace -p '{"metadata":{"finalizers":[]}}' --type=merge; done; done

Use Case

No response

Related issues

No response

@kaganjd kaganjd added enhancement New feature or request needs-triage Issues that need triage labels Jan 8, 2025
@kaganjd kaganjd self-assigned this Jan 8, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request needs-triage Issues that need triage
Projects
None yet
Development

No branches or pull requests

1 participant