<p>As @Tensibai indicated:</p>

<blockquote>
  <p>With an ingress you can have multiples names on same port, no possible
  by exposing a port tied to only one service</p>
</blockquote>

CC BY-SA 3.0
2018-04-27T16:01:21.583Z
2018-04-27T16:01:21.583Z
030
<p>From a technical perspective, they are working in different tcp/ip layers.</p>

<p>Expose command create a layer 4 tcp/udp port redirection. While ingress works at layer 7, ingress can do alot more like ssl offlloading, distribute loads based on HTTP headers, cookies, or url etc</p>

CC BY-SA 4.0
2020-03-14T10:12:57.080Z
Perhaps you could explain when one could choose the first and in what situation the latter.
030
CC BY-SA 4.0
2020-03-13T13:58:16.283Z
2020-03-13T13:58:16.283Z
kokei
<p>If one uses <code>expose</code> in k8s then it is possible to assign an IP to an app so it could be accessed on the www.</p>

<p>It is also possible to configure an ingress. This is basically a rproxy. </p>

<p>What are reasons to use an ingress over <code>expose</code>?</p>

CC BY-SA 3.0
2018-03-18T16:31:23.617Z
With an ingress you can have multiples names on same port, no possible by exposing a port tied to only one service
Tensibai
<kubernetes>
What are reasons to prefer an ingress over using `expose` in k8s?
030
# What are reasons to prefer an ingress over using `expose` in k8s?

(Asked by: username_0 on 2018-03-18)

If one uses `expose` in k8s then it is possible to assign an IP to an app so it could be accessed on the www.

It is also possible to configure an ingress. This is basically a rproxy.

What are reasons to use an ingress over `expose`?

**Tags:** kubernetes

> **Comments:**
> **username_1**: With an ingress you can have multiples names on same port, no possible by exposing a port tied to only one service  

---

## 2 answers

### Answer by username_0 on 2018-04-27. Score: 2 | Accepted answer

As @username_1 indicated:

> With an ingress you can have multiples names on same port, no possible
> by exposing a port tied to only one service


---

### Answer by username_2 on 2020-03-13. Score: 0

From a technical perspective, they are working in different tcp/ip layers.

Expose command create a layer 4 tcp/udp port redirection. While ingress works at layer 7, ingress can do alot more like ssl offlloading, distribute loads based on HTTP headers, cookies, or url etc

> **Comments:**
> **username_0**: Perhaps you could explain when one could choose the first and in what situation the latter.  

---

