Documentation ¶
Overview ¶
Package redirectpolicy defines an internal representation of the Cilium Local Redirect Policy. The structures are managed by the RedirectPolicyManager.
Index ¶
- Variables
- type LRPConfig
- type Manager
- func (rpm *Manager) AddRedirectPolicy(config LRPConfig) (bool, error)
- func (rpm *Manager) DeleteRedirectPolicy(config LRPConfig) error
- func (rpm *Manager) EndpointCreated(ep *endpoint.Endpoint)
- func (rpm *Manager) EndpointDeleted(ep *endpoint.Endpoint, conf endpoint.DeleteConfig)
- func (rpm *Manager) EndpointRestored(ep *endpoint.Endpoint)
- func (rpm *Manager) GetLRPs() []*LRPConfig
- func (rpm *Manager) OnAddPod(pod *slimcorev1.Pod)
- func (rpm *Manager) OnAddService(svcID k8s.ServiceID)
- func (rpm *Manager) OnDeletePod(pod *slimcorev1.Pod)
- func (rpm *Manager) OnDeleteService(svcID k8s.ServiceID)
- func (rpm *Manager) OnUpdatePod(pod *slimcorev1.Pod, needsReassign bool, ready bool)
- func (rpm *Manager) OnUpdatePodLocked(pod *slimcorev1.Pod, removeOld bool, upsertNew bool)
Constants ¶
This section is empty.
Variables ¶
var Cell = cell.Module( "lrp-manager", "LRP Manager", cell.Provide(newLRPManager), cell.Provide(newLRPApiHandler), )
Cell provides access to the Local Redirect Policy Manager.
Functions ¶
This section is empty.
Types ¶
type LRPConfig ¶
type LRPConfig struct {
// contains filtered or unexported fields
}
LRPConfig is the internal representation of Cilium Local Redirect Policy.
type Manager ¶
type Manager struct {
// contains filtered or unexported fields
}
Manager manages configurations related to Local Redirect Policies that enable redirecting traffic from the specified frontend to a set of node-local backend pods selected based on the backend configuration. To do that, it keeps track of add/delete events for resources like LRP, Pod and Service. For every local redirect policy configuration, it creates a new lb.SVCTypeLocalRedirect service with a frontend that has at least one node-local backend.
func NewRedirectPolicyManager ¶
func NewRedirectPolicyManager(svc svcManager, svcCache *k8s.ServiceCache, lpr agentK8s.LocalPodResource, epM endpointManager) *Manager
func (*Manager) AddRedirectPolicy ¶
AddRedirectPolicy parses the given local redirect policy config, and updates internal state with the config fields.
func (*Manager) DeleteRedirectPolicy ¶
DeleteRedirectPolicy deletes the internal state associated with the given policy.
func (*Manager) EndpointCreated ¶ added in v1.16.0
func (*Manager) EndpointDeleted ¶ added in v1.16.0
func (rpm *Manager) EndpointDeleted(ep *endpoint.Endpoint, conf endpoint.DeleteConfig)
func (*Manager) EndpointRestored ¶ added in v1.16.0
func (*Manager) OnAddPod ¶
func (rpm *Manager) OnAddPod(pod *slimcorev1.Pod)
func (*Manager) OnAddService ¶
OnAddService handles Kubernetes service (clusterIP type) add events, and updates the internal state for the policy config associated with the service.
func (*Manager) OnDeletePod ¶
func (rpm *Manager) OnDeletePod(pod *slimcorev1.Pod)
func (*Manager) OnDeleteService ¶
OnDeleteService handles Kubernetes service deletes, and deletes the internal state for the policy config that might be associated with the service.
func (*Manager) OnUpdatePod ¶
func (rpm *Manager) OnUpdatePod(pod *slimcorev1.Pod, needsReassign bool, ready bool)
func (*Manager) OnUpdatePodLocked ¶
func (rpm *Manager) OnUpdatePodLocked(pod *slimcorev1.Pod, removeOld bool, upsertNew bool)