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 ¶
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.Provide(newPolicyResource), )
Cell provides a Manager for consumption with hive.
Functions ¶
func NewEgressGatewayManager ¶
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 (*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 Policies resource.Resource[*Policy] Lifecycle hive.Lifecycle }
type Policy ¶
type Policy = v2.CiliumEgressGatewayPolicy
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