v1

package
v1.7.0 Latest Latest
Warning

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

Go to latest
Published: Apr 11, 2024 License: Apache-2.0 Imports: 7 Imported by: 293

Documentation

Index

Constants

View Source
const (
	DeviceInfoTypePCI       = "pci"
	DeviceInfoTypeVHostUser = "vhost-user"
	DeviceInfoTypeMemif     = "memif"
	DeviceInfoTypeVDPA      = "vdpa"
	DeviceInfoVersion       = "1.1.0"
)
View Source
const (
	VhostDeviceModeClient = "client"
	VhostDeviceModeServer = "server"
)
View Source
const (
	MemifDeviceRoleMaster   = "master"
	MemitDeviceRoleSlave    = "slave"
	MemifDeviceModeEthernet = "ethernet"
	MemitDeviceModeIP       = "ip"
	MemitDeviceModePunt     = "punt"
)
View Source
const (
	// Pod annotation for network-attachment-definition
	NetworkAttachmentAnnot = "k8s.v1.cni.cncf.io/networks"
	// Pod annotation for network status
	NetworkStatusAnnot = "k8s.v1.cni.cncf.io/network-status"
)

Variables

View Source
var (
	// localSchemeBuilder and AddToScheme will stay in k8s.io/kubernetes.
	SchemeBuilder runtime.SchemeBuilder

	AddToScheme = localSchemeBuilder.AddToScheme
)
View Source
var SchemeGroupVersion = schema.GroupVersion{Group: k8scnicncfio.GroupName, Version: "v1"}

SchemeGroupVersion is group version used to register these objects

View Source
var TooManyIPSources = errors.New("cannot provide a static IP and a reference of an IPAM claim in the same network selection element")

Functions

func Resource

func Resource(resource string) schema.GroupResource

Resource takes an unqualified resource and returns a Group qualified GroupResource

Types

type BandwidthEntry

type BandwidthEntry struct {
	IngressRate  int `json:"ingressRate"`
	IngressBurst int `json:"ingressBurst"`

	EgressRate  int `json:"egressRate"`
	EgressBurst int `json:"egressBurst"`
}

BandwidthEntry for CNI BandwidthEntry +k8s:deepcopy-gen=false

type DNS

type DNS struct {
	Nameservers []string `json:"nameservers,omitempty"`
	Domain      string   `json:"domain,omitempty"`
	Search      []string `json:"search,omitempty"`
	Options     []string `json:"options,omitempty"`
}

DNS contains values interesting for DNS resolvers +k8s:deepcopy-gen=false

type DeviceInfo added in v1.2.0

type DeviceInfo struct {
	Type      string       `json:"type,omitempty"`
	Version   string       `json:"version,omitempty"`
	Pci       *PciDevice   `json:"pci,omitempty"`
	Vdpa      *VdpaDevice  `json:"vdpa,omitempty"`
	VhostUser *VhostDevice `json:"vhost-user,omitempty"`
	Memif     *MemifDevice `json:"memif,omitempty"`
}

DeviceInfo contains the information of the device associated with this network (if any)

func (*DeviceInfo) DeepCopy added in v1.2.0

func (in *DeviceInfo) DeepCopy() *DeviceInfo

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new DeviceInfo.

func (*DeviceInfo) DeepCopyInto added in v1.2.0

func (in *DeviceInfo) DeepCopyInto(out *DeviceInfo)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

type MemifDevice added in v1.2.0

type MemifDevice struct {
	Role string `json:"role,omitempty"`
	Path string `json:"path,omitempty"`
	Mode string `json:"mode,omitempty"`
}

func (*MemifDevice) DeepCopy added in v1.2.0

func (in *MemifDevice) DeepCopy() *MemifDevice

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new MemifDevice.

func (*MemifDevice) DeepCopyInto added in v1.2.0

func (in *MemifDevice) DeepCopyInto(out *MemifDevice)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

type NetworkAttachmentDefinition

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

	Spec NetworkAttachmentDefinitionSpec `json:"spec"`
}

func (*NetworkAttachmentDefinition) DeepCopy

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new NetworkAttachmentDefinition.

func (*NetworkAttachmentDefinition) DeepCopyInto

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

func (*NetworkAttachmentDefinition) DeepCopyObject

func (in *NetworkAttachmentDefinition) DeepCopyObject() runtime.Object

DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object.

type NetworkAttachmentDefinitionList

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

	Items []NetworkAttachmentDefinition `json:"items"`
}

+k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object

func (*NetworkAttachmentDefinitionList) DeepCopy

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new NetworkAttachmentDefinitionList.

func (*NetworkAttachmentDefinitionList) DeepCopyInto

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

func (*NetworkAttachmentDefinitionList) DeepCopyObject

func (in *NetworkAttachmentDefinitionList) DeepCopyObject() runtime.Object

DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object.

type NetworkAttachmentDefinitionSpec

type NetworkAttachmentDefinitionSpec struct {
	Config string `json:"config"`
}

func (*NetworkAttachmentDefinitionSpec) DeepCopy

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new NetworkAttachmentDefinitionSpec.

func (*NetworkAttachmentDefinitionSpec) DeepCopyInto

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

