<p>I'm trying to add consul ingress to my project, and I'm using this GitHub repo as a doc for ui and ingress: <a href="https://github.com/hashicorp/consul-helm/blob/497ebbf3cf875b028006a0453d6232df50897d42/values.yaml#L610" rel="nofollow noreferrer">here</a> and as you can see unfortunately there is no ingress in doc, there is an ingressGateways which is not useful because doesn't create ingress inside Kubernetes(it can just expose URL to outside)</p>
<p>I have searched a lot, there are 2 possible options:</p>
<p>1: create extra deployment for ingress</p>
<p>2: create consul helm chart to add ingress deploy</p>
<p>(unfortunately I couldn't find a proper solution for this on the Internet)</p>

sasan
<p>Here is an example Docker compose file which configures Traefik to expose an entrypoint named <code>web</code> which listens on TCP port 8000, and integrates Traefik with Consul's service catalog for endpoint discovery.</p>
<pre class="lang-yaml prettyprint-override"><code># docker-compose.yaml
---
version: &quot;3.8&quot;
services:
  consul:
    image: consul:1.8.4
    ports:
      - &quot;8500:8500/tcp&quot;
  traefik:
    image: traefik:v2.3.1
    ports:
      - &quot;8000:8000/tcp&quot;
    environment:
      TRAEFIK_PROVIDERS_CONSULCATALOG_CACHE: 'true'
      TRAEFIK_PROVIDERS_CONSULCATALOG_STALE: 'true'
      TRAEFIK_PROVIDERS_CONSULCATALOG_ENDPOINT_ADDRESS: http://consul:8500
      TRAEFIK_PROVIDERS_CONSULCATALOG_EXPOSEDBYDEFAULT: 'false'
      TRAEFIK_ENTRYPOINTS_web: 'true'
      TRAEFIK_ENTRYPOINTS_web_ADDRESS: &quot;:8000&quot;

</code></pre>
<p>Below is a Consul service registration file which registers an application named <code>web</code> which is listening on port 80. The service registration includes a couple tags which instructs Traefik to expose traffic to the service (<code>traefik.enable=true</code>) over the entrypoint named <code>web</code>, and creates the associated routing config for the service.</p>
<pre><code>service {
  name = &quot;web&quot;
  port = 80
  tags = [
    &quot;traefik.enable=true&quot;,
    &quot;traefik.http.routers.web.entrypoints=web&quot;,
    &quot;traefik.http.routers.web.rule=Host(`example.com`) &amp;&amp; PathPrefix(`/myapp`)&quot;
  ]
}
</code></pre>
<p>This can be registered into Consul using the CLI (<code>consul service register web.hcl</code>). Traefik will then discover this via the catalog integration, and configure itself based on the routing config specified in the tags.</p>
<p>HTTP requests received by Traefik on port 8000 with an <code>Host</code> header of <code>example.com</code> and path of <code>/myapp</code> will be routed to the <code>web</code> service that was registered with Consul.</p>
<p>Example curl command.</p>
<pre class="lang-sh prettyprint-override"><code>curl --header &quot;Host: example.com&quot; http://127.0.0.1:8000/myapp
</code></pre>
<p>This is a relatively basic example that is suitable for dev/test. You will need to define additional Traefik config parameters if you are deploying into a production Consul environment which is typically secured by access control lists (ACLs).</p>
