Documentation
¶
Overview ¶
Package remapping contains the logic to remap the CIDRs in case of repeated ones.
Index ¶
- Constants
- Variables
- func CreateOrUpdateNatMappingCIDR(ctx context.Context, cl client.Client, opts *Options, ...) error
- func CreateOrUpdateNatMappingIP(ctx context.Context, cl client.Client, ip *ipamv1alpha1.IP) error
- func DeleteNatMappingIP(ctx context.Context, cl client.Client, ip *ipamv1alpha1.IP) error
- func ForgeFirewallTargetLabels(remoteID string) map[string]string
- func ForgeFirewallTargetLabelsIPMappingFabric() map[string]string
- func ForgeFirewallTargetLabelsIPMappingGw() map[string]string
- func ForgeIPTargetLabelsMapping() map[string]string
- func GetFirstIPFromMapping(ipMapping map[string]networkingv1alpha1.IP) string
- type CIDRType
- type IPReconciler
- type Options
- type RemappingReconciler
Constants ¶
const ( // IPCategoryTargetKey is the key used by the IPAM controller to reconcile only resources related to a group. IPCategoryTargetKey = "ipam.liqo.io/ip-category" // IPCategoryTargetValueMapping is the value used by the IPAM controller to reconcile only resources related to a group. IPCategoryTargetValueMapping = "ip-mapping" // FirewallCategoryTargetValueGw is the value used by the firewallconfiguration controller to reconcile only resources related to a gateway. FirewallCategoryTargetValueGw = "gateway" // FirewallCategoryTargetValueFabric is the value used by the firewallconfiguration controller to reconcile only resources related to fabric. FirewallCategoryTargetValueFabric = "fabric" // FirewallSubCategoryTargetValueIPMapping is the value used by the firewallconfiguration controller // to reconcile only resources related to the IP mapping. FirewallSubCategoryTargetValueIPMapping = "ip-mapping" )
Variables ¶
var ( // TablePodCIDRName is the name of the table for the pod CIDR. TablePodCIDRName = "remap-podcidr" // TableExternalCIDRName is the name of the table for the external CIDR. TableExternalCIDRName = "remap-externalcidr" // TableIPMappingGwName is the name of the table for the IP mapping. TableIPMappingGwName = "remap-ipmapping-gw" // TableIPMappingFabricName is the name of the table for the IP mapping. TableIPMappingFabricName = "remap-ipmapping-fabric" // DNATChainName is the name of the chain for the output traffic. DNATChainName = "outgoing" // SNATChainName is the name of the chain for the input traffic. SNATChainName = "incoming" // PreroutingChainName is the name of the chain for the IP mapping. PreroutingChainName = "prerouting" // PostroutingChainName is the name of the chain for the IP mapping. PostroutingChainName = "postrouting" )
Functions ¶
func CreateOrUpdateNatMappingCIDR ¶
func CreateOrUpdateNatMappingCIDR(ctx context.Context, cl client.Client, opts *Options, cfg *networkingv1alpha1.Configuration, scheme *runtime.Scheme, cidrtype CIDRType) error
CreateOrUpdateNatMappingCIDR creates or updates the NAT mapping for a CIDR type.
func CreateOrUpdateNatMappingIP ¶
CreateOrUpdateNatMappingIP creates or updates the NAT mapping for an IP.
func DeleteNatMappingIP ¶
DeleteNatMappingIP deletes the NAT mapping for an IP.
func ForgeFirewallTargetLabels ¶
ForgeFirewallTargetLabels returns the labels used by the firewallconfiguration controller to reconcile only resources related to a single gateway.
func ForgeFirewallTargetLabelsIPMappingFabric ¶
ForgeFirewallTargetLabelsIPMappingFabric returns the labels used by the firewallconfiguration controller to reconcile only resources related to the IP mapping.
func ForgeFirewallTargetLabelsIPMappingGw ¶
ForgeFirewallTargetLabelsIPMappingGw returns the labels used by the firewallconfiguration controller to reconcile only resources related to the IP mapping.
func ForgeIPTargetLabelsMapping ¶
ForgeIPTargetLabelsMapping returns the labels used by the IPAM controller to reconcile only resources related to a single IP.
func GetFirstIPFromMapping ¶
func GetFirstIPFromMapping(ipMapping map[string]networkingv1alpha1.IP) string
GetFirstIPFromMapping returns the first IP from the IP mapping.
Types ¶
type IPReconciler ¶
IPReconciler manage IP.
func NewIPReconciler ¶
func NewIPReconciler(cl client.Client, s *runtime.Scheme) *IPReconciler
NewIPReconciler returns a new IPReconciler.
func (*IPReconciler) SetupWithManager ¶
func (r *IPReconciler) SetupWithManager(mgr ctrl.Manager) error
SetupWithManager register the IPReconciler to the manager.
type Options ¶
type Options struct { // DefaultInterfaceName is the name of the interface where the default rout points in main table. DefaultInterfaceName string }
Options contains the options for the remapping controller.
type RemappingReconciler ¶
type RemappingReconciler struct { Client client.Client Scheme *runtime.Scheme EventsRecorder record.EventRecorder Options *Options }
RemappingReconciler updates the PublicKey resource used to establish the Wireguard configuration.
func NewRemappingReconciler ¶
func NewRemappingReconciler(cl client.Client, s *runtime.Scheme, er record.EventRecorder) (*RemappingReconciler, error)
NewRemappingReconciler returns a new PublicKeysReconciler.
func (*RemappingReconciler) SetupWithManager ¶
func (r *RemappingReconciler) SetupWithManager(mgr ctrl.Manager) error
SetupWithManager register the RemappingReconciler to the manager.