Helm Chart: Set name of AWS Load Balancer

Hello all,

I am trying to deploy Traefik with the official helm chart on my K8s cluster. So far everything works, but it would be nice if I could set the name of the Aws Load Balancer.
I tried to set the name with the option:
"service.beta.kubernetes.io/aws-load-balancer-name" , but that seems to be ignored.
What did I miss?

deployment:
  kind: Deployment
  replicas: 1

rbac:
  enabled: true

logs:
  general:
    level: DEBUG

ports:
  traefik:
    expose: true

service:
  annotations:
    service.beta.kubernetes.io/aws-load-balancer-name: "traefik"
    service.beta.kubernetes.io/aws-load-balancer-type: "nlb"
    service.beta.kubernetes.io/aws-load-balancer-ssl-ports: "443"
    service.beta.kubernetes.io/aws-load-balancer-internal: "true"

  spec:
    externalTrafficPolicy: Local

Do you see those annotations added to the services created? Can you please describe the service and share the result of the command?

Yes, the annotations are added to the service.
And e.g. the flag "aws-load-balancer-internal" is also applied correctly.
Output is:

kube-system, traefik, Service (v1) has been added:                                             
+ apiVersion: v1                                                                               
+ kind: Service                                
+ metadata:                                    
+   name: traefik                              
+   labels:                                    
+     app.kubernetes.io/name: traefik                                                          
+     helm.sh/chart: traefik-10.19.4       
+     app.kubernetes.io/managed-by: Helm                                                                                                                                                      
+     app.kubernetes.io/instance: traefik      
+   annotations:                               
+     service.beta.kubernetes.io/aws-load-balancer-internal: "true"                            
+     service.beta.kubernetes.io/aws-load-balancer-ssl-ports: "443"                            
+     service.beta.kubernetes.io/aws-load-balancer-type: nlb                                   
+     service.beta.kubernetes.io/aws-load-balancer-name: traefik                           
+ spec:                                                                                                                                                                                       
+   type: LoadBalancer                         
+   externalTrafficPolicy: Local
+   selector:                                  
+     app.kubernetes.io/name: traefik
+     app.kubernetes.io/instance: traefik
+   ports:                                     
+   - port: 9000                               
+     name: traefik                            
+     targetPort: traefik
+     protocol: TCP                            
+   - port: 80                                 
+     name: web                                
+     targetPort: web                          
+     protocol: TCP                            
+   - port: 443                                
+     name: websecure                          
+     targetPort: websecure
+     protocol: TCP                            

It's probably because you are using in-tree aws LB. There's no name annotations in Kubernetes documentation on in-tree plugin.
You'll need to install the EKS plugin in order to use all annotations described in AWS documentation.

2 Likes

I also experience this issue, and I did install the EKS plugin.

Hi.
I have added this plugin, but annotations like

      service.beta.kubernetes.io/aws-load-balancer-name: "traefik-nlb-balancer"
      alb.ingress.kubernetes.io/load-balancer-name: "traefik-nlb-balancer"
      alb.ingress.kubernetes.io/target-group-attributes: "proxy_protocol_v2.enabled=true"
      service.beta.kubernetes.io/aws-load-balancer-target-group-attributes: proxy_protocol_v2.enabled=true

still not working.
Explain please.
@bluebox - have You resolved this issue?

I'm using traefik helm chart with these values:

  service:
    enabled: true
    single: true
    type: LoadBalancer
    externalTrafficPolicy: Local
    annotations:
      service.beta.kubernetes.io/aws-load-balancer-type: nlb
      service.beta.kubernetes.io/aws-load-balancer-name: "traefik-nlb-balancer"
      alb.ingress.kubernetes.io/load-balancer-name: "traefik-nlb-balancer"
      alb.ingress.kubernetes.io/target-group-attributes: "proxy_protocol_v2.enabled=true"
      service.beta.kubernetes.io/aws-load-balancer-target-group-attributes: proxy_protocol_v2.enabled=true
      service.beta.kubernetes.io/aws-load-balancer-proxy-protocol: "*"