Multiple Ingress Gateways - Can't seem to get it to work

Hello,

I am running a fairly simple setup. 6 servers (3 are nomad and consul server instances, other 3 are nomad and consul client agents which also run docker).

I am trying to get multiple ingress gateways to work with Consul Connect using multiple “count-dash” applications.

My two Job definitions are here:

The first one is created absolutely fine, however once I run the second job, nomad refuses to start up the second ingress container, and I get the error:

error creating bootstrap configuration for Connect proxy sidecar: alloc_id=xxx task=connect-ingress-ingress-2-service error=“exit status 1” stderr="==> Cannot lookup the ingress-gateway’s proxy ID because multiple are registered with the agent

Can you not have more than 1 ingress running perhaps? I feel like I am missing something, but I can’t see what.

Any help much appreciated

Hi @microadam sorry about the trouble; this is a bug that should be fixed in the upcoming v1.0.4 release

1 Like

Ahh thank you for the heads up! I was going slightly mad trying to work out what I was missing!

Is there an ETA on release of v1.0.4 at all?

Also, if you wouldn’t mind answering another question, as its something I am uncertain about and this was a blocker in figuring it out. Can the ingress listener ports be the same across multiple different ingress, with nomad automatically providing the port of the service, so we don’t have to keep track of each applications listener port? i.e in my example above, I would like to keep the listener port as 8080 in both jobs and then get rid of the static ports, so nomad uses an auto assigned one and then use something like traefik to work out where each ingress service is. Is this possible? Or do we have to micro manage the listener ports and keep these unique across different ingress services?

Many thanks!

We don’t have an exact date, but v1.0.4 should right around the corner, like next week or the week after (RC first, then release).

The listener port can be the same across IGs, as long as they are in different group blocks (i.e. running in different allocations with their own network namespace) - which is obviously going to be true if they’re in different jobs. You would just omit the static part in the port block, and probably set the service.port to the label so you can find the IG port from Consul.

Something like,

job "ig" {                                                                                                                                          
  datacenters = ["dc1"]                                                                                                                             
  group "ingress-group" {                                                                                                                           
    network {                                                                                                                                       
      mode = "bridge"                                                                                                                               
      port "inbound" {                                                                                                                              
        # now dynamic -> static                                                                                                                     
        to     = 8080                                                                                                                               
      }                                                                                                                                             
    }                                                                                                                                               
    service {                                                                                                                                       
      name = "my-ingress-service"                                                                                                                   
      port = "inbound" # put the dynamic port in consul                                                                                             
      connect {                                                                                                                                     
        gateway {                                                                                                                                   
          proxy {}                                                                                                                                  
          ingress {                                                                                                                                 
            listener {                                                                                                                              
              port     = 8080 # inside net-namespace                                                                                                
              protocol = "tcp"                                                                                                                      
              service {                                                                                                                             
                name = "your-connect-service"                                                                                                       
              }                                                                                                                                     
            }                                                                                                                                       
          }                                                                                                                                         
        }                                                                                                                                           
      }                                                                                                                                             
    }                                                                                                                                               
  }                                                                                                                                                 
}   
1 Like

this is great! thank you for the explanation :slight_smile: