<p>Can I run multiple services on port 80 in Kubernetes on Google Container Engine?  Each service has a dedicated external IP Address, so theoretically the router should be able to route to each service based off it's IP Address.</p>

<p>So far I have created pods for "frontend-1" and "frontend-2" on Container Engine.  I tried to create seperate services for them both running on Port 80 with unique External IPs, but it didn't work.  Is there another way to accomplish this in Kubernetes without using a custom routing service?</p>

<p>service-1.yaml:</p>

<pre><code>id: service-1
port: 80
containerPort: 8080
selector:
  name: frontend-1
createExternalLoadBalancer: true
</code></pre>

<p>service-2.yaml:</p>

<pre><code>id: service-2
port: 80
containerPort: 8081
selector:
  name: frontend-2
createExternalLoadBalancer: true
</code></pre>

<p>Kubernetes 1.1 has an <code>Ingress</code> type, which allows you to route different dns names/ips to different services. From <a href="https://github.com/kubernetes/kubernetes/blob/release-1.1/docs/user-guide/ingress.md" rel="noreferrer">github</a></p>

<pre><code>apiVersion: extensions/v1beta1
kind: Ingress
metadata:
  name: test
spec:
  rules:
  - host: foo.bar.com
    http:
      paths:
      - backend:
          serviceName: s1
          servicePort: 80
  - host: bar.foo.com
    http:
      paths:
      - backend:
          serviceName: s2
          servicePort: 80
</code></pre>
