<p>I have a situation where on my GCP Cluster , I have two ingresses(A) and (B), which take me to my default-backend service (my UI). These ingresses are of type "gce" since I am hosting my applications on Google-cloud and letting it do the load balancing for me</p>

<p>The kind of situation I am in requires me to have two ingresses (taking in some factors for downtime and outage). I am trying to explore an option where I can setup some kind of internal k8s service/deployment, that can take my calls from my Ingress(A) and redirect to Ingress(B) where Ingress(B) will be taking me to my default backend-UI.</p>

<p>How do I go about solving this problem?</p>

<p>In the example below, how do I write my <code>My-redirection-service-to-app-system-test</code>. My end users will only have to type "system.test.com" in their browsers and that should take them to my UI</p>

<p>Its likely a Kubernetes service/deployment. Uncertain how to proceed </p>

<p>Thanks for the help in advance</p>

<p>Example Ingress(B)</p>

<pre><code>  rules:
  - host: app.system.test.com
    http:
      paths:
      - path: /ui/*
        backend:
          serviceName:ui-frontend
          servicePort: 80
</code></pre>

<p>Example Ingress (A)</p>

<pre><code>  rules:
  - host: system.test.com
    http:
      paths:
      - path: /ui/*
        backend:
          serviceName: My-redirection-service-to-app-system-test
          servicePort: 80
</code></pre>

Sam-Tahir
<p>I haven't tried this myself but I would consider using a Service of type <a href="https://kubernetes.io/docs/concepts/services-networking/service/#externalname" rel="nofollow noreferrer">ExternalName</a>. Those services can map requests directed at itself to any DNS name. </p>

<p>Something like this should do the trick:</p>

<p>Service:</p>

<pre><code>apiVersion: v1
kind: Service
metadata:
  name: my-service
  namespace: namespace
spec:
  type: ExternalName
  externalName: app.system.test.com
</code></pre>

<p>ingress A</p>

<pre><code>  rules:
  - host: system.test.com
    http:
      paths:
      - path: /ui/*
        backend:
          serviceName: my-service
          servicePort: 80
</code></pre>

<p>Ingress B</p>

<pre><code>rules:
- host: app.system.test.com
  http:
    paths:
    - path: /ui/*
      backend:
        serviceName:ui-frontend
        servicePort: 80
</code></pre>
