Documentation ¶
Overview ¶
Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
Index ¶
- Constants
- Variables
- type RouteController
- func (r *RouteController) DeleteAllIPTablesChains()
- func (r *RouteController) InsertRoutesPerCluster(endpoint *netv1alpha1.TunnelEndpoint) error
- func (r *RouteController) Reconcile(req ctrl.Request) (ctrl.Result, error)
- func (r *RouteController) SetupSignalHandlerForRouteOperator() (stopCh <-chan struct{})
- func (r *RouteController) SetupWithManager(mgr ctrl.Manager) error
- func (r *RouteController) ToBeProcessedByRouteOperator(meta metav1.Object) bool
- func (r *RouteController) WatchConfiguration(config *rest.Config, gv *schema.GroupVersion)
- type TunnelController
- type TunnelEndpointCreator
- func (r *TunnelEndpointCreator) AdvertisementHandler(obj *unstructured.Unstructured)
- func (r *TunnelEndpointCreator) CreateTunnelEndpoint(param networkParam) error
- func (r *TunnelEndpointCreator) GetClustersSubnets() (map[string]*net.IPNet, error)
- func (r *TunnelEndpointCreator) GetConfiguration(config *configv1alpha1.ClusterConfig) (map[string]*net.IPNet, error)
- func (r *TunnelEndpointCreator) GetTunnelEndpoint(name string) (*netv1alpha1.TunnelEndpoint, bool, error)
- func (r *TunnelEndpointCreator) InitConfiguration(reservedSubnets map[string]*net.IPNet, clusterSubnets map[string]*net.IPNet) error
- func (r *TunnelEndpointCreator) PeeringRequestHandler(obj *unstructured.Unstructured)
- func (r *TunnelEndpointCreator) ProcessTunnelEndpoint(param networkParam) error
- func (r *TunnelEndpointCreator) Reconcile(req ctrl.Request) (ctrl.Result, error)
- func (r *TunnelEndpointCreator) SetNetParameters(config *configv1alpha1.ClusterConfig)
- func (r *TunnelEndpointCreator) SetupWithManager(mgr ctrl.Manager) error
- func (r *TunnelEndpointCreator) UpdateConfiguration(reservedSubnets map[string]*net.IPNet) error
- func (r *TunnelEndpointCreator) UpdateSpecTunnelEndpoint(param networkParam) error
- func (r *TunnelEndpointCreator) UpdateStatusTunnelEndpoint(param networkParam) error
- func (r *TunnelEndpointCreator) WatchConfiguration(config *rest.Config, gv *schema.GroupVersion)
- func (d *TunnelEndpointCreator) Watcher(dynClient dynamic.Interface, gvr schema.GroupVersionResource, ...)
Constants ¶
const ( TunEndpointNamePrefix = "tun-endpoint-" NetConfigNamePrefix = "net-config-" )
Variables ¶
var ( LiqonetPostroutingChain = "LIQONET-POSTROUTING" LiqonetPreroutingChain = "LIQONET-PREROUTING" LiqonetForwardingChain = "LIQONET-FORWARD" LiqonetInputChain = "LIQONET-INPUT" NatTable = "nat" FilterTable = "filter" )
Functions ¶
This section is empty.
Types ¶
type RouteController ¶
type RouteController struct { client.Client Log logr.Logger Scheme *runtime.Scheme RouteOperator bool NodeName string ClientSet *kubernetes.Clientset RemoteVTEPs []string IsGateway bool VxlanNetwork string GatewayVxlanIP string VxlanIfaceName string VxlanPort int IPtables liqonetOperator.IPTables NetLink liqonetOperator.NetLink ClusterPodCIDR string Configured chan bool //channel to comunicate when the podCIDR has been set IsConfigured bool //true when the operator is configured and ready to be started //here we save only the rules that reference the custom chains added by us //we need them at deletion time IPTablesRuleSpecsReferencingChains map[string]liqonetOperator.IPtableRule //using a map to avoid duplicate entries. the key is the rulespec //here we save the custom iptables chains, this chains are added at startup time so there should not be duplicates //but we use a map to avoid them in case the operator crashes and then is restarted by kubernetes IPTablesChains map[string]liqonetOperator.IPTableChain //for each cluster identified by clusterID we save all the rulespecs needed to ensure communication with its pods IPtablesRuleSpecsPerRemoteCluster map[string][]liqonetOperator.IPtableRule //here we save routes associated to each remote cluster RoutesPerRemoteCluster map[string][]netlink.Route RetryTimeout time.Duration // contains filtered or unexported fields }
RouteController reconciles a TunnelEndpoint object
func (*RouteController) DeleteAllIPTablesChains ¶
func (r *RouteController) DeleteAllIPTablesChains()
this function is called when the route-operator program is closed the errors are not checked because the function is called at exit time it cleans up all the possible resources a log message is emitted if in case of error only if the iptables binaries are missing an error is returned
func (*RouteController) InsertRoutesPerCluster ¶
func (r *RouteController) InsertRoutesPerCluster(endpoint *netv1alpha1.TunnelEndpoint) error
func (*RouteController) SetupSignalHandlerForRouteOperator ¶
func (r *RouteController) SetupSignalHandlerForRouteOperator() (stopCh <-chan struct{})
SetupSignalHandlerForRouteOperator registers for SIGTERM, SIGINT. A stop channel is returned which is closed on one of these signals.
func (*RouteController) SetupWithManager ¶
func (r *RouteController) SetupWithManager(mgr ctrl.Manager) error
func (*RouteController) ToBeProcessedByRouteOperator ¶
func (r *RouteController) ToBeProcessedByRouteOperator(meta metav1.Object) bool
func (*RouteController) WatchConfiguration ¶
func (r *RouteController) WatchConfiguration(config *rest.Config, gv *schema.GroupVersion)
type TunnelController ¶
type TunnelController struct { client.Client Log logr.Logger Scheme *runtime.Scheme TunnelIFacesPerRemoteCluster map[string]int RetryTimeout time.Duration }
TunnelController reconciles a TunnelEndpoint object
func (*TunnelController) RemoveAllTunnels ¶
func (r *TunnelController) RemoveAllTunnels()
used to remove all the tunnel interfaces when the controller is closed it does not return an error, but just logs them, cause we can not recover from them at exit time
func (*TunnelController) SetupSignalHandlerForTunnelOperator ¶
func (r *TunnelController) SetupSignalHandlerForTunnelOperator() (stopCh <-chan struct{})
SetupSignalHandlerForRouteOperator registers for SIGTERM, SIGINT, SIGKILL. A stop channel is returned which is closed on one of these signals.
func (*TunnelController) SetupWithManager ¶
func (r *TunnelController) SetupWithManager(mgr ctrl.Manager) error
type TunnelEndpointCreator ¶
type TunnelEndpointCreator struct { client.Client Log logr.Logger Scheme *runtime.Scheme DynClient dynamic.Interface GatewayIP string PodCIDR string ServiceCIDR string ReservedSubnets map[string]*net.IPNet IPManager liqonetOperator.IpManager Mutex sync.Mutex IsConfigured bool Configured chan bool AdvWatcher chan bool PReqWatcher chan bool RunningWatchers bool RetryTimeout time.Duration // contains filtered or unexported fields }
func (*TunnelEndpointCreator) AdvertisementHandler ¶
func (r *TunnelEndpointCreator) AdvertisementHandler(obj *unstructured.Unstructured)
func (*TunnelEndpointCreator) CreateTunnelEndpoint ¶
func (r *TunnelEndpointCreator) CreateTunnelEndpoint(param networkParam) error
func (*TunnelEndpointCreator) GetClustersSubnets ¶
func (r *TunnelEndpointCreator) GetClustersSubnets() (map[string]*net.IPNet, error)
it returns the subnets used by the foreign clusters get the list of all tunnelEndpoint CR and saves the address space assigned to the foreign cluster.
func (*TunnelEndpointCreator) GetConfiguration ¶
func (r *TunnelEndpointCreator) GetConfiguration(config *configv1alpha1.ClusterConfig) (map[string]*net.IPNet, error)
func (*TunnelEndpointCreator) GetTunnelEndpoint ¶
func (r *TunnelEndpointCreator) GetTunnelEndpoint(name string) (*netv1alpha1.TunnelEndpoint, bool, error)
func (*TunnelEndpointCreator) InitConfiguration ¶
func (*TunnelEndpointCreator) PeeringRequestHandler ¶
func (r *TunnelEndpointCreator) PeeringRequestHandler(obj *unstructured.Unstructured)
func (*TunnelEndpointCreator) ProcessTunnelEndpoint ¶
func (r *TunnelEndpointCreator) ProcessTunnelEndpoint(param networkParam) error
func (*TunnelEndpointCreator) SetNetParameters ¶
func (r *TunnelEndpointCreator) SetNetParameters(config *configv1alpha1.ClusterConfig)
func (*TunnelEndpointCreator) SetupWithManager ¶
func (r *TunnelEndpointCreator) SetupWithManager(mgr ctrl.Manager) error
func (*TunnelEndpointCreator) UpdateConfiguration ¶
func (r *TunnelEndpointCreator) UpdateConfiguration(reservedSubnets map[string]*net.IPNet) error
func (*TunnelEndpointCreator) UpdateSpecTunnelEndpoint ¶
func (r *TunnelEndpointCreator) UpdateSpecTunnelEndpoint(param networkParam) error
func (*TunnelEndpointCreator) UpdateStatusTunnelEndpoint ¶
func (r *TunnelEndpointCreator) UpdateStatusTunnelEndpoint(param networkParam) error
func (*TunnelEndpointCreator) WatchConfiguration ¶
func (r *TunnelEndpointCreator) WatchConfiguration(config *rest.Config, gv *schema.GroupVersion)
func (*TunnelEndpointCreator) Watcher ¶
func (d *TunnelEndpointCreator) Watcher(dynClient dynamic.Interface, gvr schema.GroupVersionResource, handler func(obj *unstructured.Unstructured), start chan bool)