<p>I have a simple task, but it is not solved even after studying dozens of articles.</p>
<p>There is a simple AWS EKS cluster created from a demo template using eksctl, ElasticIP and installed without changes <a href="https://bitnami.com/stack/nginx-ingress-controller/helm" rel="nofollow noreferrer">https://bitnami.com/stack/nginx-ingress-controller/helm</a></p>
<p>There is a domain <a href="https://stage.mydomain.com" rel="nofollow noreferrer">https://stage.mydomain.com</a> which I want to forward to ElasticIP, using DNS A-record, on AWS EKS nginx ingress controller 1234567890.eu-central-1.elb.amazonaws.com so that all the services of my cluster are available at this ElasticIP address.</p>
<p>I tried through Load Balancer and Network Balancer, but it doesn't work.</p>
<p>Is there a proven article or sequence of actions for solving this problem and with this set of services?</p>

stackuser
<p>Yes that's common in AWS articles also NLD value coming like this way only</p>
<p><a href="https://aws.amazon.com/blogs/opensource/network-load-balancer-nginx-ingress-controller-eks/" rel="nofollow noreferrer">https://aws.amazon.com/blogs/opensource/network-load-balancer-nginx-ingress-controller-eks/</a></p>
<p>In the above article installing the NGINX controller using the NLB as backend which providing the IP the same way.</p>
<p>In this case you can add the <code>DNS</code> with <code>A</code> or <code>CNAME</code></p>
<p>Once your ingress controller setup is done you will get <code>LB</code> endpoint you have to add this to <code>DNS</code> as <code>A</code> record or <code>CNAME</code></p>
<p>this will forward the request to the cluster.</p>
<p>Now inside the cluster, you have to create the ingress using applying the YAML</p>
<p><a href="https://kubernetes.io/docs/concepts/services-networking/ingress/" rel="nofollow noreferrer">https://kubernetes.io/docs/concepts/services-networking/ingress/</a></p>
<p><strong>ingress.yaml</strong></p>
<pre><code>apiVersion: networking.k8s.io/v1
kind: Ingress
metadata:
  name: minimal-ingress
  annotations:
    nginx.ingress.kubernetes.io/rewrite-target: /
spec:
  rules:
  - http:
      paths:
      - path: /testpath
        pathType: Prefix
        backend:
          service:
            name: test
            port:
              number: 80
</code></pre>
<p>For <code>NLB</code> in you can add the annotation to service</p>
<pre><code>**service.beta.kubernetes.io/aws-load-balancer-type: nlb**


apiVersion: v1
kind: Service
metadata:
  annotations:
    service.beta.kubernetes.io/aws-load-balancer-backend-protocol: tcp
    service.beta.kubernetes.io/aws-load-balancer-connection-idle-timeout: '60'
    service.beta.kubernetes.io/aws-load-balancer-cross-zone-load-balancing-enabled: 'true'
    service.beta.kubernetes.io/aws-load-balancer-type: nlb
  labels:
    helm.sh/chart: ingress-nginx-2.0.3
    app.kubernetes.io/name: ingress-nginx
    app.kubernetes.io/instance: ingress-nginx
    app.kubernetes.io/version: 0.32.0
    app.kubernetes.io/managed-by: Helm
    app.kubernetes.io/component: controller
  name: ingress-nginx-controller
  namespace: ingress-nginx
spec:
  type: LoadBalancer
  externalTrafficPolicy: Local
  ports:
    - name: http
      port: 80
      protocol: TCP
      targetPort: http
    - name: https
      port: 443
      protocol: TCP
      targetPort: https
  selector:
    app.kubernetes.io/name: ingress-nginx
    app.kubernetes.io/instance: ingress-nginx
    app.kubernetes.io/component: controller
</code></pre>
