Yes that's common in AWS articles also NLD value coming like this way only
https://aws.amazon.com/blogs/opensource/network-load-balancer-nginx-ingress-controller-eks/
In the above article installing the NGINX controller using the NLB as backend which providing the IP the same way.
In this case you can add the DNS
with A
or CNAME
Once your ingress controller setup is done you will get LB
endpoint you have to add this to DNS
as A
record or CNAME
this will forward the request to the cluster.
Now inside the cluster, you have to create the ingress using applying the YAML
https://kubernetes.io/docs/concepts/services-networking/ingress/
ingress.yaml
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
For NLB
in you can add the annotation to service
**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