networking

package
v1.5.2 Latest Latest
Warning

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

Go to latest
Published: Mar 19, 2026 License: Apache-2.0 Imports: 96 Imported by: 44

Documentation

Index

Constants

View Source
const (

	// Indicator for same or different node
	SAME_NODE      NodeType = iota
	DIFFERENT_NODE NodeType = iota

	// TODO get these defined as constandts in networkutils
	OVNKubernetesPluginName = "OVNKubernetes"

	// IP Address Families
	IPv4      IPFamily = "ipv4"
	IPv6      IPFamily = "ipv6"
	DualStack IPFamily = "dual"
	Unknown   IPFamily = "unknown"
)
View Source
const RequiredUDNNamespaceLabel = "k8s.ovn.org/primary-user-defined-network"

Variables

This section is empty.

Functions

func GetIPAddressFamily added in v1.5.2

func GetIPAddressFamily(oc *exutil.CLI) (bool, bool, error)

GetIPAddressFamily returns if this cloud uses IPv4 and/or IPv6.

func InBareMetalIPv4ClusterContext added in v1.5.2

func InBareMetalIPv4ClusterContext(oc *exutil.CLI, body func())

func InIPv4ClusterContext added in v1.5.2

func InIPv4ClusterContext(oc *exutil.CLI, body func())

func InOVNKubernetesContext added in v1.5.2

func InOVNKubernetesContext(body func())

func Network added in v1.5.2

func Network(ipn *net.IPNet) *net.IPNet

Network masks off the host portion of the IP, if IPNet is invalid, return nil copied from https://github.com/containernetworking/plugins/blob/acf8ddc8e1128e6f68a34f7fe91122afeb1fa93d/pkg/ip/cidr.go#L89C1-L105C2

func NextIP added in v1.5.2

func NextIP(ip net.IP) net.IP

NextIP returns IP incremented by 1, if IP is invalid, return nil copied from https://github.com/containernetworking/plugins/blob/acf8ddc8e1128e6f68a34f7fe91122afeb1fa93d/pkg/ip/cidr.go#L23

func ParallelTest added in v1.5.2

func ParallelTest(workers int, fns []func() error) []error

ParallelTest runs the provided fns in parallel with at most workers and returns an array of all non nil errors.

func SubnetIPs added in v1.5.2

func SubnetIPs(ipnet net.IPNet) ([]net.IP, error)

SubnetIPs enumerates all IP addresses in an IP subnet (starting with the provided IP address and including the broadcast address).

Types

type EgressIP added in v1.5.2

type EgressIP struct {
	metav1.TypeMeta   `json:",inline"`
	metav1.ObjectMeta `json:"metadata,omitempty"`

	// Specification of the desired behavior of EgressIP.
	Spec EgressIPSpec `json:"spec"`
	// Observed status of EgressIP. Read-only.
	// +optional
	Status EgressIPStatus `json:"status,omitempty"`
}

EgressIP is a CRD allowing the user to define a fixed source IP for all egress traffic originating from any pods which match the EgressIP resource according to its spec definition.

type EgressIPList added in v1.5.2

type EgressIPList struct {
	metav1.TypeMeta `json:",inline"`
	metav1.ListMeta `json:"metadata,omitempty"`

	// List of EgressIP.
	Items []EgressIP `json:"items"`
}

+k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object +resource:path=egressip EgressIPList is the list of EgressIPList.

type EgressIPSpec added in v1.5.2

type EgressIPSpec struct {
	// EgressIPs is the list of egress IP addresses requested. Can be IPv4 and/or IPv6.
	// This field is mandatory.
	EgressIPs []string `json:"egressIPs"`
	// NamespaceSelector applies the egress IP only to the namespace(s) whose label
	// matches this definition. This field is mandatory.
	NamespaceSelector metav1.LabelSelector `json:"namespaceSelector"`
	// PodSelector applies the egress IP only to the pods whose label
	// matches this definition. This field is optional, and in case it is not set:
	// results in the egress IP being applied to all pods in the namespace(s)
	// matched by the NamespaceSelector. In case it is set: is intersected with
	// the NamespaceSelector, thus applying the egress IP to the pods
	// (in the namespace(s) already matched by the NamespaceSelector) which
	// match this pod selector.
	// +optional
	PodSelector metav1.LabelSelector `json:"podSelector,omitempty"`
}

