plugin

package
v0.0.0-...-dd03940 Latest Latest
Warning

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

Go to latest
Published: Apr 21, 2026 License: Apache-2.0 Imports: 20 Imported by: 0

Documentation

Index

Constants

View Source
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"
)
View Source
const (
	MELLANOX_API_VERSION  = "mellanox.com/v1alpha1"
	MELLANOX_NETWORK_KIND = "HostDeviceNetwork"
	MELLANOX_POLICY_KIND  = "NicClusterPolicy"
)
View Source
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"
)
View Source
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"
)
View Source
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 ////////////////////////////////////////

View Source
const (
	RESOURCE_ANNOTATION = "k8s.v1.cni.cncf.io/resourceName"
	HOLDER_SUFFIX       = "-net"
)
View Source
const (
	AUTO_GEN_LABEL = "multi-nic-cni-generated"
)
View Source
const (
	AWS_IPVLAN_TYPE = "aws-ipvlan"
)
View Source
const (
	IPVLAN_TYPE = "ipvlan"
)
View Source
const (
	MACVLAN_TYPE = "macvlan"
)

Variables

View Source
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 GetCombinedResourceNames

func GetCombinedResourceNames(rs []SrIoVResource) string

GetCombinedResourceNames returns string joining SrIoVResource annotation list with comma

func GetHolderNetName

func GetHolderNetName(name string) string

func GetMetaObject

func GetMetaObject(name string, namespace string, annotations map[string]string) metav1.ObjectMeta

func RemoveEmpty

func RemoveEmpty(args map[string]string, pluginStr string) string

RemoveEmpty constructs a new config string based on netConfKeys and valid argument list.

func ValidateResourceName

func ValidateResourceName(name string) string

Types

type AWSIPVLANNetConf

type AWSIPVLANNetConf struct {
	types.NetConf
	PrimaryIP map[string]interface{} `json:"primaryIP"`
	PodIP     string                 `json:"podIP"`
	Master    string                 `json:"master"`
	Mode      string                 `json:"mode"`
	MTU       int                    `json:"mtu"`
}

type AwsVpcCNIPlugin

type AwsVpcCNIPlugin struct {
}

func (*AwsVpcCNIPlugin) CleanUp

func (*AwsVpcCNIPlugin) GetConfig

func (*AwsVpcCNIPlugin) Init

func (p *AwsVpcCNIPlugin) Init(config *rest.Config) 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 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 (*IPVLANPlugin) Init

func (p *IPVLANPlugin) Init(config *rest.Config) error

type IPVLANTypeNetConf

type IPVLANTypeNetConf struct {
	types.NetConf
	Master string `json:"master"`
	Mode   string `json:"mode"`
	MTU    int    `json:"mtu"`
}

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

type ImageSpecWithConfig struct {
	ImageSpec `json:""`
	Config    *string `json:"config,omitempty"`
}

ImageSpecWithConfig Contains ImageSpec and optional configuration

type InterfaceExt

type InterfaceExt struct {
	// Name is the name of the interface
	Name string `json:"name,omitempty"`
	// PciAddress is the PCI address of the interface
	PciAddress string `json:"pciAddress,omitempty"`
}

InterfaceExt represents an SR-IOV interface with extended information

type MACVLANPlugin

type MACVLANPlugin struct {
}

func (*MACVLANPlugin) CleanUp

func (*MACVLANPlugin) GetConfig

func (*MACVLANPlugin) Init

func (p *MACVLANPlugin) Init(config *rest.Config) error

type MACVLANTypeNetConf

type MACVLANTypeNetConf struct {
	types.NetConf
	Master string `json:"master"` // Name of the master interfce (e.g., eth0)
	Mode   string `json:"mode"`   // Mod of the macvlan interface (e.g., bridge, private)
	MTU    int    `json:"mtu"`
}

type MellanoxPlugin

type MellanoxPlugin struct {
	MellanoxNetworkHandler          *DynamicHandler
	MellanoxNicClusterPolicyHandler *DynamicHandler
}

func (*MellanoxPlugin) CleanUp

func (*MellanoxPlugin) GetConfig

func (*MellanoxPlugin) GetSrIoVResources

func (p *MellanoxPlugin) GetSrIoVResources() (rs []SrIoVResource)

return list of SrIoVResource found in SriovDevicePlugin

