Documentation ¶
Index ¶
- Constants
- Variables
- func CheckDefChanged(def, existingDef *NetworkAttachmentDefinition) bool
- func GetHolderNetName(name string) string
- func GetMetaObject(name string, namespace string, annotations map[string]string) metav1.ObjectMeta
- func RemoveEmpty(args map[string]string, pluginStr string) string
- func RenderDir(manifestDir string, d *RenderData) ([]*unstructured.Unstructured, error)
- func RenderTemplate(path string, d *RenderData) ([]*unstructured.Unstructured, error)
- func ValidateResourceName(name string) string
- type AWSIPVLANNetConf
- type AwsVpcCNIPlugin
- type ConfigMapNameReference
- type DevicePluginSpec
- type DrainSpec
- type DriverUpgradePolicySpec
- type DynamicHandler
- func (h *DynamicHandler) Create(namespace string, dynamicObj interface{}, result interface{}) error
- func (h *DynamicHandler) Delete(name string, namespace string) error
- func (h *DynamicHandler) Get(name string, namespace string, result interface{}) error
- func (h *DynamicHandler) GetFirst(namespace string, result interface{}) error
- func (h *DynamicHandler) Update(namespace string, dynamicObj interface{}, result interface{}) error
- type HostDeviceNetwork
- type HostDeviceNetworkSpec
- type HostDeviceNetworkStatus
- type HostDeviceTypeNetConf
- type IBKubernetesSpec
- type IPVLANPlugin
- type IPVLANTypeNetConf
- type ImageSpec
- type ImageSpecWithConfig
- type InterfaceExt
- type InterfaceExts
- type MACVLANPlugin
- type MACVLANTypeNetConf
- type MellanoxPlugin
- func (p *MellanoxPlugin) CleanUp(net multinicv1.MultiNicNetwork) error
- func (p *MellanoxPlugin) GetConfig(net multinicv1.MultiNicNetwork, hifList map[string]multinicv1.HostInterface) (string, map[string]string, error)
- func (p *MellanoxPlugin) GetResourceName() string
- func (p *MellanoxPlugin) Init(config *rest.Config) error
- type MultusSpec
- type NVIPAMSpec
- type NetAttachDefHandler
- func (h *NetAttachDefHandler) CreateOrUpdate(net *multinicv1.MultiNicNetwork, pluginStr string, ...) error
- func (h *NetAttachDefHandler) CreateOrUpdateOnNamespace(ns string, net *multinicv1.MultiNicNetwork, pluginStr string, ...) error
- func (h *NetAttachDefHandler) Delete(name string, namespace string) error
- func (h *NetAttachDefHandler) DeleteNets(net *multinicv1.MultiNicNetwork) error
- func (h *NetAttachDefHandler) Get(name string, namespace string) (*NetworkAttachmentDefinition, error)
- func (h *NetAttachDefHandler) IsExist(name string, namespace string) bool
- type NetConf
- type NetworkAttachmentDefinition
- type NetworkAttachmentDefinitionSpec
- type NetworkStatus
- type NicClusterPolicy
- type NicClusterPolicySpec
- type NicClusterPolicyStatus
- type OFEDDriverSpec
- type PSPSpec
- type Plugin
- type PodProbeSpec
- type RenderData
- type SecondaryNetworkSpec
- type SriovInterface
- type SriovInterfaces
- type SriovNetwork
- type SriovNetworkNicSelector
- type SriovNetworkNodePolicy
- type SriovNetworkNodePolicySpec
- type SriovNetworkNodePolicyStatus
- type SriovNetworkNodeState
- type SriovNetworkNodeStateSpec
- type SriovNetworkNodeStateStatus
- type SriovNetworkSpec
- type SriovNetworkStatus
- type SriovPlugin
- func (p *SriovPlugin) CleanUp(net multinicv1.MultiNicNetwork) error
- func (p *SriovPlugin) GetConfig(net multinicv1.MultiNicNetwork, hifList map[string]multinicv1.HostInterface) (string, map[string]string, error)
- func (p *SriovPlugin) Init(config *rest.Config) error
- func (p *SriovPlugin) SriovnetworkName(name string) string
- type VfGroup
- type VirtualFunction
- type WaitForCompletionSpec
Constants ¶
const ( HOST_DEVICE_TYPE = "host-device" MELLANOX_TYPE = "mellanox" DEFAULT_MELLANOX_PREFIX = "nvidia.com" MELLANOX_NETWORK_RESOURCE = "hostdevicenetworks.v1alpha1.mellanox.com" MELLANOX_NIC_CLUSTER_POLICY_RESOURCE = "nicclusterpolicies.v1alpha1.mellanox.com" )
const ( MELLANOX_API_VERSION = "mellanox.com/v1alpha1" MELLANOX_NETWORK_KIND = "HostDeviceNetwork" MELLANOX_POLICY_KIND = "NicClusterPolicy" )
const ( CNI_VERSION = "0.3.0" NET_ATTACH_DEF_API_VERSION = "k8s.cni.cncf.io/v1" NET_ATTACH_DEF_RESOURCE = "network-attachment-definitions.v1.k8s.cni.cncf.io" NET_ATTACH_DEF_KIND = "NetworkAttachmentDefinition" StatusesKey = "k8s.v1.cni.cncf.io/networks-status" )
const ( SRIOV_RESOURCE_PREFIX = "openshift.io" SRIOV_NAMESPACE = "openshift-sriov-network-operator" SRIOV_IB_KEY = "ib" SRIOV_TYPE = "sriov" SRIOV_DEFAULT_NUMVFS = 1 SRIOV_NETWORK_RESOURCE = "sriovnetworks.v1.sriovnetwork.openshift.io" SRIOV_POLICY_RESOURCE = "sriovnetworknodepolicies.v1.sriovnetwork.openshift.io" SRIOV_NODE_STATE_RESOURCE = "sriovnetworknodestates.v1.sriovnetwork.openshift.io" )
const ( SRIOV_API_VERSION = "sriovnetwork.openshift.io/v1" SRIOV_NETWORK_KIND = "SriovNetwork" SRIOV_POLICY_KIND = "SriovNetworkNodePolicy" SRIOV_NODE_STATE_KIND = "SriovNetworkNodeState" )
//////////////////////////////////////// SR-IOV-related resources reference: github.com/k8snetworkplumbingwg/sriov-network-operator/api/v1@bc40302 ////////////////////////////////////////
const ( RESOURCE_ANNOTATION = "k8s.v1.cni.cncf.io/resourceName" HOLDER_SUFFIX = "-net" )
const (
AUTO_GEN_LABEL = "multi-nic-cni-generated"
)
const (
AWS_IPVLAN_TYPE = "aws-ipvlan"
)
const (
IPVLAN_TYPE = "ipvlan"
)
const (
MACVLAN_TYPE = "macvlan"
)
Variables ¶
var SRIOV_MANIFEST_PATH string = "/template/cni-config"
var SRIOV_NODE_SELECTOR map[string]string = map[string]string{
"feature.node.kubernetes.io/network-sriov.capable": "true",
}
Functions ¶
func CheckDefChanged ¶
func CheckDefChanged(def, existingDef *NetworkAttachmentDefinition) bool
func GetHolderNetName ¶
func GetMetaObject ¶
func RenderDir ¶
func RenderDir(manifestDir string, d *RenderData) ([]*unstructured.Unstructured, error)
RenderDir will render all manifests in a directory, descending in to subdirectories It will perform template substitutions based on the data supplied by the RenderData
func RenderTemplate ¶
func RenderTemplate(path string, d *RenderData) ([]*unstructured.Unstructured, error)
RenderTemplate reads, renders, and attempts to parse a yaml or json file representing one or more k8s api objects
func ValidateResourceName ¶
Types ¶
type AWSIPVLANNetConf ¶
type AwsVpcCNIPlugin ¶
type AwsVpcCNIPlugin struct { }
func (*AwsVpcCNIPlugin) CleanUp ¶
func (p *AwsVpcCNIPlugin) CleanUp(net multinicv1.MultiNicNetwork) error
func (*AwsVpcCNIPlugin) GetConfig ¶
func (p *AwsVpcCNIPlugin) GetConfig(net multinicv1.MultiNicNetwork, hifList map[string]multinicv1.HostInterface) (string, map[string]string, error)
type ConfigMapNameReference ¶
type ConfigMapNameReference struct {
Name string `json:"name,omitempty"`
}
ConfigMapNameReference references a config map in a specific namespace. The namespace must be specified at the point of use.
type DevicePluginSpec ¶
type DevicePluginSpec struct {
ImageSpecWithConfig `json:""`
}
DevicePluginSpec describes configuration options for device plugin 1. Image information for device plugin 2. Device plugin configuration
type DrainSpec ¶
type DrainSpec struct { // Enable indicates if node draining is allowed during upgrade // +optional // +kubebuilder:default:=true Enable bool `json:"enable,omitempty"` // Force indicates if force draining is allowed // +optional // +kubebuilder:default:=false Force bool `json:"force,omitempty"` // PodSelector specifies a label selector to filter pods on the node that need to be drained // For more details on label selectors, see: // https://kubernetes.io/docs/concepts/overview/working-with-objects/labels/#label-selectors // +optional PodSelector string `json:"podSelector,omitempty"` // TimeoutSecond specifies the length of time in seconds to wait before giving up drain, zero means infinite // +optional // +kubebuilder:default:=300 // +kubebuilder:validation:Minimum:=0 TimeoutSecond int `json:"timeoutSeconds,omitempty"` // DeleteEmptyDir indicates if should continue even if there are pods using emptyDir // (local data that will be deleted when the node is drained) // +optional // +kubebuilder:default:=false DeleteEmptyDir bool `json:"deleteEmptyDir,omitempty"` }
DrainSpec describes configuration for node drain during automatic upgrade
type DriverUpgradePolicySpec ¶
type DriverUpgradePolicySpec struct { // AutoUpgrade is a global switch for automatic upgrade feature // if set to false all other options are ignored // +optional // +kubebuilder:default:=false AutoUpgrade bool `json:"autoUpgrade,omitempty"` // MaxParallelUpgrades indicates how many nodes can be upgraded in parallel // 0 means no limit, all nodes will be upgraded in parallel // +optional // +kubebuilder:default:=1 // +kubebuilder:validation:Minimum:=0 MaxParallelUpgrades int `json:"maxParallelUpgrades,omitempty"` WaitForCompletion *WaitForCompletionSpec `json:"waitForCompletion,omitempty"` DrainSpec *DrainSpec `json:"drain,omitempty"` }
DriverUpgradePolicySpec describes policy configuration for automatic upgrades
type DynamicHandler ¶
type DynamicHandler struct { DYN dynamic.Interface GVR schema.GroupVersionResource }
func (*DynamicHandler) Create ¶
func (h *DynamicHandler) Create(namespace string, dynamicObj interface{}, result interface{}) error
func (*DynamicHandler) Delete ¶
func (h *DynamicHandler) Delete(name string, namespace string) error
func (*DynamicHandler) Get ¶
func (h *DynamicHandler) Get(name string, namespace string, result interface{}) error
func (*DynamicHandler) GetFirst ¶
func (h *DynamicHandler) GetFirst(namespace string, result interface{}) error
func (*DynamicHandler) Update ¶
func (h *DynamicHandler) Update(namespace string, dynamicObj interface{}, result interface{}) error
type HostDeviceNetwork ¶
type HostDeviceNetwork struct { metav1.TypeMeta `json:",inline"` metav1.ObjectMeta `json:"metadata,omitempty"` Spec HostDeviceNetworkSpec `json:"spec,omitempty"` Status HostDeviceNetworkStatus `json:"status,omitempty"` }
HostDeviceNetwork is the Schema for the hostdevicenetworks API
func NewHostDeviceNetwork ¶
func NewHostDeviceNetwork(metaObj metav1.ObjectMeta, spec HostDeviceNetworkSpec) HostDeviceNetwork
type HostDeviceNetworkSpec ¶
type HostDeviceNetworkSpec struct { // Namespace of the NetworkAttachmentDefinition custom resource NetworkNamespace string `json:"networkNamespace,omitempty"` // Host device resource pool name ResourceName string `json:"resourceName,omitempty"` // IPAM configuration to be used for this network IPAM string `json:"ipam,omitempty"` }
HostDeviceNetworkSpec defines the desired state of HostDeviceNetwork
type HostDeviceNetworkStatus ¶
type HostDeviceNetworkStatus struct { }
type HostDeviceTypeNetConf ¶
origin: https://github.com/containernetworking/plugins/blob/283f200489b5ef8f0b6aadc09f751ab0c5145497/plugins/main/host-device/host-device.go#L45C1-L56C2 template: https://github.com/Mellanox/network-operator/blob/ce089f067153ea73b4712f0ad905fea92a1cf453/manifests/state-hostdevice-network/0010-hostdevice-net-cr.yml#L11
type IBKubernetesSpec ¶
type IBKubernetesSpec struct { // Image information for ib-kubernetes ImageSpec `json:""` // Interval of updates in seconds // +optional // +kubebuilder:default:=5 // +kubebuilder:validation:Minimum:=0 PeriodicUpdateSeconds int `json:"periodicUpdateSeconds,omitempty"` // The first guid in the pool PKeyGUIDPoolRangeStart string `json:"pKeyGUIDPoolRangeStart,omitempty"` // The last guid in the pool PKeyGUIDPoolRangeEnd string `json:"pKeyGUIDPoolRangeEnd,omitempty"` // Secret containing credentials to UFM service UfmSecret string `json:"ufmSecret,omitempty"` }
IBKubernetesSpec describes configuration options for ib-kubernetes
type IPVLANPlugin ¶
type IPVLANPlugin struct { }
func (*IPVLANPlugin) CleanUp ¶
func (p *IPVLANPlugin) CleanUp(net multinicv1.MultiNicNetwork) error
func (*IPVLANPlugin) GetConfig ¶
func (p *IPVLANPlugin) GetConfig(net multinicv1.MultiNicNetwork, hifList map[string]multinicv1.HostInterface) (string, map[string]string, error)
type IPVLANTypeNetConf ¶
type ImageSpec ¶
type ImageSpec struct { // +kubebuilder:validation:Pattern=[a-zA-Z0-9\-]+ Image string `json:"image"` // +kubebuilder:validation:Pattern=[a-zA-Z0-9\.\-\/]+ Repository string `json:"repository"` // +kubebuilder:validation:Pattern=[a-zA-Z0-9\.-]+ Version string `json:"version"` // +optional // +kubebuilder:default:={} ImagePullSecrets []string `json:"imagePullSecrets"` }
ImageSpec Contains container image specifications
type ImageSpecWithConfig ¶
ImageSpecWithConfig Contains ImageSpec and optional configuration
type InterfaceExt ¶
type InterfaceExt struct { Name string `json:"name,omitempty"` Mac string `json:"mac,omitempty"` Driver string `json:"driver,omitempty"` PciAddress string `json:"pciAddress"` Vendor string `json:"vendor,omitempty"` DeviceID string `json:"deviceID,omitempty"` Mtu int `json:"mtu,omitempty"` NumVfs int `json:"numVfs,omitempty"` LinkSpeed string `json:"linkSpeed,omitempty"` LinkType string `json:"linkType,omitempty"` TotalVfs int `json:"totalvfs,omitempty"` VFs []VirtualFunction `json:"Vfs,omitempty"` }
type InterfaceExts ¶
type InterfaceExts []InterfaceExt
type MACVLANPlugin ¶
type MACVLANPlugin struct { }
func (*MACVLANPlugin) CleanUp ¶
func (p *MACVLANPlugin) CleanUp(net multinicv1.MultiNicNetwork) error
func (*MACVLANPlugin) GetConfig ¶
func (p *MACVLANPlugin) GetConfig(net multinicv1.MultiNicNetwork, hifList map[string]multinicv1.HostInterface) (string, map[string]string, error)
type MACVLANTypeNetConf ¶
type MellanoxPlugin ¶
type MellanoxPlugin struct { MellanoxNetworkHandler *DynamicHandler MellanoxNicClusterPolicyHandler *DynamicHandler }
func (*MellanoxPlugin) CleanUp ¶
func (p *MellanoxPlugin) CleanUp(net multinicv1.MultiNicNetwork) error
func (*MellanoxPlugin) GetConfig ¶
func (p *MellanoxPlugin) GetConfig(net multinicv1.MultiNicNetwork, hifList map[string]multinicv1.HostInterface) (string, map[string]string, error)
func (*MellanoxPlugin) GetResourceName ¶
func (p *MellanoxPlugin) GetResourceName() string
return first resource name found in SriovDevicePlugin
type MultusSpec ¶
type MultusSpec struct {
ImageSpecWithConfig `json:""`
}
MultusSpec describes configuration options for Multus CNI
- Image information for Multus CNI
- Multus CNI config if config is missing or empty then multus config will be automatically generated from the CNI configuration file of the master plugin (the first file in lexicographical order in cni-conf-dir)
type NVIPAMSpec ¶
type NVIPAMSpec struct {
ImageSpecWithConfig `json:""`
}
NVIPAMSpec describes configuration options for nv-ipam 1. Image information for nv-ipam 2. Configuration for nv-ipam
type NetAttachDefHandler ¶
type NetAttachDefHandler struct { *DynamicHandler *kubernetes.Clientset }
func GetNetAttachDefHandler ¶
func GetNetAttachDefHandler(config *rest.Config) (*NetAttachDefHandler, error)
func (*NetAttachDefHandler) CreateOrUpdate ¶
func (h *NetAttachDefHandler) CreateOrUpdate(net *multinicv1.MultiNicNetwork, pluginStr string, annotations map[string]string) error
func (*NetAttachDefHandler) CreateOrUpdateOnNamespace ¶
func (h *NetAttachDefHandler) CreateOrUpdateOnNamespace(ns string, net *multinicv1.MultiNicNetwork, pluginStr string, annotations map[string]string) error
func (*NetAttachDefHandler) Delete ¶
func (h *NetAttachDefHandler) Delete(name string, namespace string) error
Delete deletes NetworkAttachmentDefinition from name and namespace
func (*NetAttachDefHandler) DeleteNets ¶
func (h *NetAttachDefHandler) DeleteNets(net *multinicv1.MultiNicNetwork) error
func (*NetAttachDefHandler) Get ¶
func (h *NetAttachDefHandler) Get(name string, namespace string) (*NetworkAttachmentDefinition, error)
Get returns NetworkAttachmentDefinition object from name and namespace
type NetConf ¶
type NetConf struct { types.NetConf MainPlugin interface{} `json:"plugin"` Subnet string `json:"subnet"` MasterNetAddrs []string `json:"masterNets"` DeviceIDs []string `json:"deviceIDs,omitempty"` IsMultiNICIPAM bool `json:"multiNICIPAM,omitempty"` DaemonIP string `json:"daemonIP"` DaemonPort int `json:"daemonPort"` }
NetConf defines general config for multi-nic-cni
type NetworkAttachmentDefinition ¶
type NetworkAttachmentDefinition struct { metav1.TypeMeta `json:",inline"` metav1.ObjectMeta `json:"metadata,omitempty"` Spec NetworkAttachmentDefinitionSpec `json:"spec"` }
func NetToDef ¶
func NetToDef(namespace string, net *multinicv1.MultiNicNetwork, pluginStr string, annotations map[string]string) (*NetworkAttachmentDefinition, error)
NetToDef generates net-attach-def from multinicnetwork on specific namespace called by generate function
func NewNetworkAttachmentDefinition ¶
func NewNetworkAttachmentDefinition(metaObj metav1.ObjectMeta, spec NetworkAttachmentDefinitionSpec) NetworkAttachmentDefinition
//////////////////////////////////////// NetworkAttachmentDefinition reference: github.com/k8snetworkplumbingwg/network-attachment-definition-client/pkg/apis/k8s.cni.cncf.io/v1
func (*NetworkAttachmentDefinition) GetName ¶
func (def *NetworkAttachmentDefinition) GetName() string
func (*NetworkAttachmentDefinition) GetNameSpace ¶
func (def *NetworkAttachmentDefinition) GetNameSpace() string
type NetworkAttachmentDefinitionSpec ¶
type NetworkAttachmentDefinitionSpec struct {
Config string `json:"config"`
}
type NetworkStatus ¶
type NicClusterPolicy ¶
type NicClusterPolicy struct { metav1.TypeMeta `json:",inline"` metav1.ObjectMeta `json:"metadata,omitempty"` Spec NicClusterPolicySpec `json:"spec,omitempty"` Status NicClusterPolicyStatus `json:"status,omitempty"` }
NicClusterPolicy is the Schema for the nicclusterpolicies API
type NicClusterPolicySpec ¶
type NicClusterPolicySpec struct { NodeAffinity *v1.NodeAffinity `json:"nodeAffinity,omitempty"` Tolerations []v1.Toleration `json:"tolerations,omitempty"` OFEDDriver *OFEDDriverSpec `json:"ofedDriver,omitempty"` SriovDevicePlugin *DevicePluginSpec `json:"sriovDevicePlugin,omitempty"` IBKubernetes *IBKubernetesSpec `json:"ibKubernetes,omitempty"` SecondaryNetwork *SecondaryNetworkSpec `json:"secondaryNetwork,omitempty"` NvIpam *NVIPAMSpec `json:"nvIpam,omitempty"` PSP *PSPSpec `json:"psp,omitempty"` }
NicClusterPolicySpec defines the desired state of NicClusterPolicy
type NicClusterPolicyStatus ¶
type NicClusterPolicyStatus struct { }
type OFEDDriverSpec ¶
type OFEDDriverSpec struct { // Image information for ofed driver container ImageSpec `json:""` // Pod startup probe settings StartupProbe *PodProbeSpec `json:"startupProbe,omitempty"` // Pod liveness probe settings LivenessProbe *PodProbeSpec `json:"livenessProbe,omitempty"` // Pod readiness probe settings ReadinessProbe *PodProbeSpec `json:"readinessProbe,omitempty"` // List of environment variables to set in the OFED container. Env []v1.EnvVar `json:"env,omitempty"` // Ofed auto-upgrade settings OfedUpgradePolicy *DriverUpgradePolicySpec `json:"upgradePolicy,omitempty"` // Optional: Custom TLS certificates configuration for driver container CertConfig *ConfigMapNameReference `json:"certConfig,omitempty"` // Optional: Custom package repository configuration for OFED container RepoConfig *ConfigMapNameReference `json:"repoConfig,omitempty"` // TerminationGracePeriodSeconds specifies the length of time in seconds // to wait before killing the OFED pod on termination // +optional // +kubebuilder:default:=300 // +kubebuilder:validation:Minimum:=0 TerminationGracePeriodSeconds int64 `json:"terminationGracePeriodSeconds,omitempty"` }
OFEDDriverSpec describes configuration options for OFED driver
type PSPSpec ¶
type PSPSpec struct { // Enabled indicates if PodSecurityPolicies needs to be enabled for all Pods // +optional // +kubebuilder:default:=false Enabled bool `json:"enabled,omitempty"` }
PSPSpec describes configuration for PodSecurityPolicies to apply for all Pods
type Plugin ¶
type Plugin interface { GetConfig(net multinicv1.MultiNicNetwork, hifList map[string]multinicv1.HostInterface) (string, map[string]string, error) CleanUp(net multinicv1.MultiNicNetwork) error }
type PodProbeSpec ¶
type RenderData ¶
func MakeRenderData ¶
func MakeRenderData() RenderData
type SecondaryNetworkSpec ¶
type SecondaryNetworkSpec struct { // Image and configuration information for multus Multus *MultusSpec `json:"multus,omitempty"` // Image information for CNI plugins CniPlugins *ImageSpec `json:"cniPlugins,omitempty"` // Image information for IPoIB CNI IPoIB *ImageSpec `json:"ipoib,omitempty"` // Image information for IPAM plugin IpamPlugin *ImageSpec `json:"ipamPlugin,omitempty"` }
SecondaryNetwork describes configuration options for secondary network
type SriovInterface ¶
type SriovInterfaces ¶
type SriovInterfaces []SriovInterface
type SriovNetwork ¶
type SriovNetwork struct { metav1.TypeMeta `json:",inline"` metav1.ObjectMeta `json:"metadata,omitempty"` Spec SriovNetworkSpec `json:"spec,omitempty"` Status SriovNetworkStatus `json:"status,omitempty"` }
SriovNetworkStatus defines the observed state of SriovNetwork
func NewSrioNetwork ¶
func NewSrioNetwork(metaObj metav1.ObjectMeta, spec SriovNetworkSpec) SriovNetwork
func (*SriovNetwork) RenderNetAttDef ¶
func (cr *SriovNetwork) RenderNetAttDef() (*unstructured.Unstructured, error)
RenderNetAttDef renders a net-att-def for sriov CNI
type SriovNetworkNicSelector ¶
type SriovNetworkNicSelector struct { // The vendor hex code of SR-IoV device. Allowed value "8086", "15b3". Vendor string `json:"vendor,omitempty"` // The device hex code of SR-IoV device. Allowed value "0d58", "1572", "158b", "1013", "1015", "1017", "101b". DeviceID string `json:"deviceID,omitempty"` // PCI address of SR-IoV PF. RootDevices []string `json:"rootDevices,omitempty"` // Name of SR-IoV PF. PfNames []string `json:"pfNames,omitempty"` // Infrastructure Networking selection filter. Allowed value "openstack/NetworkID:xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx" NetFilter string `json:"netFilter,omitempty"` }
type SriovNetworkNodePolicy ¶
type SriovNetworkNodePolicy struct { metav1.TypeMeta `json:",inline"` metav1.ObjectMeta `json:"metadata,omitempty"` Spec SriovNetworkNodePolicySpec `json:"spec,omitempty"` Status SriovNetworkNodePolicyStatus `json:"status,omitempty"` }
SriovNetworkNodePolicy is the Schema for the sriovnetworknodepolicies API
func NewSriovNetworkNodePolicy ¶
func NewSriovNetworkNodePolicy(metaObj metav1.ObjectMeta, spec SriovNetworkNodePolicySpec) SriovNetworkNodePolicy
type SriovNetworkNodePolicySpec ¶
type SriovNetworkNodePolicySpec struct { // SRIOV Network device plugin endpoint resource name ResourceName string `json:"resourceName"` // NodeSelector selects the nodes to be configured NodeSelector map[string]string `json:"nodeSelector"` // +kubebuilder:validation:Minimum=0 // +kubebuilder:validation:Maximum=99 // Priority of the policy, higher priority policies can override lower ones. Priority int `json:"priority,omitempty"` // +kubebuilder:validation:Minimum=1 // MTU of VF Mtu int `json:"mtu,omitempty"` // +kubebuilder:validation:Minimum=0 // Number of VFs for each PF NumVfs int `json:"numVfs"` // NicSelector selects the NICs to be configured NicSelector SriovNetworkNicSelector `json:"nicSelector"` // +kubebuilder:validation:Enum=netdevice;vfio-pci // The driver type for configured VFs. Allowed value "netdevice", "vfio-pci". Defaults to netdevice. DeviceType string `json:"deviceType,omitempty"` // RDMA mode. Defaults to false. IsRdma bool `json:"isRdma,omitempty"` // mount vhost-net device. Defaults to false. NeedVhostNet bool `json:"needVhostNet,omitempty"` // +kubebuilder:validation:Enum=eth;ETH;ib;IB // NIC Link Type. Allowed value "eth", "ETH", "ib", and "IB". LinkType string `json:"linkType,omitempty"` // +kubebuilder:validation:Enum=legacy;switchdev // NIC Device Mode. Allowed value "legacy","switchdev". EswitchMode string `json:"eSwitchMode,omitempty"` }
SriovNetworkNodePolicySpec defines the desired state of SriovNetworkNodePolicy
type SriovNetworkNodePolicyStatus ¶
type SriovNetworkNodePolicyStatus struct { }
SriovNetworkNodePolicyStatus defines the observed state of SriovNetworkNodePolicy
type SriovNetworkNodeState ¶
type SriovNetworkNodeState struct { metav1.TypeMeta `json:",inline"` metav1.ObjectMeta `json:"metadata,omitempty"` Spec SriovNetworkNodeStateSpec `json:"spec,omitempty"` Status SriovNetworkNodeStateStatus `json:"status,omitempty"` }
SriovNetworkNodeState is the Schema for the sriovnetworknodestates API
type SriovNetworkNodeStateSpec ¶
type SriovNetworkNodeStateSpec struct { DpConfigVersion string `json:"dpConfigVersion,omitempty"` Interfaces SriovInterfaces `json:"interfaces,omitempty"` }
SriovNetworkNodeStateSpec defines the desired state of SriovNetworkNodeState
type SriovNetworkNodeStateStatus ¶
type SriovNetworkNodeStateStatus struct { Interfaces InterfaceExts `json:"interfaces,omitempty"` SyncStatus string `json:"syncStatus,omitempty"` LastSyncError string `json:"lastSyncError,omitempty"` }
SriovNetworkNodeStateStatus defines the observed state of SriovNetworkNodeState
type SriovNetworkSpec ¶
type SriovNetworkSpec struct { // Namespace of the NetworkAttachmentDefinition custom resource NetworkNamespace string `json:"networkNamespace,omitempty"` // SRIOV Network device plugin endpoint resource name ResourceName string `json:"resourceName"` //Capabilities to be configured for this network. //Capabilities supported: (mac|ips), e.g. '{"mac": true}' Capabilities string `json:"capabilities,omitempty"` //IPAM configuration to be used for this network. IPAM string `json:"ipam,omitempty"` // +kubebuilder:validation:Minimum=0 // +kubebuilder:validation:Maximum=4096 // VLAN ID to assign for the VF. Defaults to 0. Vlan int `json:"vlan,omitempty"` // +kubebuilder:validation:Minimum=0 // +kubebuilder:validation:Maximum=7 // VLAN QoS ID to assign for the VF. Defaults to 0. VlanQoS int `json:"vlanQoS,omitempty"` // VF spoof check, (on|off) // +kubebuilder:validation:Enum={"on","off"} SpoofChk string `json:"spoofChk,omitempty"` // VF trust mode (on|off) // +kubebuilder:validation:Enum={"on","off"} Trust string `json:"trust,omitempty"` // VF link state (enable|disable|auto) // +kubebuilder:validation:Enum={"auto","enable","disable"} LinkState string `json:"linkState,omitempty"` // +kubebuilder:validation:Minimum=0 // Minimum tx rate, in Mbps, for the VF. Defaults to 0 (no rate limiting). min_tx_rate should be <= max_tx_rate. MinTxRate *int `json:"minTxRate,omitempty"` // +kubebuilder:validation:Minimum=0 // Maximum tx rate, in Mbps, for the VF. Defaults to 0 (no rate limiting) MaxTxRate *int `json:"maxTxRate,omitempty"` // MetaPluginsConfig configuration to be used in order to chain metaplugins to the sriov interface returned // by the operator. MetaPluginsConfig string `json:"metaPlugins,omitempty"` }
SriovNetworkSpec defines the desired state of SriovNetwork
type SriovNetworkStatus ¶
type SriovNetworkStatus struct { }
SriovNetworkStatus defines the observed state of SriovNetwork
type SriovPlugin ¶
type SriovPlugin struct { SriovNetworkHandler *DynamicHandler SriovNetworkNodePolicyHandler *DynamicHandler SriovNetworkNodeStateHandler *DynamicHandler }
func (*SriovPlugin) CleanUp ¶
func (p *SriovPlugin) CleanUp(net multinicv1.MultiNicNetwork) error
func (*SriovPlugin) GetConfig ¶
func (p *SriovPlugin) GetConfig(net multinicv1.MultiNicNetwork, hifList map[string]multinicv1.HostInterface) (string, map[string]string, error)
func (*SriovPlugin) SriovnetworkName ¶
func (p *SriovPlugin) SriovnetworkName(name string) string
type VirtualFunction ¶
type VirtualFunction struct { Name string `json:"name,omitempty"` Mac string `json:"mac,omitempty"` Assigned string `json:"assigned,omitempty"` Driver string `json:"driver,omitempty"` PciAddress string `json:"pciAddress"` Vendor string `json:"vendor,omitempty"` DeviceID string `json:"deviceID,omitempty"` Vlan int `json:"Vlan,omitempty"` Mtu int `json:"mtu,omitempty"` VfID int `json:"vfID"` }
type WaitForCompletionSpec ¶
type WaitForCompletionSpec struct { // PodSelector specifies a label selector for the pods to wait for completion // For more details on label selectors, see: // https://kubernetes.io/docs/concepts/overview/working-with-objects/labels/#label-selectors // +optional PodSelector string `json:"podSelector,omitempty"` // TimeoutSecond specifies the length of time in seconds // to wait before giving up on pod termination, zero means infinite // +optional // +kubebuilder:default:=0 // +kubebuilder:validation:Minimum:=0 TimeoutSecond int `json:"timeoutSeconds,omitempty"` }
WaitForCompletionSpec describes the configuration for waiting on job completions