cluster

package
v0.3.11 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Aug 20, 2018 License: Apache-2.0 Imports: 21 Imported by: 0

Documentation

Index

Constants

View Source
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"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type OvnClusterController

type OvnClusterController struct {
	Kube kube.Interface

	ClusterIPNet          *net.IPNet
	ClusterServicesSubnet string
	HostSubnetLength      uint32

	GatewayInit      bool
	GatewayIntf      string
	GatewayBridge    string
	GatewayNextHop   string
	GatewaySpareIntf bool
	NodePortEnable   bool
	OvnHA            bool
	LocalnetGateway  bool
	// contains filtered or unexported fields
}

OvnClusterController is the object holder for utilities meant for cluster management

func NewClusterController added in v0.2.0

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 added in v0.3.0

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 added in v0.3.0

func (cluster *OvnClusterController) UpdateDBForKubeNodes(
	masterNodeName string) error

UpdateDBForKubeNodes rebuilds ovn db for k8s nodes

func (*OvnClusterController) UpdateKubeNsObjects added in v0.3.0

func (cluster *OvnClusterController) UpdateKubeNsObjects(
	oc *ovn.Controller) error

UpdateKubeNsObjects rebuilds ovn db for k8s namespaces and pods/networkpolicies inside the namespaces.

func (*OvnClusterController) UpdateMasterNodeIP added in v0.3.0

func (cluster *OvnClusterController) UpdateMasterNodeIP(
	masterNodeName string) error

UpdateMasterNodeIP add annotations of master node IP on default namespace

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL