How to disable ELB/ALB to allocate fqdn as EXTERNAL-IP(LoadBalancer Ingress) ?

0

I am trying to create K8 load balancer service for protocol TCP. I am using cilium cni with chaining.

But I do not want ELB to allocate fqdn when I deploy the service. It is possible ? I want Cilium CNI to do loadbalancing, not the AWS cni !

It is marked below as **LoadBalancer Ingress: **. I do not want it to be allocated


apiVersion: v1 kind: Service metadata: name: ubuntu-tcp namespace: ubuntu labels: app: ubuntu spec: type: LoadBalancer selector: app: ubuntu externalIPs: - 5.5.5.5 ports: - port: 20000 name: tcp protocol: TCP targetPort: 20000


Name: ubuntu-tcp Namespace: ubuntu Labels: app=ubuntu Annotations: <none> Selector: app=ubuntu Type: LoadBalancer IP Family Policy: SingleStack IP Families: IPv4 IP: 10.100.10.187 IPs: 10.100.10.187 External IPs: 5.5.5.5 LoadBalancer Ingress: a23c50412db51XXXXXXXXXX-<>.ap-south-1.elb.amazonaws.com Port: tcp 20000/TCP TargetPort: 20000/TCP NodePort: tcp 31648/TCP Endpoints: 192.168.140.33:20000,192.168.164.229:20000 Session Affinity: None External Traffic Policy: Cluster Events: Type Reason Age From Message


Normal EnsuringLoadBalancer 13s service-controller Ensuring load balancer Normal EnsuredLoadBalancer 10s service-controller Ensured load balancer

1 Answer
0

Hello,

When you create a LoadBalancer type service in EKS, the AWS Load Balancer Controller automatically creates an NLB and populates the NLB's DNS Name into the LoadBalancer Ingress property by default.

By default, the loadBalancerClass property of the Service manifest is set to service.k8s.aws/nlb. If you do not desire to use an NLB with your LoadBalancer type service, explicitly set this property value to a different value as shown below.

apiVersion: v1
kind: Service
metadata:
    name: ubuntu-tcp
    namespace: ubuntu
    labels:
      app: ubuntu
spec:
  type: LoadBalancer
  selector:
    app: ubuntu
  externalIPs:
  - 5.5.5.5
  loadBalancerClass: <replace-with-random-string>
  ports:
  - port: 20000
    name: tcp
    protocol: TCP
    targetPort: 20000

This above manifest will not trigger an NLB creation as the loadBalancerClass is not service.k8s.aws/nlb.

Note: Cilium CNI might have a specific requirement for the loadBalancerClass value. Please go through Cilium documentation to figure out its requirements.

I hope this is helpful to you. Please leave a comment if you have any additional questions and I'll be happy to assist you!

profile pictureAWS
SUPPORT ENGINEER
answered 7 days ago

You are not logged in. Log in to post an answer.

A good answer clearly answers the question and provides constructive feedback and encourages professional growth in the question asker.

Guidelines for Answering Questions