<p>i am looking at creating an alb using <a href="https://github.com/kubernetes-sigs/aws-load-balancer-controller" rel="nofollow noreferrer">https://github.com/kubernetes-sigs/aws-load-balancer-controller</a></p>
<p>Lets say i have two namespaces <code>kubernetes-dashboard</code> and <code>otherns</code>.</p>
<p>In the first namespace i have a service called <code>kubernetes-dashboard</code> and in the second namespace i have a service called <code>otherservice</code></p>
<p>Would the below ingress work?</p>
<p><strong>ingress.yml</strong></p>
<pre><code>apiVersion: extensions/v1beta1
kind: Ingress
metadata:
  name: general-ingress
  namespace: default
  annotations:
    kubernetes.io/ingress.class: alb
    alb.ingress.kubernetes.io/scheme: internet-facing
    alb.ingress.kubernetes.io/listen-ports: '[{&quot;HTTP&quot;:80,&quot;HTTPS&quot;: 443}]'
    alb.ingress.kubernetes.io/certificate-arn: &lt;redacted&gt;
    alb.ingress.kubernetes.io/tags: Environment=staging,Team=dev
    alb.ingress.kubernetes.io/healthcheck-path: /health
    alb.ingress.kubernetes.io/healthcheck-interval-seconds: '300'
spec:
  rules:
    - host: k8s.acme.com
      http:
        paths:
          - path: /*
            backend:
              serviceName: kubernetes-dashboard.kubernetes-dashboard
              servicePort: 8080
    - host: otherservice.acme.com
      http:
        paths:
          - path: /*
            backend:
              serviceName: otherservice.otherns
              servicePort: 80
</code></pre>

Kay
<p>I found there is two solutions to this problem.</p>
<p>The second solution did not work for me because i am using a library which does not support that. <a href="https://github.com/kubernetes-sigs/aws-load-balancer-controller" rel="nofollow noreferrer">https://github.com/kubernetes-sigs/aws-load-balancer-controller</a></p>
<ol>
<li>Create multiple ingress files delcaring the same group.name.</li>
</ol>
<p><a href="https://kubernetes-sigs.github.io/aws-load-balancer-controller/latest/guide/ingress/annotations/#ingressgroup" rel="nofollow noreferrer">https://kubernetes-sigs.github.io/aws-load-balancer-controller/latest/guide/ingress/annotations/#ingressgroup</a></p>
<blockquote>
<p>IngressGroup feature enables you to group multiple Ingress resources
together. The controller will automatically merge Ingress rules for
all Ingresses within IngressGroup and support them with a single ALB.
In addition, most annotations defined on a Ingress only applies to the
paths defined by that Ingress.</p>
</blockquote>
<ol start="2">
<li>Use an externalName service</li>
</ol>
<p><a href="https://kubernetes.io/docs/concepts/services-networking/service/#externalname" rel="nofollow noreferrer">https://kubernetes.io/docs/concepts/services-networking/service/#externalname</a></p>
<p>You can create an <code>ExternalName</code> service in the same namespace as your ingress, your ingress will then point to this special <code>ExternalName</code> service</p>
