Documentation ¶
Index ¶
- Constants
- func ClusterDNSServiceIP() (string, 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 NewNetworkData(options ...NetworkDataOption) (string, 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
- func WithIPv6(loginToFactory console.LoginToFactory) console.LoginToFactory
- type CloudInitInterface
- type CloudInitMatch
- type CloudInitNameservers
- type CloudInitNetworkData
- type CloudInitRoute
- type NetworkDataInterfaceOption
- func WithAcceptRA() NetworkDataInterfaceOption
- func WithAddresses(addresses ...string) NetworkDataInterfaceOption
- func WithDHCP4Enabled() NetworkDataInterfaceOption
- func WithDHCP6Enabled() NetworkDataInterfaceOption
- func WithGateway6(gateway6 string) NetworkDataInterfaceOption
- func WithMatchingMAC(macAddress string) NetworkDataInterfaceOption
- func WithNameserverFromCluster() NetworkDataInterfaceOption
- type NetworkDataOption
Constants ¶
const ( DefaultIPv6Address = "fd10:0:2::2" DefaultIPv6CIDR = DefaultIPv6Address + "/120" DefaultIPv6Gateway = "fd10:0:2::1" )
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 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 NewNetworkData ¶ added in v0.36.0
func NewNetworkData(options ...NetworkDataOption) (string, 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
func WithIPv6 ¶ added in v0.36.0
func WithIPv6(loginToFactory console.LoginToFactory) console.LoginToFactory
Types ¶
type CloudInitInterface ¶ added in v0.35.0
type CloudInitInterface struct { AcceptRA *bool `json:"accept-ra,omitempty"` Addresses []string `json:"addresses,omitempty"` DHCP4 *bool `json:"dhcp4,omitempty"` DHCP6 *bool `json:"dhcp6,omitempty"` DHCPIdentifier string `json:"dhcp-identifier,omitempty"` // "duid" or "mac" Gateway4 string `json:"gateway4,omitempty"` Gateway6 string `json:"gateway6,omitempty"` Nameservers CloudInitNameservers `json:"nameservers,omitempty"` MACAddress string `json:"macaddress,omitempty"` Match CloudInitMatch `json:"match,omitempty"` MTU int `json:"mtu,omitempty"` Routes []CloudInitRoute `json:"routes,omitempty"` SetName string `json:"set-name,omitempty"` // contains filtered or unexported fields }
type CloudInitMatch ¶ added in v0.36.0
type CloudInitNameservers ¶ added in v0.35.0
type CloudInitNetworkData ¶ added in v0.35.0
type CloudInitNetworkData struct { Version int `json:"version"` Ethernets map[string]CloudInitInterface `json:"ethernets,omitempty"` }
type CloudInitRoute ¶ added in v0.35.0
type CloudInitRoute struct { From string `json:"from,omitempty"` OnLink *bool `json:"on-link,omitempty"` Scope string `json:"scope,omitempty"` Table *int `json:"table,omitempty"` To string `json:"to,omitempty"` Type string `json:"type,omitempty"` Via string `json:"via,omitempty"` Metric *int `json:"metric,omitempty"` }
type NetworkDataInterfaceOption ¶ added in v0.36.0
type NetworkDataInterfaceOption func(*CloudInitInterface) error
func WithAcceptRA ¶ added in v0.37.0
func WithAcceptRA() NetworkDataInterfaceOption
func WithAddresses ¶ added in v0.36.0
func WithAddresses(addresses ...string) NetworkDataInterfaceOption
func WithDHCP4Enabled ¶ added in v0.36.0
func WithDHCP4Enabled() NetworkDataInterfaceOption
func WithDHCP6Enabled ¶ added in v0.37.0
func WithDHCP6Enabled() NetworkDataInterfaceOption
func WithGateway6 ¶ added in v0.36.0
func WithGateway6(gateway6 string) NetworkDataInterfaceOption
func WithMatchingMAC ¶ added in v0.36.0
func WithMatchingMAC(macAddress string) NetworkDataInterfaceOption
func WithNameserverFromCluster ¶ added in v0.36.0
func WithNameserverFromCluster() NetworkDataInterfaceOption
type NetworkDataOption ¶ added in v0.36.0
type NetworkDataOption func(*CloudInitNetworkData) error
func WithEthernet ¶ added in v0.36.0
func WithEthernet(name string, options ...NetworkDataInterfaceOption) NetworkDataOption