Is there an k8s annotation for setting the name of an auto-created LB in AWS

11/19/2020

For AWS cloud, I can create a Kubernetes ingress yaml containing

apiVersion: networking.k8s.io/v1beta1
kind: Ingress
metadata:
  annotations:
    alb.ingress.kubernetes.io/actions.ssl-redirect: '{"Type": "redirect", "RedirectConfig":
      { "Protocol": "HTTPS", "Port": "443", "StatusCode": "HTTP_301"}}'
    alb.ingress.kubernetes.io/certificate-arn: <<<my-cert-arn>>>
    alb.ingress.kubernetes.io/healthcheck-path: /
    alb.ingress.kubernetes.io/listen-ports: '[{"HTTP": 80}, {"HTTPS":443}]'
    alb.ingress.kubernetes.io/scheme: internet-facing
    alb.ingress.kubernetes.io/shield-advanced-protection: "true"
    alb.ingress.kubernetes.io/ssl-policy: ELBSecurityPolicy-TLS-1-2-2017-01
    alb.ingress.kubernetes.io/tags: environment=prod,client=templar-order,name=templar-prod-app
    alb.ingress.kubernetes.io/target-type: ip

and the tags come through in the AWS console, but the load balancer name is not set.

I've read the docs. What annotation can I use to set the load balancer name, here:

screenshot of AWS console for LBs

-- New Alexandria
amazon-web-services
kubernetes
kubernetes-ingress

1 Answer

11/20/2020

Unfortunately this feature is not yet supported so you can`t change the lb name using annotation.

The name is being generated here:

    func (gen *NameGenerator) NameLB(namespace string, ingressName string) string {
    .....
    }

However there is feature request on github which looks promising. You might want to follow that case for updates.

-- acid_fuji
Source: StackOverflow