Documentation ¶
Index ¶
- Constants
- Variables
- func Resource(resource string) schema.GroupResource
- type BandwidthEntry
- type DNS
- type DeviceInfo
- type MemifDevice
- type NetworkAttachmentDefinition
- type NetworkAttachmentDefinitionList
- type NetworkAttachmentDefinitionSpec
- type NetworkSelectionElement
- type NetworkStatus
- type NoK8sNetworkError
- type PciDevice
- type PortMapEntry
- type VdpaDevice
- type VhostDevice
Constants ¶
const ( DeviceInfoTypePCI = "pci" DeviceInfoTypeVHostUser = "vhost-user" DeviceInfoTypeMemif = "memif" DeviceInfoTypeVDPA = "vdpa" DeviceInfoVersion = "1.1.0" )
const ( VhostDeviceModeClient = "client" VhostDeviceModeServer = "server" )
const ( MemifDeviceRoleMaster = "master" MemitDeviceRoleSlave = "slave" MemifDeviceModeEthernet = "ethernet" MemitDeviceModeIP = "ip" MemitDeviceModePunt = "punt" )
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 ¶
var ( // localSchemeBuilder and AddToScheme will stay in k8s.io/kubernetes. SchemeBuilder runtime.SchemeBuilder AddToScheme = localSchemeBuilder.AddToScheme )
var SchemeGroupVersion = schema.GroupVersion{Group: k8scnicncfio.GroupName, Version: "v1"}
SchemeGroupVersion is group version used to register these objects
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 ¶
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 ¶
func (in *DeviceInfo) DeepCopy() *DeviceInfo
DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new DeviceInfo.
func (*DeviceInfo) DeepCopyInto ¶
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 ¶
type MemifDevice struct { Role string `json:"role,omitempty"` Path string `json:"path,omitempty"` Mode string `json:"mode,omitempty"` }
func (*MemifDevice) DeepCopy ¶
func (in *MemifDevice) DeepCopy() *MemifDevice
DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new MemifDevice.
func (*MemifDevice) DeepCopyInto ¶
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 ¶
func (in *NetworkAttachmentDefinition) DeepCopy() *NetworkAttachmentDefinition
DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new NetworkAttachmentDefinition.
func (*NetworkAttachmentDefinition) DeepCopyInto ¶
func (in *NetworkAttachmentDefinition) DeepCopyInto(out *NetworkAttachmentDefinition)
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 ¶
func (in *NetworkAttachmentDefinitionList) DeepCopy() *NetworkAttachmentDefinitionList
DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new NetworkAttachmentDefinitionList.
func (*NetworkAttachmentDefinitionList) DeepCopyInto ¶
func (in *NetworkAttachmentDefinitionList) DeepCopyInto(out *NetworkAttachmentDefinitionList)
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 ¶
func (in *NetworkAttachmentDefinitionSpec) DeepCopy() *NetworkAttachmentDefinitionSpec
DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new NetworkAttachmentDefinitionSpec.
func (*NetworkAttachmentDefinitionSpec) DeepCopyInto ¶
func (in *NetworkAttachmentDefinitionSpec) DeepCopyInto(out *NetworkAttachmentDefinitionSpec)
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 ¶
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 ¶
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 ¶
DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new PciDevice.
func (*PciDevice) DeepCopyInto ¶
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 ¶
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 ¶
func (in *VdpaDevice) DeepCopy() *VdpaDevice
DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new VdpaDevice.
func (*VdpaDevice) DeepCopyInto ¶
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 ¶
func (*VhostDevice) DeepCopy ¶
func (in *VhostDevice) DeepCopy() *VhostDevice
DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new VhostDevice.
func (*VhostDevice) DeepCopyInto ¶
func (in *VhostDevice) DeepCopyInto(out *VhostDevice)
DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.