<p>We have an existing website, lets say <code>example.com</code>, which is a CNAME for <code>where.my.server.really.is.com</code>.</p>

<p>We're now developing new services using Kubernetes. Our first service <code>/login</code> is ready to be deployed. Using a mock HTML server I've been able to deploy two pods with seperate services that map to <code>example.com</code> and <code>example.com/login</code>.</p>

<p>What I would like to do is get rid of my mock HTML server, and provide a service inside of the cluster, that points to our full website outside of the server. Then I can change the DNS for <code>example.com</code> to point to our kubernetes cluster and people will still get the main site from <code>where.my.server.really.is.com</code>.</p>

<p>We are using Traefik for ingress, and these are the changes I've made to the config for the website:</p>

<pre><code>---
kind: Service
apiVersion: v1
metadata:
  name: wordpress
spec:
  type: ExternalName
  externalName: where.my.server.really.is.com

---
apiVersion: extensions/v1beta1
kind: Ingress
metadata:
  name: wordpress
  annotations:
    kubernetes.io/ingress.class: traefik
spec:
  backend:
    serviceName: wordpress
    servicePort: 80
  rules:
  - host: example.com
    http:
      paths:
      - backend:
          serviceName: wordpress
          servicePort: 80
</code></pre>

<p>Unfortunately, when I visit <code>example.com</code>, rather than getting <code>where.my.server.really.is.com</code>, I get a 503 with the body "Service Unavailable". <code>example.com/login</code> works as expected</p>

<p>What have I missed?</p>

<p>Following <a href="https://github.com/containous/traefik/blob/master/docs/user-guide/kubernetes.md#forwarding-to-externalnames" rel="nofollow noreferrer">traefik documentation on using <code>ExternalName</code></a></p>
<blockquote>
<p>When specifying an ExternalName, Træfik will forward requests to the given host accordingly and use HTTPS when the Service port matches 443.</p>
<p>This still requires setting up a proper port mapping on the Service from the Ingress port to the (external) Service port.</p>
</blockquote>
<p>I believe you are missing the <code>ports</code> configuration of the Service. Something like</p>
<pre><code>apiVersion: v1
kind: Service
metadata:
  name: wordpress
spec:
  ports:
  - name: http
    port: 80
  type: ExternalName
  externalName: where.my.server.really.is.com
</code></pre>
<p>You can see <a href="https://github.com/containous/traefik/blob/master/docs/user-guide/kubernetes.md#disable-per-ingress" rel="nofollow noreferrer">a full example in the docs</a>.</p>
