Documentation
¶
Overview ¶
policyengine package handles policies that govern ClusterLink behavior
Index ¶
- Constants
- type LBPolicy
- type LBScheme
- type LoadBalancer
- func (lB *LoadBalancer) AddToServiceMap(serviceDst, peer string)
- func (lB *LoadBalancer) DeletePolicy(lbPolicy *LBPolicy) error
- func (lB *LoadBalancer) GetTargetPeers(service string) ([]string, error)
- func (lB *LoadBalancer) LookupECMP(service string, peers []string) (string, error)
- func (lB *LoadBalancer) LookupRandom(service string, peers []string) (string, error)
- func (lB *LoadBalancer) LookupStatic(serviceSrc, serviceDst string, peers []string) (string, error)
- func (lB *LoadBalancer) LookupWith(serviceSrc, serviceDst string, peers []string) (string, error)
- func (lB *LoadBalancer) RemoveDestService(serviceDst, peer string)
- func (lB *LoadBalancer) RemovePeerFromServiceMap(peer string)
- func (lB *LoadBalancer) SetPolicy(lbPolicy *LBPolicy) error
- type PolicyDecider
- type PolicyHandler
- func (pH *PolicyHandler) AddAccessPolicy(policy *api.Policy) error
- func (pH *PolicyHandler) AddExport(_ *api.Export) ([]string, error)
- func (pH *PolicyHandler) AddImport(imp *api.Import) policytypes.PolicyAction
- func (pH *PolicyHandler) AddLBPolicy(policy *api.Policy) error
- func (pH *PolicyHandler) AddPeer(name string)
- func (pH *PolicyHandler) AuthorizeAndRouteConnection(req *policytypes.ConnectionRequest) (policytypes.ConnectionResponse, error)
- func (pH *PolicyHandler) DeleteAccessPolicy(policy *api.Policy) error
- func (pH *PolicyHandler) DeleteExport(_ string)
- func (pH *PolicyHandler) DeleteImport(imp *api.Import)
- func (pH *PolicyHandler) DeleteLBPolicy(policy *api.Policy) error
- func (pH *PolicyHandler) DeletePeer(name string)
- type ServiceState
Constants ¶
View Source
const ( LbType = "lb" // Type for load-balancing policies AccessType = "access" // Type for access policies ServiceNameLabel = "clusterlink/metadata.serviceName" GatewayNameLabel = "clusterlink/metadata.gatewayName" )
View Source
const Wildcard = "*"
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type LoadBalancer ¶
type LoadBalancer struct { ServiceMap map[string][]string // Service to Peers Scheme map[string]map[string]LBScheme // PolicyMap [serviceDst][serviceSrc]Policy ServiceStateMap map[string]map[string]*ServiceState // State of policy Per destination and source }
func NewLoadBalancer ¶
func NewLoadBalancer() *LoadBalancer
func (*LoadBalancer) AddToServiceMap ¶
func (lB *LoadBalancer) AddToServiceMap(serviceDst, peer string)
func (*LoadBalancer) DeletePolicy ¶
func (lB *LoadBalancer) DeletePolicy(lbPolicy *LBPolicy) error
func (*LoadBalancer) GetTargetPeers ¶
func (lB *LoadBalancer) GetTargetPeers(service string) ([]string, error)
func (*LoadBalancer) LookupECMP ¶
func (lB *LoadBalancer) LookupECMP(service string, peers []string) (string, error)
func (*LoadBalancer) LookupRandom ¶
func (lB *LoadBalancer) LookupRandom(service string, peers []string) (string, error)
func (*LoadBalancer) LookupStatic ¶
func (lB *LoadBalancer) LookupStatic(serviceSrc, serviceDst string, peers []string) (string, error)
func (*LoadBalancer) LookupWith ¶
func (lB *LoadBalancer) LookupWith(serviceSrc, serviceDst string, peers []string) (string, error)
func (*LoadBalancer) RemoveDestService ¶
func (lB *LoadBalancer) RemoveDestService(serviceDst, peer string)
func (*LoadBalancer) RemovePeerFromServiceMap ¶
func (lB *LoadBalancer) RemovePeerFromServiceMap(peer string)
func (*LoadBalancer) SetPolicy ¶
func (lB *LoadBalancer) SetPolicy(lbPolicy *LBPolicy) error
type PolicyDecider ¶
type PolicyDecider interface { AddLBPolicy(policy *api.Policy) error DeleteLBPolicy(policy *api.Policy) error AddAccessPolicy(policy *api.Policy) error DeleteAccessPolicy(policy *api.Policy) error AuthorizeAndRouteConnection(connReq *policytypes.ConnectionRequest) (policytypes.ConnectionResponse, error) AddPeer(name string) DeletePeer(name string) AddImport(imp *api.Import) policytypes.PolicyAction DeleteImport(imp *api.Import) AddExport(exp *api.Export) ([]string, error) // Returns a list of peers to which export is allowed DeleteExport(name string) }
PolicyDecider is an interface for entities that make policy-based decisions on various ClusterLink operations.
func NewPolicyHandler ¶
func NewPolicyHandler() PolicyDecider
type PolicyHandler ¶
type PolicyHandler struct {
// contains filtered or unexported fields
}
PolicyHandler implements PolicyDecider using Connectivity Policies and Load-Balancing Policies.
func (*PolicyHandler) AddAccessPolicy ¶
func (pH *PolicyHandler) AddAccessPolicy(policy *api.Policy) error
func (*PolicyHandler) AddExport ¶
func (pH *PolicyHandler) AddExport(_ *api.Export) ([]string, error)
func (*PolicyHandler) AddImport ¶
func (pH *PolicyHandler) AddImport(imp *api.Import) policytypes.PolicyAction
func (*PolicyHandler) AddLBPolicy ¶
func (pH *PolicyHandler) AddLBPolicy(policy *api.Policy) error
func (*PolicyHandler) AddPeer ¶
func (pH *PolicyHandler) AddPeer(name string)
func (*PolicyHandler) AuthorizeAndRouteConnection ¶
func (pH *PolicyHandler) AuthorizeAndRouteConnection(req *policytypes.ConnectionRequest) ( policytypes.ConnectionResponse, error, )
func (*PolicyHandler) DeleteAccessPolicy ¶
func (pH *PolicyHandler) DeleteAccessPolicy(policy *api.Policy) error
func (*PolicyHandler) DeleteExport ¶
func (pH *PolicyHandler) DeleteExport(_ string)
func (*PolicyHandler) DeleteImport ¶
func (pH *PolicyHandler) DeleteImport(imp *api.Import)
func (*PolicyHandler) DeleteLBPolicy ¶
func (pH *PolicyHandler) DeleteLBPolicy(policy *api.Policy) error
func (*PolicyHandler) DeletePeer ¶
func (pH *PolicyHandler) DeletePeer(name string)
type ServiceState ¶
type ServiceState struct {
// contains filtered or unexported fields
}
Click to show internal directories.
Click to hide internal directories.