Documentation ¶
Index ¶
- func ClusterDNSServiceIP() (string, error)
- func CreateCloudInitNetworkData(networkData *CloudInitNetworkData) ([]byte, error)
- func CreateDefaultCloudInitNetworkData() (string, error)
- func GetIp(ips []string, family k8sv1.IPFamily) string
- func GetPodIpByFamily(pod *k8sv1.Pod, family k8sv1.IPFamily) string
- func GetVmiPrimaryIpByFamily(vmi *v1.VirtualMachineInstance, family k8sv1.IPFamily) string
- func IsClusterDualStack(virtClient kubecli.KubevirtClient) (bool, error)
- func PingFromVMConsole(vmi *v1.VirtualMachineInstance, ipAddr string, args ...string) error
- func SearchDomains() []string
- func SkipWhenNotDualStackCluster(virtClient kubecli.KubevirtClient)
- func ValidateVMIandPodIPMatch(vmi *v1.VirtualMachineInstance, vmiPod *k8sv1.Pod) error
- type CloudInitInterface
- type CloudInitNameservers
- type CloudInitNetworkData
- type CloudInitRoute
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ClusterDNSServiceIP ¶ added in v0.35.0
ClusterDNSServiceIP returns the cluster IP address of the DNS service. Attempts first to detect the DNS service on a k8s cluster and if not found on an openshift cluster.
func CreateCloudInitNetworkData ¶ added in v0.35.0
func CreateCloudInitNetworkData(networkData *CloudInitNetworkData) ([]byte, error)
CreateCloudInitNetworkData generates a configuration for the Cloud-Init Network Data version 2 format based on the inputed data.
func CreateDefaultCloudInitNetworkData ¶ added in v0.35.0
CreateDefaultCloudInitNetworkData generates a default configuration for the Cloud-Init Network Data, in version 2 format. The default configuration sets dynamic IPv4 (DHCP) and static IPv6 addresses, inclusing DNS settings of the cluster nameserver IP and search domains.
func GetPodIpByFamily ¶ added in v0.35.0
func GetVmiPrimaryIpByFamily ¶ added in v0.34.1
func GetVmiPrimaryIpByFamily(vmi *v1.VirtualMachineInstance, family k8sv1.IPFamily) string
func IsClusterDualStack ¶
func IsClusterDualStack(virtClient kubecli.KubevirtClient) (bool, error)
func PingFromVMConsole ¶ added in v0.35.0
func PingFromVMConsole(vmi *v1.VirtualMachineInstance, ipAddr string, args ...string) error
PingFromVMConsole performs a ping through the provided VMI console. Optional arguments for the ping command may be provided, overwirting the default ones. (default ping options: "-c 1, -w 5") Note: The maximum overall command timeout is 10 seconds.
func SearchDomains ¶ added in v0.35.0
func SearchDomains() []string
SearchDomains returns a list of default search name domains.
func SkipWhenNotDualStackCluster ¶ added in v0.34.1
func SkipWhenNotDualStackCluster(virtClient kubecli.KubevirtClient)
func ValidateVMIandPodIPMatch ¶ added in v0.35.0
func ValidateVMIandPodIPMatch(vmi *v1.VirtualMachineInstance, vmiPod *k8sv1.Pod) error
ValidateVMIandPodIPMatch Checks that the vmi pod and vmi scheme have matching Ip/Ips fields for primary interface
Types ¶
type CloudInitInterface ¶ added in v0.35.0
type CloudInitInterface struct { AcceptRA *bool `yaml:"accept-ra,omitempty"` Addresses []string `yaml:"addresses,omitempty"` DHCP4 *bool `yaml:"dhcp4,omitempty"` DHCP6 *bool `yaml:"dhcp6,omitempty"` DHCPIdentifier string `yaml:"dhcp-identifier,omitempty"` // "duid" or "mac" Gateway4 string `yaml:"gateway4,omitempty"` Gateway6 string `yaml:"gateway6,omitempty"` Nameservers CloudInitNameservers `yaml:"nameservers,omitempty"` MACAddress string `yaml:"macaddress,omitempty"` MTU int `yaml:"mtu,omitempty"` Routes []CloudInitRoute `yaml:"routes,omitempty"` }
type CloudInitNameservers ¶ added in v0.35.0
type CloudInitNetworkData ¶ added in v0.35.0
type CloudInitNetworkData struct { Version int `yaml:"version"` Ethernets map[string]CloudInitInterface `yaml:"ethernets,omitempty"` }
type CloudInitRoute ¶ added in v0.35.0
type CloudInitRoute struct { From string `yaml:"from,omitempty"` OnLink *bool `yaml:"on-link,omitempty"` Scope string `yaml:"scope,omitempty"` Table *int `yaml:"table,omitempty"` To string `yaml:"to,omitempty"` Type string `yaml:"type,omitempty"` Via string `yaml:"via,omitempty"` Metric *int `yaml:"metric,omitempty"` }