Hub-agent removal

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

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 ?

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:

## 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!

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

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

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

1 Like

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

% kubectl get ns hub-agent
Error from server (NotFound): namespaces "hub-agent" not found
% kubectl get mutatingwebhookconfigurations hub
Error from server (NotFound): mutatingwebhookconfigurations.admissionregistration.k8s.io "hub" not found

when I try to update IngressRoute I see following

% 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 ?

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

kubectl delete validatingwebhookconfiguration hub

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

 helm uninstall hub-agent -n hub-agent

Or manually :

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

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