Hello @k.morina, you also need to create a resource of type “ServiceDefaults” with “dialedDirectly” feature enabled for your service.
See what the documentation says:
If the Ingress controller acts as a LoadBalancer and routes directly to Pod IPs instead of the ClusterIP of your Kubernetes Services a
ServiceDefault
CRD must be applied to each backend service allowing it to use thedialedDirectly
features. By default this is disabled.
Configure Ingress Controllers for Consul on Kubernetes | Consul | HashiCorp Developer
# Example Service defaults config entry
apiVersion: consul.hashicorp.com/v1alpha1
kind: ServiceDefaults
metadata:
name: backend
spec:
transparentProxy:
dialedDirectly: true
And if you check the NGINX Ingress documentation, it says this:
Why endpoints and not services¶
The NGINX ingress controller does not use Services to route traffic to the pods. Instead it uses the Endpoints API in order to bypass kube-proxy to allow NGINX features like session affinity and custom load balancing algorithms. It also removes some overhead, such as conntrack entries for iptables DNAT.
Miscellaneous - Ingress-Nginx Controller
Thus, this configuration is necessary. If I’m not mistaken, you can configure dialedDirectly: true
globally, using ProxyDefaults.
I faced similar issues when deploying Kong + Consul, and solved it this way. I hope it helps.