<p>I exposed a service with a static IP and an Ingress through an nginx controller as one of the examples of the <a href="https://github.com/kubernetes/ingress/tree/master/examples/static-ip/nginx" rel="noreferrer">kubernetes/ingress</a> repository. I have a second LoadBalancer service, that is not managed by any Ingress resource that is no longer properly exposed after the adding the new resources for the first service (I do not understand why this is the case).</p>

<p>I tried to add a second Ingress and LoadBalancer service to assign the second static IP, but I cant get it to work. </p>

<p>How would I go about exposing the second service, preferably with an Ingress? Do I need to add a second Ingress resource or do I have to reconfigure the one I already have?</p>

<p>Using a <code>Service</code> with <code>type: LoadBalancer</code> and using an <code>Ingress</code> are usually mutually exclusive ways to expose your application.</p>

<p>When you create a <code>Service</code> with <code>type: LoadBalancer</code>, Kubernetes creates a LoadBalancer in your cloud account that has an IP, opens the ports on that LoadBalancer that match your <code>Service</code>, and then directs all traffic to that IP to the 1 <code>Service</code>. So if you have 2 <code>Service</code> objects, each with 'type: LoadBalancer' for 2 different <code>Deployment</code>s, then you have 2 IPs as well (one for each <code>Service</code>).</p>

<p>The <code>Ingress</code> model is based on directing traffic through a single Ingress Controller which is running something like nginx. As the <code>Ingress</code> resources are added, the Ingress Controller reconfigures nginx to include the new <code>Ingress</code> details. In this case, there will be a <code>Service</code> for the Ingress Controller (e.g. nginx) that is <code>type: LoadBalancer</code>, but all of the services that the <code>Ingress</code> resources point to should be <code>type: ClusterIP</code>. Traffic for all the <code>Ingress</code> objects will flow through the same public IP of the LoadBalancer for the Ingress Controller <code>Service</code> to the Ingress Controller (e.g. nginx) <code>Pod</code>s. The configuration details from the <code>Ingress</code> object (e.g. virtual host or port or route) will then determine which <code>Service</code> will get the traffic.</p>