func (*MellanoxPlugin) Init

func (p *MellanoxPlugin) Init(config *rest.Config) error

type MultusSpec

type MultusSpec struct {
	ImageSpecWithConfig `json:""`
}

MultusSpec describes configuration options for Multus CNI

  1. Image information for Multus CNI
  2. 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
	Scheme *runtime.Scheme
}

func GetNetAttachDefHandler

func GetNetAttachDefHandler(config *rest.Config, scheme *runtime.Scheme) (*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 (*NetAttachDefHandler) Get

Get returns NetworkAttachmentDefinition object from name and namespace

func (*NetAttachDefHandler) IsExist

func (h *NetAttachDefHandler) IsExist(name string, namespace string) bool

IsExist checks if the NetworkAttachmentDefinition exist 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 NetworkStatus struct {
	Name      string    `json:"name"`
	Interface string    `json:"interface,omitempty"`
	IPs       []string  `json:"ips,omitempty"`
	Mac       string    `json:"mac,omitempty"`
	Default   bool      `json:"default,omitempty"`
	DNS       types.DNS `json:"dns,omitempty"`
}

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"`
	RdmaSharedDevicePlugin *DevicePluginSpec     `json:"rdmaSharedDevicePlugin,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 PodProbeSpec struct {
	InitialDelaySeconds int `json:"initialDelaySeconds"`
	PeriodSeconds       int `json:"periodSeconds"`
}

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 SrIoVResource

type SrIoVResource struct {
	Prefix       string
	ResourceName string
}

SrIoVResource defines prefix and resource of resource from sriov plugin

func GetSrIoVResource

func GetSrIoVResource(resourceMap map[string]interface{}) *SrIoVResource

GetSrIoVResource returns SrIoVResource from item in resourceList

func GetSrIoVResourcesFromSrIoVPlugin

func GetSrIoVResourcesFromSrIoVPlugin(sriovPlugin *DevicePluginSpec) (rs []SrIoVResource, err error)

func (SrIoVResource) GetAnnotation

func (r SrIoVResource) GetAnnotation() string

GetAnnotation returns prefix/resourceName

func (SrIoVResource) Valid

func (r SrIoVResource) Valid() bool

Valid checks if resourceName has value.

type SriovInterface

type SriovInterface struct {
	PciAddress string    `json:"pciAddress"`
	NumVfs     int       `json:"numVfs,omitempty"`
	Mtu        int       `json:"mtu,omitempty"`
	Name       string    `json:"name,omitempty"`
	LinkType   string    `json:"linkType,omitempty"`
	VfGroups   []VfGroup `json:"vfGroups,omitempty"`
}

type SriovNetConf

type SriovNetConf struct {
	types.NetConf
	Vlan      int   `json:"vlan,omitempty"`
	VlanQoS   int   `json:"vlanQoS,omitempty"`
	SpoofChk  *bool `json:"spoofchk,omitempty"`
	Trust     *bool `json:"trust,omitempty"`
	MinTxRate *int  `json:"min_tx_rate,omitempty"`
	MaxTxRate *int  `json:"max_tx_rate,omitempty"`
}

SriovNetConf represents SR-IOV CNI configuration for multi-nic wrapper mode

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

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

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 represents the node state for SR-IOV networks

type SriovNetworkNodeStateSpec

type SriovNetworkNodeStateSpec struct {
	// NodeSelector selects the nodes to be configured
	NodeSelector map[string]string `json:"nodeSelector,omitempty"`
}

SriovNetworkNodeStateSpec defines the desired state of SriovNetworkNodeState

type SriovNetworkNodeStateStatus

type SriovNetworkNodeStateStatus struct {
	// Interfaces represents the list of SR-IOV capable interfaces on the node
	Interfaces []InterfaceExt `json:"interfaces,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 (*SriovPlugin) Init

func (p *SriovPlugin) Init(config *rest.Config) error

func (*SriovPlugin) SriovnetworkName

func (p *SriovPlugin) SriovnetworkName(name string) string

type VfGroup

type VfGroup struct {
	ResourceName string `json:"resourceName,omitempty"`
	DeviceType   string `json:"deviceType,omitempty"`
	VfRange      string `json:"vfRange,omitempty"`
	PolicyName   string `json:"policyName,omitempty"`
}

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

Jump to

Keyboard shortcuts

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