Documentation
¶
Index ¶
- type LinuxDevice
- type NetworkDriver
- func (np *NetworkDriver) CreateContainer(ctx context.Context, pod *api.PodSandbox, ctr *api.Container) (*api.ContainerAdjustment, []*api.ContainerUpdate, error)
- func (np *NetworkDriver) HandleError(ctx context.Context, err error, msg string)
- func (np *NetworkDriver) PrepareResourceClaims(ctx context.Context, claims []*resourceapi.ResourceClaim) (map[types.UID]kubeletplugin.PrepareResult, error)
- func (np *NetworkDriver) PublishResources(ctx context.Context)
- func (np *NetworkDriver) RemovePodSandbox(ctx context.Context, pod *api.PodSandbox) error
- func (np *NetworkDriver) RunPodSandbox(ctx context.Context, pod *api.PodSandbox) error
- func (np *NetworkDriver) Shutdown(_ context.Context)
- func (np *NetworkDriver) Stop()
- func (np *NetworkDriver) StopPodSandbox(ctx context.Context, pod *api.PodSandbox) error
- func (np *NetworkDriver) Synchronize(_ context.Context, pods []*api.PodSandbox, containers []*api.Container) ([]*api.ContainerUpdate, error)
- func (np *NetworkDriver) UnprepareResourceClaims(ctx context.Context, claims []kubeletplugin.NamespacedObject) (map[types.UID]error, error)
- type OffloadFlagDefinition
- type Option
- type PodConfig
- type PodConfigStore
- func (s *PodConfigStore) DeleteClaim(claim types.NamespacedName)
- func (s *PodConfigStore) DeletePod(podUID types.UID)
- func (s *PodConfigStore) Get(podUID types.UID, deviceName string) (PodConfig, bool)
- func (s *PodConfigStore) GetPodConfigs(podUID types.UID) (map[string]PodConfig, bool)
- func (s *PodConfigStore) Set(podUID types.UID, deviceName string, config PodConfig)
- type RDMAConfig
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type LinuxDevice ¶ added in v0.4.0
type LinuxDevice struct {
Path string
Type string
Major int64
Minor int64
FileMode uint32
UID uint32
GID uint32
}
func GetDeviceInfo ¶ added in v0.4.0
func GetDeviceInfo(path string) (LinuxDevice, error)
GetDeviceInfo retrieves device type, major, and minor numbers for a given path. It returns an error if the path does not exist or if it's not a device file.
type NetworkDriver ¶
type NetworkDriver struct {
// contains filtered or unexported fields
}
func Start ¶
func Start(ctx context.Context, driverName string, kubeClient kubernetes.Interface, nodeName string, opts ...Option) (*NetworkDriver, error)
func (*NetworkDriver) CreateContainer ¶ added in v0.4.0
func (np *NetworkDriver) CreateContainer(ctx context.Context, pod *api.PodSandbox, ctr *api.Container) (*api.ContainerAdjustment, []*api.ContainerUpdate, error)
CreateContainer handles container creation requests.
func (*NetworkDriver) HandleError ¶ added in v0.7.0
func (np *NetworkDriver) HandleError(ctx context.Context, err error, msg string)
func (*NetworkDriver) PrepareResourceClaims ¶ added in v0.4.0
func (np *NetworkDriver) PrepareResourceClaims(ctx context.Context, claims []*resourceapi.ResourceClaim) (map[types.UID]kubeletplugin.PrepareResult, error)
func (*NetworkDriver) PublishResources ¶
func (np *NetworkDriver) PublishResources(ctx context.Context)
func (*NetworkDriver) RemovePodSandbox ¶
func (np *NetworkDriver) RemovePodSandbox(ctx context.Context, pod *api.PodSandbox) error
func (*NetworkDriver) RunPodSandbox ¶
func (np *NetworkDriver) RunPodSandbox(ctx context.Context, pod *api.PodSandbox) error
func (*NetworkDriver) Shutdown ¶
func (np *NetworkDriver) Shutdown(_ context.Context)
func (*NetworkDriver) Stop ¶
func (np *NetworkDriver) Stop()
func (*NetworkDriver) StopPodSandbox ¶
func (np *NetworkDriver) StopPodSandbox(ctx context.Context, pod *api.PodSandbox) error
StopPodSandbox tries to move back the devices to the rootnamespace but does not fail to avoid disrupting the pod shutdown. The kernel will do the cleanup once the namespace is deleted.
func (*NetworkDriver) Synchronize ¶
func (np *NetworkDriver) Synchronize(_ context.Context, pods []*api.PodSandbox, containers []*api.Container) ([]*api.ContainerUpdate, error)
func (*NetworkDriver) UnprepareResourceClaims ¶ added in v0.4.0
func (np *NetworkDriver) UnprepareResourceClaims(ctx context.Context, claims []kubeletplugin.NamespacedObject) (map[types.UID]error, error)
type OffloadFlagDefinition ¶ added in v0.5.0
off_flag_def https://git.kernel.org/pub/scm/network/ethtool/ethtool.git/tree/common.c#n51 OffloadFlagDefinition is the Go equivalent of the C struct off_flag_def. We keep this struct as the source of truth for building the map.
type Option ¶
type Option func(*NetworkDriver)
func WithInventory ¶ added in v0.9.0
func WithInventory(db inventoryDB) Option
WithInventory sets the inventory database for the driver.
type PodConfig ¶ added in v0.4.0
type PodConfig struct {
Claim types.NamespacedName
// NetworkInterfaceConfigInHost is the config of the network interface as
// seen in the host's network namespace BEFORE it was moved to the pod's
// network namespace.
NetworkInterfaceConfigInHost apis.NetworkConfig
// NetworkInterfaceConfigInPod contains all network-related configurations
// (interface, routes, ethtool, sysctl) to be applied for this device in the
// Pod's namespace.
NetworkInterfaceConfigInPod apis.NetworkConfig
// RDMADevice holds RDMA-specific configurations if the network device
// has associated RDMA capabilities.
RDMADevice RDMAConfig
}
PodConfig holds the set of configurations to be applied for a single network device allocated to a Pod. This includes network interface settings, routes for the Pod's network namespace, and RDMA configurations.
type PodConfigStore ¶ added in v0.4.0
type PodConfigStore struct {
// contains filtered or unexported fields
}
PodConfigStore provides a thread-safe, centralized store for all network device configurations across multiple Pods. It is indexed by the Pod's UID, and for each Pod, it maps network device names (as allocated) to their specific Config.
func NewPodConfigStore ¶ added in v0.4.0
func NewPodConfigStore() *PodConfigStore
NewPodConfigStore creates and returns a new instance of PodConfigStore.
func (*PodConfigStore) DeleteClaim ¶ added in v0.4.0
func (s *PodConfigStore) DeleteClaim(claim types.NamespacedName)
DeleteClaim removes all configurations associated with a given claim.
func (*PodConfigStore) DeletePod ¶ added in v0.4.0
func (s *PodConfigStore) DeletePod(podUID types.UID)
DeletePod removes all configurations associated with a given Pod UID.
func (*PodConfigStore) Get ¶ added in v0.4.0
Get retrieves the configuration for a specific device under a given Pod UID. It returns the Config and true if found, otherwise an empty Config and false.
func (*PodConfigStore) GetPodConfigs ¶ added in v0.4.0
GetPodConfigs retrieves all device configurations for a given Pod UID. It is indexed by the Pod's UID, and for each Pod, it maps network device names (as allocated) to their specific Config.
type RDMAConfig ¶ added in v0.4.0
type RDMAConfig struct {
// LinkDev is the name of the RDMA link device (e.g., "mlx5_0") that
// corresponds to the allocated network device.
LinkDev string
// DevChars is a list of user-space RDMA character
// devices (e.g., "/dev/infiniband/uverbs0", "/dev/infiniband/rdma_cm")
// that should be made available to the Pod.
DevChars []LinuxDevice
}
RDMAConfig contains parameters for setting up an RDMA device associated with a network interface.