# Cannot integrate ingress controller nginx with consul

**URL:** <https://discuss.hashicorp.com/t/cannot-integrate-ingress-controller-nginx-with-consul/45788>\
**Category:** Consul\
**Tags:** k8s\
**Created:** [October 19, 2022, 11:10am UTC](https://discuss.hashicorp.com/t/cannot-integrate-ingress-controller-nginx-with-consul/45788 "2022-10-19T11:10:14Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![m.mucha](https://sea2.discourse-cdn.com/hashicorp/user_avatar/discuss.hashicorp.com/m.mucha/32/24541_2.png) [@m.mucha](https://discuss.hashicorp.com/u/m.mucha)\
**Post date:** [October 19, 2022, 11:10am UTC](https://discuss.hashicorp.com/t/cannot-integrate-ingress-controller-nginx-with-consul/45788/1 "2022-10-19T11:10:14Z")

</div>

Hi,  
I want kubernetess nginx ingress controller to be a gateway to consul service mesh.  
For this I follow description here :  
**1. [Configure Ingress Controllers for Consul on Kubernetes | Consul | HashiCorp Developer](https://developer.hashicorp.com/consul/docs/k8s/connect/ingress-controllers)**  
and also example posted on the page linked above in point 1:  
**2. [GitHub - dhiaayachi/eks-consul-ingressnginx: This a basic deployment to show case using nginx as ingress with Consul in transparent mode](https://github.com/dhiaayachi/eks-consul-ingressnginx)**

So I just deployed above example , but on local docker-desctop k8s cluster instead of on aks.

So I made no changes to the code, just cloned repo and applied with helm.  
I also tried my own attempts following configuration steps described under link number 1.

I always end up with thing like this:  
when  
_k get po_  
I get:  
NAME | READY | STATUS | RESTARTS | AGE  
ingress-nginx-controller-546cccdf66-7z65t | 0/2 | Init:1/2 | 3 (5m18s ago) | 26m

and when I get logs with command:  
_k logs ingress-nginx-controller-5fcf5957bf-5dtnm -c consul-connect-inject-init_

I get:  
2022-10-19T11:05:44.334Z [ERROR] Timed out waiting for service registration: error=“Get "[http://192.168.65.4:8500/v1/agent/services?filter=Meta[“pod-name”]+%3D%3D+“ingress-nginx-controller-5fcf5957bf-5dtnm”+and+Meta[“k8s-namespace”]+%3D%3D+“ingress-nginx”+\](http://192.168.65.4:8500/v1/agent/services?filter=Meta%5B%22pod-name%22%5D+%3D%3D+%22ingress-nginx-controller-5fcf5957bf-5dtnm%22+and+Meta%5B%22k8s-namespace%22%5D+%3D%3D+%22ingress-nginx%22+%5C)”: dial tcp 192.168.65.4:8500: connect: no route to host"

So consul-connect-inject-init init container tries to request consul api for services but for some reason we get no route to host.  
I did a test, got an IP address of consul-server POD, then from within some POD in a cluster I just made request  
_wget http://\<here\_pod\_ip\>:8500/v1/agent/services_  
and got 200 OK.

So looks like ingress controller pod has badly configured IP of agent to request service from.

Why is that, what I am missing?

I am doing it on clean k8s local cluster deployed by docker-desctop on mac with ARM64 architecture

---

<div class="post-metadata">

**Author:** ![m.mucha](https://sea2.discourse-cdn.com/hashicorp/user_avatar/discuss.hashicorp.com/m.mucha/32/24541_2.png) [@m.mucha](https://discuss.hashicorp.com/u/m.mucha)\
**Post date:** [October 21, 2022, 8:57am UTC](https://discuss.hashicorp.com/t/cannot-integrate-ingress-controller-nginx-with-consul/45788/2 "2022-10-21T08:57:38Z")

</div>

For some reason this happen only when run on docker-desctop k8s kluster. When run on minikube no such things. Actually I have no idea why. Can someone explain it, any idea. So I will continue my tests on minikube . There no issue any more from my perspective.