type NetworkSelectionElement

type NetworkSelectionElement struct {
	// Name contains the name of the Network object this element selects
	Name string `json:"name"`
	// Namespace contains the optional namespace that the network referenced
	// by Name exists in
	Namespace string `json:"namespace,omitempty"`
	// IPRequest contains an optional requested IP addresses for this network
	// attachment
	IPRequest []string `json:"ips,omitempty"`
	// MacRequest contains an optional requested MAC address for this
	// network attachment
	MacRequest string `json:"mac,omitempty"`
	// InfinibandGUIDRequest contains an optional requested Infiniband GUID
	// address for this network attachment
	InfinibandGUIDRequest string `json:"infiniband-guid,omitempty"`
	// InterfaceRequest contains an optional requested name for the
	// network interface this attachment will create in the container
	InterfaceRequest string `json:"interface,omitempty"`
	// PortMappingsRequest contains an optional requested port mapping
	// for the network
	PortMappingsRequest []*PortMapEntry `json:"portMappings,omitempty"`
	// BandwidthRequest contains an optional requested bandwidth for
	// the network
	BandwidthRequest *BandwidthEntry `json:"bandwidth,omitempty"`
	// CNIArgs contains additional CNI arguments for the network interface
	CNIArgs *map[string]interface{} `json:"cni-args,omitempty"`
	// GatewayRequest contains default route IP address for the pod
	GatewayRequest []net.IP `json:"default-route,omitempty"`
	// IPAMClaimReference container the IPAMClaim name where the IPs for this
	// attachment will be located.
	IPAMClaimReference string `json:"ipam-claim-reference,omitempty"`
}

NetworkSelectionElement represents one element of the JSON format Network Attachment Selection Annotation as described in section 4.1.2 of the CRD specification. +k8s:deepcopy-gen=false

func (*NetworkSelectionElement) UnmarshalJSON added in v1.6.0

func (nse *NetworkSelectionElement) UnmarshalJSON(b []byte) error

type NetworkStatus

type NetworkStatus struct {
	Name       string      `json:"name"`
	Interface  string      `json:"interface,omitempty"`
	IPs        []string    `json:"ips,omitempty"`
	Mac        string      `json:"mac,omitempty"`
	Mtu        int         `json:"mtu,omitempty"`
	Default    bool        `json:"default,omitempty"`
	DNS        DNS         `json:"dns,omitempty"`
	DeviceInfo *DeviceInfo `json:"device-info,omitempty"`
	Gateway    []string    `json:"gateway,omitempty"`
}

NetworkStatus is for network status annotation for pod +k8s:deepcopy-gen=false

type NoK8sNetworkError

type NoK8sNetworkError struct {
	Message string
}

NoK8sNetworkError indicates error, no network in kubernetes +k8s:deepcopy-gen=false

func (*NoK8sNetworkError) Error

func (e *NoK8sNetworkError) Error() string

type PciDevice added in v1.2.0

type PciDevice struct {
	PciAddress        string `json:"pci-address,omitempty"`
	Vhostnet          string `json:"vhost-net,omitempty"`
	RdmaDevice        string `json:"rdma-device,omitempty"`
	PfPciAddress      string `json:"pf-pci-address,omitempty"`
	RepresentorDevice string `json:"representor-device,omitempty"`
}

func (*PciDevice) DeepCopy added in v1.2.0

func (in *PciDevice) DeepCopy() *PciDevice

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new PciDevice.

func (*PciDevice) DeepCopyInto added in v1.2.0

func (in *PciDevice) DeepCopyInto(out *PciDevice)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

type PortMapEntry

type PortMapEntry struct {
	HostPort      int    `json:"hostPort"`
	ContainerPort int    `json:"containerPort"`
	Protocol      string `json:"protocol,omitempty"`
	HostIP        string `json:"hostIP,omitempty"`
}

PortMapEntry for CNI PortMapEntry +k8s:deepcopy-gen=false

type VdpaDevice added in v1.2.0

type VdpaDevice struct {
	ParentDevice      string `json:"parent-device,omitempty"`
	Driver            string `json:"driver,omitempty"`
	Path              string `json:"path,omitempty"`
	PciAddress        string `json:"pci-address,omitempty"`
	PfPciAddress      string `json:"pf-pci-address,omitempty"`
	RepresentorDevice string `json:"representor-device,omitempty"`
}

func (*VdpaDevice) DeepCopy added in v1.2.0

func (in *VdpaDevice) DeepCopy() *VdpaDevice

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new VdpaDevice.

func (*VdpaDevice) DeepCopyInto added in v1.2.0

func (in *VdpaDevice) DeepCopyInto(out *VdpaDevice)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

type VhostDevice added in v1.2.0

type VhostDevice struct {
	Mode string `json:"mode,omitempty"`
	Path string `json:"path,omitempty"`
}

func (*VhostDevice) DeepCopy added in v1.2.0

func (in *VhostDevice) DeepCopy() *VhostDevice

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new VhostDevice.

func (*VhostDevice) DeepCopyInto added in v1.2.0

func (in *VhostDevice) DeepCopyInto(out *VhostDevice)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

Jump to

Keyboard shortcuts

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