mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-08-07 03:03:59 +00:00
enables the aws-load-balancer-backend-protocol annotion to be used without a cert to be able to create an HTTP->HTTP ELB
This commit is contained in:
parent
16c71aad4a
commit
9a111fffc8
@ -96,11 +96,12 @@ const ServiceAnnotationLoadBalancerCertificate = "service.beta.kubernetes.io/aws
|
|||||||
const ServiceAnnotationLoadBalancerSSLPorts = "service.beta.kubernetes.io/aws-load-balancer-ssl-ports"
|
const ServiceAnnotationLoadBalancerSSLPorts = "service.beta.kubernetes.io/aws-load-balancer-ssl-ports"
|
||||||
|
|
||||||
// ServiceAnnotationLoadBalancerBEProtocol is the annotation used on the service
|
// ServiceAnnotationLoadBalancerBEProtocol is the annotation used on the service
|
||||||
// to specify the protocol spoken by the backend (pod) behind a secure listener.
|
// to specify the protocol spoken by the backend (pod) behind a listener.
|
||||||
// Only inspected when `aws-load-balancer-ssl-cert` is used.
|
|
||||||
// If `http` (default) or `https`, an HTTPS listener that terminates the
|
// If `http` (default) or `https`, an HTTPS listener that terminates the
|
||||||
// connection and parses headers is created.
|
// connection and parses headers is created.
|
||||||
// If set to `ssl` or `tcp`, a "raw" SSL listener is used.
|
// If set to `ssl` or `tcp`, a "raw" SSL listener is used.
|
||||||
|
// If set to `http` and `aws-load-balancer-ssl-cert` is not used then
|
||||||
|
// a HTTP listener is used.
|
||||||
const ServiceAnnotationLoadBalancerBEProtocol = "service.beta.kubernetes.io/aws-load-balancer-backend-protocol"
|
const ServiceAnnotationLoadBalancerBEProtocol = "service.beta.kubernetes.io/aws-load-balancer-backend-protocol"
|
||||||
|
|
||||||
// Maps from backend protocol to ELB protocol
|
// Maps from backend protocol to ELB protocol
|
||||||
@ -2290,7 +2291,11 @@ func buildListener(port api.ServicePort, annotations map[string]string, sslPorts
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
listener.SSLCertificateId = &certID
|
listener.SSLCertificateId = &certID
|
||||||
|
} else if annotationProtocol := annotations[ServiceAnnotationLoadBalancerBEProtocol]; annotationProtocol == "http" {
|
||||||
|
instanceProtocol = annotationProtocol
|
||||||
|
protocol = "http"
|
||||||
}
|
}
|
||||||
|
|
||||||
listener.Protocol = &protocol
|
listener.Protocol = &protocol
|
||||||
listener.InstanceProtocol = &instanceProtocol
|
listener.InstanceProtocol = &instanceProtocol
|
||||||
|
|
||||||
|
@ -1291,6 +1291,11 @@ func TestBuildListener(t *testing.T) {
|
|||||||
443, "", 8011, "tcp", "cert", "foo,bar",
|
443, "", 8011, "tcp", "cert", "foo,bar",
|
||||||
false, "tcp", "tcp", "",
|
false, "tcp", "tcp", "",
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
"HTTP->HTTP",
|
||||||
|
80, "", 8012, "http", "", "",
|
||||||
|
false, "http", "http", "",
|
||||||
|
},
|
||||||
}
|
}
|
||||||
|
|
||||||
for _, test := range tests {
|
for _, test := range tests {
|
||||||
|
Loading…
Reference in New Issue
Block a user