Documentation ¶
Overview ¶
Package egressgateway defines an internal representation of the Cilium Egress Policy. The structures are managed by the Manager.
Index ¶
- Variables
- func ParseCEGPConfigID(cegp *v2.CiliumEgressGatewayPolicy) types.NamespacedName
- type Config
- type Manager
- func (manager *Manager) OnAddEgressPolicy(config PolicyConfig)
- func (manager *Manager) OnDeleteEgressPolicy(configID policyID)
- func (manager *Manager) OnDeleteEndpoint(endpoint *k8sTypes.CiliumEndpoint)
- func (manager *Manager) OnDeleteNode(node nodeTypes.Node)
- func (manager *Manager) OnUpdateEndpoint(endpoint *k8sTypes.CiliumEndpoint)
- func (manager *Manager) OnUpdateNode(node nodeTypes.Node)
- type Params
- type PolicyConfig
Constants ¶
This section is empty.
Variables ¶
var ( // GatewayNotFoundIPv4 is a special IP value used as gatewayIP in the BPF policy // map to indicate no gateway was found for the given policy GatewayNotFoundIPv4 = net.ParseIP("0.0.0.0") // ExcludedCIDRIPv4 is a special IP value used as gatewayIP in the BPF policy map // to indicate the entry is for an excluded CIDR and should skip egress gateway ExcludedCIDRIPv4 = net.ParseIP("0.0.0.1") )
var Cell = cell.Module( "egressgateway", "Egress Gateway allows originating traffic from specific IPv4 addresses", cell.Config(defaultConfig), cell.Provide(NewEgressGatewayManager), )
Cell provides a Manager for consumption with hive.
Functions ¶
func ParseCEGPConfigID ¶
func ParseCEGPConfigID(cegp *v2.CiliumEgressGatewayPolicy) types.NamespacedName
ParseCEGPConfigID takes a CiliumEgressGatewayPolicy CR and returns only the config id
Types ¶
type Config ¶
type Config struct { // Install egress gateway IP rules and routes in order to properly steer // egress gateway traffic to the correct ENI interface InstallEgressGatewayRoutes bool // Default amount of time between triggers of egress gateway state // reconciliations are invoked EgressGatewayReconciliationTriggerInterval time.Duration }
type Manager ¶
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 (*Manager) OnAddEgressPolicy ¶ added in v1.10.6
func (manager *Manager) OnAddEgressPolicy(config PolicyConfig)
OnAddEgressPolicy parses the given policy config, and updates internal state with the config fields.
func (*Manager) OnDeleteEgressPolicy ¶ added in v1.10.6
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 ¶
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 ¶
OnUpdateNode is the event handler for node additions and updates.
type Params ¶
type Params struct { cell.In Config Config DaemonConfig *option.DaemonConfig CacheStatus k8s.CacheStatus IdentityAllocator identityCache.IdentityAllocator PolicyMap egressmap.PolicyMap Lifecycle hive.Lifecycle }
type PolicyConfig ¶
type PolicyConfig struct {
// contains filtered or unexported fields
}
PolicyConfig is the internal representation of CiliumEgressGatewayPolicy.
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