Skip to content

EKS Automode - can't enable proxy protocol on NLB

0

Following the documentation here- https://docs.aws.amazon.com/eks/latest/userguide/auto-configure-nlb.html

I added these annotations to my NLB loadbalancer service

apiVersion: v1
kind: Service
metadata:
  annotations:
    service.beta.kubernetes.io/aws-load-balancer-attributes: proxy_protocol.v2.enabled=true
    service.beta.kubernetes.io/aws-load-balancer-scheme: internet-facing
    service.beta.kubernetes.io/aws-load-balancer-ssl-cert: arn:aws:acm:us-east-1:***
    service.beta.kubernetes.io/aws-load-balancer-ssl-ports: https

However, I get the following error message when describing the service

Warning FailedDeployModel 4m6s (x11 over 15m) service (combined from similar events): Failed deploy model due to operation error Elastic Load Balancing v2: ModifyLoadBalancerAttributes, https response error StatusCode: 400, RequestID: 036ec4dd-c98a-43e9-adfc-1e41a8fb0e66, api error ValidationError: Load balancer attribute key 'proxy_protocol.v2.enabled' is not recognized

I copied that verbatim from the docs so not sure what the disconnect is

asked 2 years ago567 views

2 Answers
0

I apologize, but there seems to be a discrepancy between the documentation and the actual behavior of EKS Auto Mode with Network Load Balancers (NLBs). The error message you're receiving indicates that the load balancer attribute key 'proxy_protocol.v2.enabled' is not recognized, which suggests that this feature might not be supported in EKS Auto Mode for NLBs.

EKS Auto Mode has some limitations and differences compared to the self-managed AWS load balancer controller. One of these limitations is that EKS Auto Mode only supports Security Group Mode for Network Load Balancers. It's possible that the proxy protocol feature is not available or is configured differently in this mode.

Unfortunately, the documentation you referenced may not be fully aligned with the current capabilities of EKS Auto Mode. It's important to note that EKS Auto Mode manages load balancers differently than the self-managed AWS load balancer controller, and not all features may be directly transferable.

To resolve this issue, you might need to:

  1. Remove the proxy protocol annotation and see if the NLB can be created without it.
  2. Check if there are any EKS Auto Mode specific annotations or configurations for enabling proxy protocol on NLBs.
  3. Consider reaching out to AWS support for clarification on this specific feature support in EKS Auto Mode.

If the proxy protocol feature is critical for your use case and it's not supported in EKS Auto Mode, you might need to consider alternative approaches or potentially disable EKS Auto Mode for more granular control over your load balancer configurations.
Sources
Learn about VPC networking and load balancing in EKS Auto Mode - Amazon EKS
Troubleshoot EKS Auto Mode - Amazon EKS
ElasticLoadBalancing - Amazon EKS

answered 2 years ago

0

EKS Auto Mode version of AWS Load Balancer Controller dropped many deprecated annotations, so old aws-load-balancer-proxy-protocol annotation doesn't work anymore. AWS documentation says that you should use aws-load-balancer-attributes, but they are only partially correct. Some of the old annotations were moved to aws-load-balancer-attributes, but some of them (like proxy-protocol) were moved to aws-load-balancer-target-group-attributes. So that is what you need really. See more in documentation

Here is how I do it:

apiVersion: v1
kind: Service
metadata:
  annotations:
    service.beta.kubernetes.io/aws-load-balancer-scheme: "internet-facing"

    service.beta.kubernetes.io/aws-load-balancer-attributes: load_balancing.cross_zone.enabled=true

    service.beta.kubernetes.io/aws-load-balancer-target-group-attributes: proxy_protocol_v2.enabled=true,stickiness.enabled=true,stickiness.type=source_ip

    service.beta.kubernetes.io/aws-load-balancer-healthcheck-protocol: "HTTP"
    service.beta.kubernetes.io/aws-load-balancer-healthcheck-port: "80"
    service.beta.kubernetes.io/aws-load-balancer-healthcheck-path: "/healthz"
    service.beta.kubernetes.io/aws-load-balancer-healthcheck-healthy-threshold: 3
    service.beta.kubernetes.io/aws-load-balancer-healthcheck-unhealthy-threshold: 3
    service.beta.kubernetes.io/aws-load-balancer-healthcheck-timeout: 10
    service.beta.kubernetes.io/aws-load-balancer-healthcheck-interval: 10

    service.beta.kubernetes.io/aws-load-balancer-eip-allocations: eipalloc-***,eipalloc-***,eipalloc-***

answered a year 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.