Service Topology implementation

* Implement Service Topology for ipvs and iptables proxier
* Add test files
* API validation
This commit is contained in:
Roc Chan
2019-07-16 17:22:43 +08:00
parent cdaeabfb46
commit c9cf3f5b72
25 changed files with 1006 additions and 43 deletions

View File

@@ -30,6 +30,7 @@ type Provider interface {
config.EndpointsHandler
config.EndpointSliceHandler
config.ServiceHandler
config.NodeHandler
// Sync immediately synchronizes the Provider's current state to proxy rules.
Sync()
@@ -77,6 +78,8 @@ type ServicePort interface {
NodePort() int
// GetOnlyNodeLocalEndpoints returns if a service has only node local endpoints
OnlyNodeLocalEndpoints() bool
// TopologyKeys returns service TopologyKeys as a string array.
TopologyKeys() []string
}
// Endpoint in an interface which abstracts information about an endpoint.
@@ -87,6 +90,8 @@ type Endpoint interface {
String() string
// GetIsLocal returns true if the endpoint is running in same host as kube-proxy, otherwise returns false.
GetIsLocal() bool
// GetTopology returns the topology information of the endpoint.
GetTopology() map[string]string
// IP returns IP part of the endpoint.
IP() string
// Port returns the Port part of the endpoint.