-
Notifications
You must be signed in to change notification settings - Fork 339
Fix backend protocol annotation incorrectly documented #1187
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
base: master
Are you sure you want to change the base?
Fix backend protocol annotation incorrectly documented #1187
Conversation
…fault value to "tcp"
…s, and improved aws-load-balancer-type description
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: The full list of commands accepted by this bot can be found here.
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
This issue is currently awaiting triage. If cloud-provider-aws contributors determine 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-sigs/prow repository. |
Hi @samuel-esp. Thanks for your PR. I'm waiting for a kubernetes member to verify that this patch is reasonable to test. If it is, they should reply with Once the patch is verified, the new status will be reflected by the I understand the commands that are listed here. 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-sigs/prow repository. |
| service.beta.kubernetes.io/aws-load-balancer-access-log-s3-bucket-name | - | - | ELB | Access log S3 bucket name. | | ||
| service.beta.kubernetes.io/aws-load-balancer-access-log-s3-bucket-prefix | - | - | ELB | Access log S3 bucket prefix. | | ||
| service.beta.kubernetes.io/aws-load-balancer-additional-resource-tags | Comma-separated list of key=value | - | ELB,NLB | A comma-separated list of key-value pairs which will be recorded as additional tags in the ELB. For example: "Key1=Val1,Key2=Val2,KeyNoVal1=,KeyNoVal2" | | ||
| service.beta.kubernetes.io/aws-load-balancer-backend-protocol | [http\|https\|ssl\|tcp] | tcp | ELB | Specifies the protocol spoken by the backend (pod) behind a listener. If set to `http` and the `aws-load-balancer-ssl-cert` annotation is missing or its value is empty (`""`), a HTTP listener is created; if set to `http` or `https` and the `aws-load-balancer-ssl-cert`annotation is also present, an HTTPS listener is created to terminate SSL and parse headers. If set to `ssl` or `tcp`, a "raw" SSL/TCP listener is used. if the annotation is missing, its value is empty (`""`), or set to `https` without the `aws-load-balancer-ssl-cert`annotation also being present, the default protocol is assumed to be `tcp`. | |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks like NLB also supports it:
cloud-provider-aws/pkg/providers/v1/aws.go
Lines 2176 to 2196 in af0e606
if isNLB(annotations) { | |
portMapping := nlbPortMapping{ | |
FrontendPort: int32(port.Port), | |
FrontendProtocol: elbv2types.ProtocolEnum(port.Protocol), | |
TrafficPort: int32(port.NodePort), | |
TrafficProtocol: elbv2types.ProtocolEnum(port.Protocol), | |
} | |
var err error | |
if portMapping.HealthCheckConfig, err = c.buildNLBHealthCheckConfiguration(apiService); err != nil { | |
return nil, err | |
} | |
certificateARN := annotations[ServiceAnnotationLoadBalancerCertificate] | |
if port.Protocol != v1.ProtocolUDP && certificateARN != "" && (sslPorts == nil || sslPorts.numbers.Has(port.Port) || sslPorts.names.Has(port.Name)) { | |
portMapping.FrontendProtocol = elbv2types.ProtocolEnumTls | |
portMapping.SSLCertificateARN = certificateARN | |
portMapping.SSLPolicy = annotations[ServiceAnnotationLoadBalancerSSLNegotiationPolicy] | |
if backendProtocol := annotations[ServiceAnnotationLoadBalancerBEProtocol]; backendProtocol == "ssl" { | |
portMapping.TrafficProtocol = elbv2types.ProtocolEnumTls | |
} |
| service.beta.kubernetes.io/aws-load-balancer-backend-protocol | [http\|https\|ssl\|tcp] | tcp | ELB | Specifies the protocol spoken by the backend (pod) behind a listener. If set to `http` and the `aws-load-balancer-ssl-cert` annotation is missing or its value is empty (`""`), a HTTP listener is created; if set to `http` or `https` and the `aws-load-balancer-ssl-cert`annotation is also present, an HTTPS listener is created to terminate SSL and parse headers. If set to `ssl` or `tcp`, a "raw" SSL/TCP listener is used. if the annotation is missing, its value is empty (`""`), or set to `https` without the `aws-load-balancer-ssl-cert`annotation also being present, the default protocol is assumed to be `tcp`. | | |
| service.beta.kubernetes.io/aws-load-balancer-backend-protocol | [http\|https\|ssl\|tcp] | tcp | ELB,NLB | Specifies the protocol spoken by the backend (pod) behind a listener. If set to `http` and the `aws-load-balancer-ssl-cert` annotation is missing or its value is empty (`""`), a HTTP listener is created; if set to `http` or `https` and the `aws-load-balancer-ssl-cert`annotation is also present, an HTTPS listener is created to terminate SSL and parse headers. If set to `ssl` or `tcp`, a "raw" SSL/TCP listener is used. if the annotation is missing, its value is empty (`""`), or set to `https` without the `aws-load-balancer-ssl-cert`annotation also being present, the default protocol is assumed to be `tcp`. | |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hey @mtulio, could you try to replicate that? Because when i wrote the docs I did several tests and the protocol showed in the console never matched the one I used in the annotation; looking at the code this made sense to me. A double check would be awesome
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hey @mtulio did you have time to check this?
Co-authored-by: Marco Braga <braga@mtulio.eng.br>
What type of PR is this?
/kind bug
What this PR does / why we need it:
Fix backend protocol and type annotations in documentation: the backend protocol annotation only applies to Classic ELB, therefore there are incorrect statements inside the description (
tcp
is the default protocol, nothttp
). Therefore, in the type annotation, the user should be able to understand the behavior behind the protocol assignment for NLB since it is different from the one described inside the backend protocol annotation (in the past, the user might have been misled into thinking the process was the same since both ELB type were shown to be compatible with the backend protocol annotation)Which issue(s) this PR fixes:
Fixes #1186
Does this PR introduce a user-facing change?:
None