Hi Kamil Grebenicek,
I understand that you are trying to delete the Application Gateway for Containers and the associated Application LoadBalancer resources but leading to connection errors. This may happen because of the Finalizers.
Kubernetes resources sometimes get stuck in a Terminating state due to lingering finalizers that prevent deletion. Finalizers are special metadata fields that tell Kubernetes to wait before deleting an object until certain cleanup operations are completed. They act as pre-delete hooks, ensuring that dependent resources are properly handled before Kubernetes removes an object.
You can check if there is a finalizer for the Application Load balancer with the command below.
kubectl get applicationloadbalancer alb-test -n agc-test -o json > alb.json
If there is a Finalizer, you can remove it by editing the file. Then apply it with, this removes the application Load balancer.
kubectl replace --raw "/apis/alb.networking.azure.io/v1/namespaces/agc-test/applicationloadbalancers/alb-test/finalize" -f alb.json
Similarly, please check for the GatewayClass, if there is a finalizer.
Please refer to the documents about Finalizers and using-finalizers-to-control-deletion
If you have any further queries, let me know. If the information is helpful, please click on Upvote.
Thank you