-
Notifications
You must be signed in to change notification settings - Fork 8.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
readinessProbe endpoint 10254:/healthz as AWS NLB health check endpoint and using proxy protocol v2 (PPv2) fails #10982
Comments
This issue is currently awaiting triage. If Ingress contributors determines this is a relevant issue, they will accept it by applying the The Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository. |
/triage needs-information If anyone has resources to test, it will help if they can reproduce this with standard vanilla install (plus just enabling proxy-protocol) because the project CI does not test against clouds like AWS and also does not have a free aws account |
@longwuyuan: GuidelinesPlease ensure that the issue body includes answers to the following questions:
For more details on the requirements of such an issue, please see here and ensure that they are met. If this request no longer meets these requirements, the label can be removed In response to this:
Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository. |
Before further testing/debugging @longwuyuan can someone confirm that my approach should work? Can you confirm that you expect 10254 port to support PPv2 as well? |
I am not able to comment on proxy-protocol-verson-2 support |
we use nginx 1.21 so proxy protocol v2 should work
https://docs.nginx.com/nginx/admin-guide/load-balancer/using-proxy-protocol/ Is the port open between the node group and the load balancer in the security group? I'm not sure the cloud controller does that by default when you put it in the annotation. |
@strongjz Valid point. But yes , it is. And just manually turning of PPv2 on NLB targtetgroup for NGINX Ingress Ctlr port will make target pod healthy again (so SG is not an issue at all). $ kubectl get deploy -n ingress-nginx ingress-nginx-controller -o yaml
ports:
- containerPort: 80
name: http
protocol: TCP
- containerPort: 443
name: https
protocol: TCP
- containerPort: 10254
name: metrics
protocol: TCP
- containerPort: 8443
name: webhook
protocol: TCP
readinessProbe:
failureThreshold: 3
httpGet:
path: /healthz
port: 10254
scheme: HTTP
initialDelaySeconds: 10
... |
/assign @Gacko |
Hello @youwalther65! As you already assume, the health check port of the Ingress NGINX pod is sadly not using nor supporting PROXY protocol. If I get your output correctly, you are using the AWS Load Balancer Controller. I also already noted that it is enabling PROXY protocol for the health check port if it is configured for the traffic port. If I remember correctly, that wasn't the case for the legacy in-tree controller, but I need to check that. Basically it shouldn't make a difference whether you're using the IP target mode, the instance target mode or even Lemme do some testing around that. I'll come back later! Regards |
Side note: According to your profile you're working for AWS. So maybe you even have more insights regarding NLB capabilities and configuration than me. 😬 |
Hello @youwalther65! I just played around with the AWS Load Balancer Controller and NLBs a bit and came to an interesting result. Heads up: I know you're using IP mode, but please keep on reading, I'll get back to that in the end. When you created a CLB using the In-Tree Load Balancer Controller in the past, you could have your traffic flow through node ports using PROXY protocol while the health check on the health check node port ( So in the end the CLB was more or less always using the right protocol independent of wether the health check is handled by This magic is not happening anymore with NLBs. I tried to deploy an NLB using the In-Tree Load Balancer Controller with PROXY protocol enabled. That didn't work as the old controller doesn't seem to support PROXY protocol for NLBs. At least adding the As this was just a test, I went on to configure a NLB in the recommended way of using the AWS Load Balancer Controller. As you can probably already imagine, this controller correctly setup a NLB with PROXY protocol as requested. But compared to the CLB created by the In-Tree Load Balancer Controller, this one was using PROXY protocol for both the traffic ports and the health check port. So if you also configure So you can either turn off PROXY protocol to make the health check work again while using As you're using the IP mode in your particular use case, this means you either use the traffic ports for the health check and do not change it to the metrics port (which also does not support PROXY protocol) when using PROXY protocol or you turn off PROXY protocol when using any other port than the traffic ports. Actually I'm wondering why you're even using a different port for the health checks. Your NLB has two listeners, one for each traffic port (HTTP & HTTPS) and each of them has its own target group. This means each target group can use the right traffic port (HTTP for HTTP, HTTPS for HTTPS) for its own health check. There is no need to override it to use the metrics port from my point of view. So in the end it shouldn't make a difference whether you're using PROXY protocol in IP mode as long as you're using the traffic ports, because IP mode doesn't rely on any (health check) node ports at all. Maybe you can bring some light into your use case and explain why you want to use the metrics port for health checks. Regards |
Some addition to that: I was going in the assumption that we are using 10254 for health checking Ingress NGINX. Basically that is true, but only for Kubernetes itself. So Kubelet is using that port to determine if a pod is ready and healthy, but that's not the port being used by Load Balancers. Those use either the traffic ports or the So to bring it back to your use case: Please use the traffic ports, especially when using PROXY protocol, as the "health check port" 10254 does not support PROXY protocol and load balancers normally do the same. |
Closing this for now. Re-open if the information provided does not solve your issue or you see a way of improving the current behavior (I do not as it's highly provider specific). /close |
@Gacko: Closing this issue. In response to this:
Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository. |
@Gacko Thank you for investigation and providing the details. At the end it was basically my assumption/misunderstanding to make use of readinessProbe endpoint 10254:/healthz as AWS NLB health check endpoint. |
What happened:
I am running NGINX Ingress Controller (for demo purposes with just one pod) in an AWS environment behind an NLB with target group in IP mode.
When using readinessProbe endpoint 10254:/healthz as AWS NLB health check endpoint and using proxy protocol v2 (PPv2) NLB IP target went into "Unhealthy" state (even if corresponding pod is Ready).
Without the usage of proxy protocol v2 (PPv2) i.e by removing service annotation
service.beta.kubernetes.io/aws-load-balancer-proxy-protocol: '*'
everything works fine and NLB IP target is healthyWhat you expected to happen:
I expect readinessProbe endpoint 10254:/healthz to support PPv2 as well and NLB IP targets should be "Healthy"
NGINX Ingress controller version (exec into the pod and run nginx-ingress-controller --version.):
Kubernetes version (use
kubectl version
):Environment:
The text was updated successfully, but these errors were encountered: