egressgateway

package
v1.11.0-rc2 Latest Latest
Warning

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

Go to latest
Published: Nov 19, 2021 License: Apache-2.0 Imports: 17 Imported by: 2

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 ParsePolicyConfigID added in v1.10.6

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

ParsePolicyConfigID takes a CiliumEgressNATPolicy CR and returns only the config id

Types

type Manager

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

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

func NewEgressGatewayManager

func NewEgressGatewayManager() *Manager

func (*Manager) AddEgressPolicy

func (manager *Manager) AddEgressPolicy(config PolicyConfig) (bool, error)

AddEgressPolicy parses the given policy config, and updates internal state with the config fields. returns bool indicates if policy is added, err inidates first encountered error

func (*Manager) DeleteEgressPolicy

func (manager *Manager) DeleteEgressPolicy(configID policyID) error

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) OnUpdateEndpoint

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

OnUpdateEndpoint is the event handler for endpoint additions and updates.

type PolicyConfig

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

PolicyConfig is the internal representation of Cilium Egress NAT Policy.

func ParsePolicy added in v1.10.6

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

ParsePolicy 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