EgressIPSpec is a desired state description of EgressIP.

type EgressIPStatus added in v1.5.2

type EgressIPStatus struct {
	// The list of assigned egress IPs and their corresponding node assignment.
	Items []EgressIPStatusItem `json:"items"`
}

type EgressIPStatusItem added in v1.5.2

type EgressIPStatusItem struct {
	// Assigned node name
	Node string `json:"node"`
	// Assigned egress IP
	EgressIP string `json:"egressIP"`
}

The per node status, for those egress IPs who have been assigned.

type IPFamily added in v1.5.2

type IPFamily string

func GetIPFamilyForCluster added in v1.5.2

func GetIPFamilyForCluster(f *e2e.Framework) IPFamily

type NodeEgressIPConfiguration added in v1.5.2

type NodeEgressIPConfiguration struct {
	Interface string   `json:"interface"`
	IFAddr    ifAddr   `json:"ifaddr"`
	Capacity  capacity `json:"capacity"`
}

from github.com/openshift/cloud-network-config-controller/pkg/cloudprovider/cloudprovider.go

type NodeType

type NodeType int

type PodAnnotation added in v1.5.2

type PodAnnotation struct {
	// IPs are the pod's assigned IP addresses/prefixes
	IPs []*net.IPNet
	// MAC is the pod's assigned MAC address
	MAC net.HardwareAddr
	// Gateways are the pod's gateway IP addresses; note that there may be
	// fewer Gateways than IPs.
	Gateways []net.IP
	// Routes are additional routes to add to the pod's network namespace
	Routes []PodRoute
	// Primary reveals if this network is the primary network of the pod or not
	Primary bool
}

PodAnnotation describes the assigned network details for a single pod network. (The actual annotation may include the equivalent of multiple PodAnnotations.)

type PodRoute added in v1.5.2

type PodRoute struct {
	// Dest is the route destination
	Dest *net.IPNet
	// NextHop is the IP address of the next hop for traffic destined for Dest
	NextHop net.IP
}

PodRoute describes any routes to be added to the pod's network namespace

type PortAllocator added in v1.5.2

type PortAllocator struct {
	// contains filtered or unexported fields
}

PortAllocator is a simple class to allocate ports serially.

func NewPortAllocator added in v1.5.2

func NewPortAllocator(minPort, maxPort int) *PortAllocator

NewPortAllocator initialized a new object of type PortAllocator and returns a pointer to that object.

func (*PortAllocator) AllocateNextPort added in v1.5.2

func (p *PortAllocator) AllocateNextPort() (int, error)

AllocateNextPort will allocate a new port, serially. If the end of the range is reached, start over again at the start of the range and look for gaps.

func (*PortAllocator) ReleasePort added in v1.5.2

func (p *PortAllocator) ReleasePort(port int) error

ReleasePort will release the allocatoin for port <port>.

type SysctlVariant added in v1.5.2

type SysctlVariant struct {
	Sysctl string
	Value  string
	Path   string
}

type VirtualMachineInstanceCondition added in v1.5.2

type VirtualMachineInstanceCondition struct {
	Type   VirtualMachineInstanceConditionType `json:"type"`
	Status corev1.ConditionStatus              `json:"status"`
	// +nullable
	LastProbeTime metav1.Time `json:"lastProbeTime,omitempty"`
	// +nullable
	LastTransitionTime metav1.Time `json:"lastTransitionTime,omitempty"`
	Reason             string      `json:"reason,omitempty"`
	Message            string      `json:"message,omitempty"`
}

[{"lastProbeTime":null,"lastTransitionTime":"2024-10-16T15:56:27Z","status":"True","type":"Ready"},{"lastProbeTime":null,"lastTransitionTime":null,"status":"True","type":"LiveMigratable"},{"lastProbeTime":null,"lastTransitionTime":null,"status":"True","type":"StorageLiveMigratable"},{"lastProbeTime":"2024-10-16T15:56:44Z","lastTransitionTime":null,"status":"True","type":"AgentConnected"}]

type VirtualMachineInstanceConditionType added in v1.5.2

type VirtualMachineInstanceConditionType string
const VirtualMachineInstanceConditionReady VirtualMachineInstanceConditionType = "Ready"

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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