egressgateway

package
v0.0.0-...-c34bea4 Latest Latest
Warning

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

Go to latest
Published: May 20, 2022 License: Apache-2.0 Imports: 27 Imported by: 0

Documentation

Overview

Package egressgateway defines an internal representation of the Cilium Egress Policy. The structures are managed by the Manager.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ParseCEGPConfigID

func ParseCEGPConfigID(cegp *v2.CiliumEgressGatewayPolicy) types.NamespacedName

ParseCEGPConfigID takes a CiliumEgressGatewayPolicy CR and returns only the config id

func ParseCENPConfigID

func ParseCENPConfigID(cenp *v2alpha1.CiliumEgressNATPolicy) types.NamespacedName

ParseCENPConfigID takes a CiliumEgressNATPolicy CR and returns only the config id

Types

type Manager

type Manager struct {
	lock.Mutex
	// contains filtered or unexported fields
}

The egressgateway manager stores the internal data tracking the node, policy, endpoint, and lease mappings. It also hooks up all the callbacks to update egress bpf policy map accordingly.

func NewEgressGatewayManager

func NewEgressGatewayManager(k8sCacheSyncedChecker k8sCacheSyncedChecker, identityAlocator identityCache.IdentityAllocator) *Manager

NewEgressGatewayManager returns a new Egress Gateway Manager.

func (*Manager) OnAddEgressPolicy

func (manager *Manager) OnAddEgressPolicy(config PolicyConfig)

OnAddEgressPolicy parses the given policy config, and updates internal state with the config fields.

func (*Manager) OnDeleteEgressPolicy

func (manager *Manager) OnDeleteEgressPolicy(configID policyID)

OnDeleteEgressPolicy deletes the internal state associated with the given policy, including egress eBPF map entries.

func (*Manager) OnDeleteEndpoint

func (manager *Manager) OnDeleteEndpoint(endpoint *k8sTypes.CiliumEndpoint)

OnDeleteEndpoint is the event handler for endpoint deletions.

func (*Manager) OnDeleteNode

func (manager *Manager) OnDeleteNode(node nodeTypes.Node)

OnDeleteNode is the event handler for node deletions.

func (*Manager) OnUpdateEndpoint

func (manager *Manager) OnUpdateEndpoint(endpoint *k8sTypes.CiliumEndpoint)

OnUpdateEndpoint is the event handler for endpoint additions and updates.

func (*Manager) OnUpdateNode

func (manager *Manager) OnUpdateNode(node nodeTypes.Node)

OnUpdateNode is the event handler for node additions and updates.

type PolicyConfig

type PolicyConfig struct {
	// contains filtered or unexported fields
}

PolicyConfig is the internal representation of Cilium Egress NAT Policy.

func ParseCEGP

func ParseCEGP(cegp *v2.CiliumEgressGatewayPolicy) (*PolicyConfig, error)

ParseCEGP takes a CiliumEgressGatewayPolicy CR and converts to PolicyConfig, the internal representation of the egress gateway policy

func ParseCENP

func ParseCENP(cenp *v2alpha1.CiliumEgressNATPolicy) (*PolicyConfig, error)

ParseCENP takes a CiliumEgressNATPolicy CR and converts to PolicyConfig, the internal representation of the egress nat policy

Jump to

Keyboard shortcuts

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