<p>I am using a yaml config to create a network load balancer in AWS using kubectl.
The load balancer is created successfully and the target groups are attached correctly.</p>
<p>As the part of settings, I have passed annotations required for AWS, but all annotations are not applied when looking at the Load Balancer in aws console.</p>
<p>The name is not getting set and the load balancer logs are not enabled. I get a load balancer with random alphanumeric name.</p>
<pre><code>apiVersion: v1
kind: Service
metadata:
  name: test-nlb-service
  annotations:
    service.beta.kubernetes.io/aws-load-balancer-name: test-nlb # not set
    service.beta.kubernetes.io/aws-load-balancer-type: nlb
    service.beta.kubernetes.io/aws-load-balancer-scheme: internet-facing
    service.beta.kubernetes.io/aws-load-balancer-ssl-negotiation-policy: ELBSecurityPolicy-2016-08
    service.beta.kubernetes.io/aws-load-balancer-ssl-cert: arn:aws:acm:eu-central-1:***********:certificate/*********************
    service.beta.kubernetes.io/aws-load-balancer-backend-protocol: &quot;tcp,http&quot;
    service.beta.kubernetes.io/aws-load-balancer-ssl-ports: 443,8883
    service.beta.kubernetes.io/aws-load-balancer-proxy-protocol: &quot;*&quot;
    service.beta.kubernetes.io/aws-load-balancer-additional-resource-tags: &quot;environment=dev,app=test, name=test-nlb-dev&quot;
    service.beta.kubernetes.io/aws-load-balancer-access-log-enabled: &quot;true&quot; # not set
    service.beta.kubernetes.io/aws-load-balancer-access-log-emit-interval: &quot;15&quot; # not set
    service.beta.kubernetes.io/aws-load-balancer-access-log-s3-bucket-name: &quot;random-bucket-name&quot; # not set
    service.beta.kubernetes.io/aws-load-balancer-access-log-s3-bucket-prefix: &quot;random-bucket-name/dev/test-nlb-dev&quot; # not set
  labels:
    app: test
spec:
  ports:
    - name: mqtt
      protocol: TCP
      port: 443
      targetPort: 8080
    - name: websocket
      protocol: TCP
      port: 8883
      targetPort: 1883
  type: LoadBalancer
  selector:
    app: test
</code></pre>
<p>If anyone can point what could be the issue here ? I am using kubectl v1.19 and Kubernetes v1.19</p>

<p>I think this is a version problem.
I assume you are running the in-tree cloud controller and not an external one (see <a href="https://github.com/kubernetes/kubernetes/tree/master/pkg/cloudprovider#deprecation-notice" rel="nofollow noreferrer">here</a>).</p>
<p>The annotation <code>service.beta.kubernetes.io/aws-load-balancer-name</code> is not present even in the <a href="https://github.com/kubernetes/kubernetes/blob/master/staging/src/k8s.io/legacy-cloud-providers/aws/aws.go" rel="nofollow noreferrer">master branch</a> of kubernetes.</p>
<p>That does not explain why the other annotations do not work though. In fact
<a href="https://github.com/kubernetes/kubernetes/blob/v1.19.12/staging/src/k8s.io/legacy-cloud-providers/aws/aws.go#L105" rel="nofollow noreferrer">here</a> you can see what annotations are supported by kubernetes 1.19.12 and the others you mentioned are not working are listed in the sources.</p>
<p>You might find more information in the <code>controller-manager</code> logs.</p>
<p>My suggestion is to disable the in-tree cloud controller in <code>controller manager</code> and run the <a href="https://github.com/kubernetes/cloud-provider-aws" rel="nofollow noreferrer">standalone version</a>.</p>
