2014-06-06 19:40:48 -04:00
|
|
|
/*
|
2015-05-01 12:19:44 -04:00
|
|
|
Copyright 2014 The Kubernetes Authors All rights reserved.
|
2014-06-06 19:40:48 -04:00
|
|
|
|
|
|
|
|
Licensed under the Apache License, Version 2.0 (the "License");
|
|
|
|
|
you may not use this file except in compliance with the License.
|
|
|
|
|
You may obtain a copy of the License at
|
|
|
|
|
|
|
|
|
|
http://www.apache.org/licenses/LICENSE-2.0
|
|
|
|
|
|
|
|
|
|
Unless required by applicable law or agreed to in writing, software
|
|
|
|
|
distributed under the License is distributed on an "AS IS" BASIS,
|
|
|
|
|
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
|
|
|
See the License for the specific language governing permissions and
|
|
|
|
|
limitations under the License.
|
|
|
|
|
*/
|
2014-06-23 14:32:11 -04:00
|
|
|
|
2015-08-07 20:07:15 -04:00
|
|
|
package userspace
|
2014-06-06 19:40:48 -04:00
|
|
|
|
|
|
|
|
import (
|
|
|
|
|
"net"
|
2015-01-27 01:42:29 -05:00
|
|
|
|
2015-08-05 18:03:47 -04:00
|
|
|
"k8s.io/kubernetes/pkg/api"
|
2015-08-07 20:07:15 -04:00
|
|
|
"k8s.io/kubernetes/pkg/proxy"
|
2014-06-06 19:40:48 -04:00
|
|
|
)
|
|
|
|
|
|
2014-09-02 06:00:28 -04:00
|
|
|
// LoadBalancer is an interface for distributing incoming requests to service endpoints.
|
2014-06-06 19:40:48 -04:00
|
|
|
type LoadBalancer interface {
|
2014-08-03 15:23:15 -04:00
|
|
|
// NextEndpoint returns the endpoint to handle a request for the given
|
2015-03-20 17:24:43 -04:00
|
|
|
// service-port and source address.
|
2015-08-07 20:07:15 -04:00
|
|
|
NextEndpoint(service proxy.ServicePortName, srcAddr net.Addr) (string, error)
|
|
|
|
|
NewService(service proxy.ServicePortName, sessionAffinityType api.ServiceAffinity, stickyMaxAgeMinutes int) error
|
|
|
|
|
CleanupStaleStickySessions(service proxy.ServicePortName)
|
2014-06-06 19:40:48 -04:00
|
|
|
}
|