Documentation
¶
Index ¶
- Constants
- func AddLabelToNamespace(client kubecli.KubevirtClient, namespace, key, value string) error
- func CidrToIP(cidr string) (string, error)
- func ClusterDNSServiceIP() (string, error)
- func CreateDefaultCloudInitNetworkData() (string, error)
- func GetIp(ips []string, family k8sv1.IPFamily) string
- func GetLoopbackAddress(family k8sv1.IPFamily) string
- func GetLoopbackAddressForUrl(family k8sv1.IPFamily) string
- func GetPodIpByFamily(pod *k8sv1.Pod, family k8sv1.IPFamily) string
- func GetVmiPrimaryIpByFamily(vmi *v1.VirtualMachineInstance, family k8sv1.IPFamily) string
- func NewExposeArgs(resource, namespace, name string, opts ...Option) []string
- func NewNetworkData(options ...NetworkDataOption) (string, error)
- func NewVMExposeArgs(vm *v1.VirtualMachine, opts ...Option) []string
- func NewVMIExposeArgs(vmi *v1.VirtualMachineInstance, opts ...Option) []string
- func NewVMIRSExposeArgs(vmrs *v1.VirtualMachineInstanceReplicaSet, opts ...Option) []string
- func PingFromVMConsole(vmi *v1.VirtualMachineInstance, ipAddr string, args ...string) error
- func RemoveAllLabelsFromNamespace(client kubecli.KubevirtClient, namespace string) error
- func RemoveLabelFromNamespace(client kubecli.KubevirtClient, namespace, key string) error
- func SearchDomains() []string
- func SkipWhenClusterNotSupportIpFamily(virtClient kubecli.KubevirtClient, ipFamily k8sv1.IPFamily)
- func SkipWhenClusterNotSupportIpv4(virtClient kubecli.KubevirtClient)
- func SkipWhenClusterNotSupportIpv6(virtClient kubecli.KubevirtClient)
- func SkipWhenNotDualStackCluster(virtClient kubecli.KubevirtClient)
- func ValidateVMIandPodIPMatch(vmi *v1.VirtualMachineInstance, vmiPod *k8sv1.Pod) error
- func WithPort(port string) func(cmdArgs []string) []string
- func WithProtocol(protocol string) func(cmdArgs []string) []string
- func WithServiceName(serviceName string) func(cmdArgs []string) []string
- func WithTargetPort(targetPort string) func(cmdArgs []string) []string
- func WithType(serviceType string) func(cmdArgs []string) []string
- 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
- type Option
Constants ¶
const (
DefaultIPv6Address = "fd10:0:2::2"
DefaultIPv6CIDR = DefaultIPv6Address + "/120"
DefaultIPv6Gateway = "fd10:0:2::1"
)
Variables ¶
This section is empty.
Functions ¶
func AddLabelToNamespace ¶ added in v0.42.0
func AddLabelToNamespace(client kubecli.KubevirtClient, namespace, key, value string) error
func ClusterDNSServiceIP ¶ added in v0.35.0
func ClusterDNSServiceIP() (string, error)
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
func CreateDefaultCloudInitNetworkData() (string, error)
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 GetLoopbackAddress ¶ added in v0.52.0
func GetLoopbackAddress(family k8sv1.IPFamily) string
func GetLoopbackAddressForUrl ¶ added in v0.52.0
func GetLoopbackAddressForUrl(family k8sv1.IPFamily) string
func GetPodIpByFamily ¶ added in v0.35.0
func GetPodIpByFamily(pod *k8sv1.Pod, family k8sv1.IPFamily) string
func GetVmiPrimaryIpByFamily ¶ added in v0.34.1
func GetVmiPrimaryIpByFamily(vmi *v1.VirtualMachineInstance, family k8sv1.IPFamily) string
func NewExposeArgs ¶ added in v0.45.0
func NewExposeArgs(resource, namespace, name string, opts ...Option) []string
func NewNetworkData ¶ added in v0.36.0
func NewNetworkData(options ...NetworkDataOption) (string, error)
func NewVMExposeArgs ¶ added in v0.45.0
func NewVMExposeArgs(vm *v1.VirtualMachine, opts ...Option) []string
func NewVMIExposeArgs ¶ added in v0.45.0
func NewVMIExposeArgs(vmi *v1.VirtualMachineInstance, opts ...Option) []string
func NewVMIRSExposeArgs ¶ added in v0.45.0
func NewVMIRSExposeArgs(vmrs *v1.VirtualMachineInstanceReplicaSet, opts ...Option) []string
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 5, -w 10") Note: The maximum overall command timeout is 20 seconds.
func RemoveAllLabelsFromNamespace ¶ added in v0.42.0
func RemoveAllLabelsFromNamespace(client kubecli.KubevirtClient, namespace string) error
func RemoveLabelFromNamespace ¶ added in v0.42.0
func RemoveLabelFromNamespace(client kubecli.KubevirtClient, namespace, key string) error
func SearchDomains ¶ added in v0.35.0
func SearchDomains() []string
SearchDomains returns a list of default search name domains.
func SkipWhenClusterNotSupportIpFamily ¶ added in v0.52.0
func SkipWhenClusterNotSupportIpFamily(virtClient kubecli.KubevirtClient, ipFamily k8sv1.IPFamily)
func SkipWhenClusterNotSupportIpv4 ¶ added in v0.52.0
func SkipWhenClusterNotSupportIpv4(virtClient kubecli.KubevirtClient)
func SkipWhenClusterNotSupportIpv6 ¶ added in v0.52.0
func SkipWhenClusterNotSupportIpv6(virtClient kubecli.KubevirtClient)
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 WithProtocol ¶ added in v0.45.0
func WithProtocol(protocol string) func(cmdArgs []string) []string
func WithServiceName ¶ added in v0.45.0
func WithServiceName(serviceName string) func(cmdArgs []string) []string
func WithTargetPort ¶ added in v0.45.0
func WithTargetPort(targetPort string) func(cmdArgs []string) []string
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 CloudInitMatch struct {
Name string `json:"name,omitempty"`
MACAddress string `json:"macaddress,omitempty"`
Driver string `json:"driver,omitempty"`
}
type CloudInitNameservers ¶ added in v0.35.0
type CloudInitNameservers struct {
Search []string `json:"search,omitempty,flow"`
Addresses []string `json:"addresses,omitempty,flow"`
}
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