Skip to content
This repository has been archived by the owner on Apr 25, 2024. It is now read-only.

Support UDP LB Service #49

Merged
merged 7 commits into from
Feb 26, 2019
Merged
Show file tree
Hide file tree
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions pkg/cloud-provider/load_balancer.go
Original file line number Diff line number Diff line change
Expand Up @@ -202,8 +202,8 @@ func (bc *Baiducloud) validateService(service *v1.Service) error {
return fmt.Errorf("requested load balancer with no ports")
}
for _, port := range service.Spec.Ports {
if port.Protocol != v1.ProtocolTCP {
return fmt.Errorf("only TCP LoadBalancer is supported for Baidu CCE")
if port.Protocol != v1.ProtocolTCP && port.Protocol != v1.ProtocolUDP {
return fmt.Errorf("only TCP,UDP LoadBalancer is supported for Baidu CCE")
}
}
return nil
Expand Down
14 changes: 14 additions & 0 deletions pkg/cloud-provider/options.go
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,21 @@ const (
ServiceAnnotationLoadBalancerId = ServiceAnnotationLoadBalancerPrefix + "id"
// ServiceAnnotationLoadBalancerInternalVpc is the annotation of LoadBalancerInternalVpc
ServiceAnnotationLoadBalancerInternalVpc = ServiceAnnotationLoadBalancerPrefix + "internal-vpc"
// ServiceAnnotationLoadBalancerAllocateVip is the annotation which indicates BLB with a VIP
ServiceAnnotationLoadBalancerAllocateVip = ServiceAnnotationLoadBalancerPrefix + "allocate-vip"
// ServiceAnnotationLoadBalancerScheduler is the annotation of load balancer which can be "RoundRobin"/"LeastConnection"/"Hash"
ServiceAnnotationLoadBalancerScheduler = ServiceAnnotationLoadBalancerPrefix + "scheduler"
// ServiceAnnotationLoadBalancerHealthCheckTimeoutInSecond is the annotation of health check timeout
ServiceAnnotationLoadBalancerHealthCheckTimeoutInSecond = ServiceAnnotationLoadBalancerPrefix + "health-check-timeout-in-second"
// ServiceAnnotationLoadBalancerHealthCheckInterval is the annotation of health check interval
ServiceAnnotationLoadBalancerHealthCheckInterval = ServiceAnnotationLoadBalancerPrefix + "health-check-interval"
// ServiceAnnotationLoadBalancerUnhealthyThreshold is the annotation of unhealthy threshold
ServiceAnnotationLoadBalancerUnhealthyThreshold = ServiceAnnotationLoadBalancerPrefix + "unhealthy-threshold"
// ServiceAnnotationLoadBalancerHealthyThreshold is the annotation of healthy threshold
ServiceAnnotationLoadBalancerHealthyThreshold = ServiceAnnotationLoadBalancerPrefix + "healthy-threshold"
// ServiceAnnotationLoadBalancerHealthCheckString is the annotation of health check string
ServiceAnnotationLoadBalancerHealthCheckString = ServiceAnnotationLoadBalancerPrefix + "health-check-string"


// ServiceAnnotationElasticIPPrefix is the annotation prefix of ElasticIP
ServiceAnnotationElasticIPPrefix = "service.beta.kubernetes.io/cce-elastic-ip-"
Expand Down