redirectpolicy

package
v1.10.4 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Sep 1, 2021 License: Apache-2.0 Imports: 22 Imported by: 2

Documentation

Overview

Package redirectpolicy defines an internal representation of the Cilium Local Redirect Policy. The structures are managed by the RedirectPolicyManager.

Index

Constants

This section is empty.

Variables

This section is empty.

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.

func Parse

func Parse(clrp *v2.CiliumLocalRedirectPolicy, sanitize bool) (*LRPConfig, error)

Parse parses the specified cilium local redirect policy spec, and returns a sanitized LRPConfig.

func (*LRPConfig) GetModel

func (config *LRPConfig) GetModel() *models.LRPSpec

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) *Manager

func (*Manager) AddRedirectPolicy

func (rpm *Manager) AddRedirectPolicy(config LRPConfig) (bool, error)

AddRedirectPolicy parses the given local redirect policy config, and updates internal state with the config fields.

func (*Manager) DeleteRedirectPolicy

func (rpm *Manager) DeleteRedirectPolicy(config LRPConfig) error

DeleteRedirectPolicy deletes the internal state associated with the given policy.

func (*Manager) GetLRPs

func (rpm *Manager) GetLRPs() []*LRPConfig

func (*Manager) OnAddPod

func (rpm *Manager) OnAddPod(pod *slimcorev1.Pod)

func (*Manager) OnAddService

func (rpm *Manager) OnAddService(svcID k8s.ServiceID)

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

func (rpm *Manager) OnDeleteService(svcID k8s.ServiceID)

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)

func (*Manager) RegisterGetStores added in v1.9.0

func (rpm *Manager) RegisterGetStores(sg StoreGetter)

func (*Manager) RegisterSvcCache

func (rpm *Manager) RegisterSvcCache(cache svcCache)

type StoreGetter added in v1.9.0

type StoreGetter interface {
	GetStore(name string) cache.Store
}

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL