# Hub-agent removal

**URL:** <https://community.traefik.io/t/hub-agent-removal/13909>\
**Category:** Traefik v2\
**Tags:** kubernetes-ingress\
**Created:** [March 25, 2022, 8:20pm UTC](https://community.traefik.io/t/hub-agent-removal/13909 "2022-03-25T20:20:43Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![rp346](https://avatars.discourse-cdn.com/v4/letter/r/76d3ee/32.png) [@rp346](https://community.traefik.io/u/rp346)\
**Post date:** [March 25, 2022, 8:20pm UTC](https://community.traefik.io/t/hub-agent-removal/13909/1 "2022-03-25T20:20:43Z")

</div>

I had installed Trafik Hub beta on Kubenrets cluster for some time. recently I removed hub-agent by deleting the namespace. Now when I try to update anything for `IngressRoute` I get following error

```auto
error: ingressroutes.traefik.containo.us "app-external" could not be patched: Internal error occurred: failed calling webhook "hub-agent.hub-agent.svc": Post "https://hub-agent-controller.hub-agent.svc:443/?timeout=10s": service "hub-agent-controller" not found
You can run `kubectl replace -f /var/folders/4d/8x1jzt_d3qbdhrv3bdqh8xtw0000gp/T/kubectl-edit-665412160.yaml` to try this update again.

```

How can I remove all reference to `hub-agent` ?

---

<div class="post-metadata">

**Author:** ![douglasdtm](https://sea2.discourse-cdn.com/flex020/user_avatar/community.traefik.io/douglasdtm/32/2002_2.png) [@douglasdtm](https://community.traefik.io/u/douglasdtm)\
**Post date:** [March 25, 2022, 9:03pm UTC](https://community.traefik.io/t/hub-agent-removal/13909/2 "2022-03-25T21:03:21Z")

</div>

Hello!

Sometimes it can occur that a CRD might block a resource exclusion due to a failed webhook, leaving the resource orphaned on Kubernetes.

Have you deleted the whole namespace where hub was deployed?

If so you could try checking for those failed webhooks and then get rid of them forcefully like this:

```auto
## Find it
kubectl get namespace test -o json |jq '.spec = {"finalizers":[]}' > temp.json

## Remove Manually
curl -k -H "Content-Type: application/json" -X PUT --data-binary @temp.json <kube-api-addr>:8001/api/v1/namespaces/<hook-name>/finalize

```

I will also let the Hub team know about this issue!

---

<div class="post-metadata">

**Author:** ![rp346](https://avatars.discourse-cdn.com/v4/letter/r/76d3ee/32.png) [@rp346](https://community.traefik.io/u/rp346)\
**Post date:** [March 28, 2022, 2:09pm UTC](https://community.traefik.io/t/hub-agent-removal/13909/3 "2022-03-28T14:09:17Z")

</div>

`hub-agent` was deployed into namespace `hub-agent` which I deleted completely.

How can I fix this. This is blocking me from updating `ingressroutes`

---

<div class="post-metadata">

**Author:** ![mloiseleur](https://sea2.discourse-cdn.com/flex020/user_avatar/community.traefik.io/mloiseleur/32/4987_2.png) [@mloiseleur](https://community.traefik.io/u/mloiseleur)\
**Post date:** [March 28, 2022, 2:41pm UTC](https://community.traefik.io/t/hub-agent-removal/13909/4 "2022-03-28T14:41:11Z")

</div>

Hub Agent comes with MutatingWebHook. MutatingWebHooks are not tied to a namespace.

Manually, you'll need to delete the namespace AND this MutatingWebHook :

`kubectl delete mutatingwebhookconfigurations hub`

---

<div class="post-metadata">

**Author:** ![rp346](https://avatars.discourse-cdn.com/v4/letter/r/76d3ee/32.png) [@rp346](https://community.traefik.io/u/rp346)\
**Post date:** [March 29, 2022, 5:49pm UTC](https://community.traefik.io/t/hub-agent-removal/13909/5 "2022-03-29T17:49:36Z")

</div>

I deleted MutatingWebHook with `kubectl delete mutatingwebhookconfigurations hub` & namespace `hub-agent`

```auto
% kubectl get ns hub-agent
Error from server (NotFound): namespaces "hub-agent" not found

```

```auto
% kubectl get mutatingwebhookconfigurations hub
Error from server (NotFound): mutatingwebhookconfigurations.admissionregistration.k8s.io "hub" not found

```

when I try to update `IngressRoute` I see following

```auto
% kubectl -n marketing edit IngressRoute external-1
error: ingressroutes.traefik.containo.us "external-1" could not be patched: Internal error occurred: failed calling webhook "hub-agent.hub-agent.svc": Post "https://hub-agent-controller.hub-agent.svc:443/validation?timeout=10s": service "hub-agent-controller" not found
You can run `kubectl replace -f /var/folders/4d/8x1jzt_d3qbdhrv3bdqh8xtw0000gp/T/kubectl-edit-2566697197.yaml` to try this update again.

```

What I am missing here ?

---

<div class="post-metadata">

**Author:** ![mloiseleur](https://sea2.discourse-cdn.com/flex020/user_avatar/community.traefik.io/mloiseleur/32/4987_2.png) [@mloiseleur](https://community.traefik.io/u/mloiseleur)\
**Post date:** [March 30, 2022, 6:54am UTC](https://community.traefik.io/t/hub-agent-removal/13909/6 "2022-03-30T06:54:42Z")

</div>

It comes also with a validatingwebhook. So for a complete manual uninstall, you'll have to delete this webhook too

```auto
kubectl delete validatingwebhookconfiguration hub

```

So, in summary, for a complete uninstall, one can use either helm :

```auto
 helm uninstall hub-agent -n hub-agent

```

Or manually :

```auto
kubectl delete namespace hub-agent
kubectl delete mutatingwebhookconfigurations hub
kubectl delete validatingwebhookconfigurations hub

```

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/flex020/uploads/containo/original/2X/b/bd81ebdb578656e76e56ff3cc3eed021d3ba132d.png) [@system](https://community.traefik.io/u/system)\
**Post date:** [April 2, 2022, 6:55am UTC](https://community.traefik.io/t/hub-agent-removal/13909/7 "2022-04-02T06:55:02Z")

</div>

This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.
