Documentation ¶
Index ¶
- Constants
- func GetClusterNameAndDomain(kubeconfigPath, clusterConfigPath string) (clusterName string, clusterDomain string, err error)
- func GetIpFromFile(filePath string) (net.IP, error)
- func GetKubeconfigClusterNameAndDomain(kubeconfigPath string) (name, domain string, err error)
- func GetNodes(kubeconfigPath string) (*v1.NodeList, error)
- func GetVRRPConfig(apiVip, ingressVip net.IP) (vipIface net.Interface, nonVipAddr *net.IPNet, err error)
- func IsUpgradeStillRunning(kubeconfigPath string) (bool, error)
- func PopulateNodeAddresses(kubeconfigPath string, node *Node)
- func SetDebugLogLevel()
- func SetInfoLogLevel()
- type ApiLBConfig
- type Backend
- type Cluster
- type ClusterLBConfig
- type IngressConfig
- type Node
- type NodeAddress
Constants ¶
const ( NodeIpIpV6File = "/run/nodeip-configuration/ipv6" NodeIpIpV4File = "/run/nodeip-configuration/ipv4" )
Variables ¶
This section is empty.
Functions ¶
func GetClusterNameAndDomain ¶
func GetIpFromFile ¶
Return ip from primaryIp file if file and ip exists and readable In case of error return empty string
func GetNodes ¶
GetNodes will return a list of all nodes in the cluster
Args:
- kubeconfigPath as string
Returns:
- v1.NodeList or error
func GetVRRPConfig ¶
func IsUpgradeStillRunning ¶
IsUpgradeStillRunning check if the upgrade is still running by looking at the nodes' machineconfiguration state and kubelet version. Once all of the machineconfigurations are Done and all kubelet versions match we know it is safe to trigger the unicast migration.
Args:
- kubeconfigPath as string
Returns:
- true (upgrade still running), false (upgrade complete) or error
func PopulateNodeAddresses ¶
func SetDebugLogLevel ¶
func SetDebugLogLevel()
func SetInfoLogLevel ¶
func SetInfoLogLevel()
Types ¶
type ApiLBConfig ¶
type ApiLBConfig struct { ApiPort uint16 LbPort uint16 StatPort uint16 Backends []Backend FrontendAddr string }
func GetLBConfig ¶
type Cluster ¶
type Cluster struct { Name string Domain string APIVIP string APIVirtualRouterID uint8 APIVIPRecordType string APIVIPEmptyType string IngressVIP string IngressVirtualRouterID uint8 IngressVIPRecordType string IngressVIPEmptyType string VIPNetmask int MasterAmount int64 NodeAddresses []NodeAddress APILBIPs []string APIIntLBIPs []string IngressLBIPs []string CloudLBRecordType string CloudLBEmptyType string }
func (*Cluster) PopulateVRIDs ¶
PopulateVRIDs fills in the Virtual Router information for the provided Node configuration
type ClusterLBConfig ¶
type IngressConfig ¶
type IngressConfig struct {
Peers []string
}
func GetIngressConfig ¶
func GetIngressConfig(kubeconfigPath string, vips []string) (IngressConfig, error)
type Node ¶
type Node struct { Cluster Cluster LBConfig ApiLBConfig NonVirtualIP string ShortHostname string VRRPInterface string DNSUpstreams []string IngressConfig IngressConfig EnableUnicast bool Configs *[]Node }
func GetConfig ¶
func GetConfig(kubeconfigPath, clusterConfigPath, resolvConfPath string, apiVips, ingressVips []net.IP, apiPort, lbPort, statPort uint16, clusterLBConfig ClusterLBConfig) (node Node, err error)
Returns a Node object populated with the configuration specified by the parameters to the function. kubeconfigPath: The path to a kubeconfig that can be used to read cluster status from the k8s api. clusterConfigPath: The path to cluster-config.yaml. This is only available on the bootstrap node so it is optional. If the file is not available, set this to "". resolvConfPath: The path to resolv.conf. Typically either /etc/resolv.conf or /var/run/NetworkManager/resolv.conf. apiVips and ingressVips: Lists of VIPs for API and Ingress, respectively. apiPort: The port on which the k8s api listens. Should be 6443. lbPort: The port on which haproxy listens. statPort: The port on which the haproxy stats endpoint listens. clusterLBConfig: A struct containing IPs for API, API-Int and Ingress LBs
func PopulateCloudLBIPAddresses ¶
func PopulateCloudLBIPAddresses(clusterLBConfig ClusterLBConfig, node Node) (updatedNode Node, err error)