Documentation ¶
Index ¶
- Constants
- type CIDRNetworkEntry
- type OvnClusterController
- func (cluster *OvnClusterController) RebuildOVNDatabase(masterNodeName string, oc *ovn.Controller) error
- func (cluster *OvnClusterController) SetupMaster(masterNodeName string) error
- func (cluster *OvnClusterController) StartClusterMaster(masterNodeName string) error
- func (cluster *OvnClusterController) StartClusterNode(name string) error
- func (cluster *OvnClusterController) UpdateDBForKubeNodes(masterNodeName string) error
- func (cluster *OvnClusterController) UpdateKubeNsObjects(oc *ovn.Controller) error
- func (cluster *OvnClusterController) UpdateMasterNodeIP(masterNodeName string) error
Constants ¶
const ( // OvnHostSubnet is the constant string representing the annotation key OvnHostSubnet = "ovn_host_subnet" // DefaultNamespace is the name of the default namespace DefaultNamespace = "default" // MasterOverlayIP is the overlay IP address on master node MasterOverlayIP = "master_overlay_ip" // OvnClusterRouter is the name of the distributed router OvnClusterRouter = "ovn_cluster_router" )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type CIDRNetworkEntry ¶
CIDRNetworkEntry is the object that holds the definition for a single network CIDR range
type OvnClusterController ¶
type OvnClusterController struct { Kube kube.Interface TCPLoadBalancerUUID string UDPLoadBalancerUUID string ClusterServicesSubnet string ClusterIPNet []CIDRNetworkEntry GatewayInit bool GatewayIntf string GatewayBridge string GatewayNextHop string GatewaySpareIntf bool GatewayVLANID uint NodePortEnable bool OvnHA bool LocalnetGateway bool // contains filtered or unexported fields }
OvnClusterController is the object holder for utilities meant for cluster management
func NewClusterController ¶
func NewClusterController(kubeClient kubernetes.Interface, wf *factory.WatchFactory) *OvnClusterController
NewClusterController creates a new controller for IP subnet allocation to a given resource type (either Namespace or Node)
func (*OvnClusterController) RebuildOVNDatabase ¶
func (cluster *OvnClusterController) RebuildOVNDatabase( masterNodeName string, oc *ovn.Controller) error
RebuildOVNDatabase rebuilds db if HA option is enabled and OVN DB doesn't exist. First It updates k8s nodes by creating a logical switch for each node. Then it reads all resources from k8s and creates needed resources in OVN DB. Last, it updates master node ip in default namespace to trigger event on node.
func (*OvnClusterController) SetupMaster ¶
func (cluster *OvnClusterController) SetupMaster(masterNodeName string) error
SetupMaster creates the central router and load-balancers for the network
func (*OvnClusterController) StartClusterMaster ¶
func (cluster *OvnClusterController) StartClusterMaster(masterNodeName string) error
StartClusterMaster runs a subnet IPAM and a controller that watches arrival/departure of nodes in the cluster On an addition to the cluster (node create), a new subnet is created for it that will translate to creation of a logical switch (done by the node, but could be created here at the master process too) Upon deletion of a node, the switch will be deleted
TODO: Verify that the cluster was not already called with a different global subnet
If true, then either quit or perform a complete reconfiguration of the cluster (recreate switches/routers with new subnet values)
func (*OvnClusterController) StartClusterNode ¶
func (cluster *OvnClusterController) StartClusterNode(name string) error
StartClusterNode learns the subnet assigned to it by the master controller and calls the SetupNode script which establishes the logical switch
func (*OvnClusterController) UpdateDBForKubeNodes ¶
func (cluster *OvnClusterController) UpdateDBForKubeNodes( masterNodeName string) error
UpdateDBForKubeNodes rebuilds ovn db for k8s nodes
func (*OvnClusterController) UpdateKubeNsObjects ¶
func (cluster *OvnClusterController) UpdateKubeNsObjects( oc *ovn.Controller) error
UpdateKubeNsObjects rebuilds ovn db for k8s namespaces and pods/networkpolicies inside the namespaces.
func (*OvnClusterController) UpdateMasterNodeIP ¶
func (cluster *OvnClusterController) UpdateMasterNodeIP( masterNodeName string) error
UpdateMasterNodeIP add annotations of master node IP on default namespace