mounter

package
v0.0.0-...-a6dd246 Latest Latest
Warning

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

Go to latest
Published: Apr 22, 2025 License: Apache-2.0 Imports: 28 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CheckMountDeviceRequest

func CheckMountDeviceRequest(req *api.MountDeviceRequest) error

CheckMountDeviceRequest Check if the device request is legitimate.

func CheckPodContainer

func CheckPodContainer(pod *v1.Pod, cont *api.Container) (*api.Container, error)

CheckPodContainer Check if the target container exists in the pod.

func CheckPodContainerStatus

func CheckPodContainerStatus(pod *v1.Pod, cont *api.Container) error

CheckPodContainerStatus Check if the specified container status is normal

func CheckUnMountDeviceRequest

func CheckUnMountDeviceRequest(req *api.UnMountDeviceRequest) error

func GarbageCollectionPods

func GarbageCollectionPods(kubeClient *kubernetes.Clientset, objKeys []api.ObjectKey) []api.ObjectKey

GarbageCollectionPods Batch delete pods

func Owner

func Owner(pod *v1.Pod, controller bool) []metav1.OwnerReference

func WaitSupportPodsReady

func WaitSupportPodsReady(ctx context.Context, podLister listerv1.PodLister,
	kubeClient *kubernetes.Clientset, deviceMounter framework.DeviceMounter,
	slavePodKeys []api.ObjectKey) ([]*v1.Pod, []*v1.Pod, error)

WaitSupportPodsReady Waiting for the status of the created pods to be ready.

Types

type DeviceMounterServer

type DeviceMounterServer struct {
	api.UnimplementedDeviceMountServiceServer
	// contains filtered or unexported fields
}

func NewDeviceMounterServer

func NewDeviceMounterServer(
	nodeName string, kubeClient *kubernetes.Clientset,
	podLister listerv1.PodLister, nodeLister listerv1.NodeLister,
	recorder record.EventRecorder) *DeviceMounterServer

func (*DeviceMounterServer) CreateDeviceFiles

func (s *DeviceMounterServer) CreateDeviceFiles(cfg *util.Config, devInfos []api.DeviceInfo) (func() error, error)

func (*DeviceMounterServer) CreatePodDisruptionBudget

func (s *DeviceMounterServer) CreatePodDisruptionBudget(ctx context.Context, ownerPod *v1.Pod) (*policyv1.PodDisruptionBudget, error)

func (*DeviceMounterServer) DeleteDeviceFiles

func (s *DeviceMounterServer) DeleteDeviceFiles(cfg *util.Config, devInfos []api.DeviceInfo) (func() error, error)

func (*DeviceMounterServer) DeviceRuleSetFunc

func (s *DeviceMounterServer) DeviceRuleSetFunc(cgroupPath string, r *configs.Resources) (closed func() error, rollback func() error, err error)

func (*DeviceMounterServer) GetCGroupPath

func (s *DeviceMounterServer) GetCGroupPath(pod *v1.Pod, container *api.Container) (string, error)

func (*DeviceMounterServer) GetContainerCGroupPathAndPids

func (s *DeviceMounterServer) GetContainerCGroupPathAndPids(pod *v1.Pod, container *api.Container) ([]int, string, error)

func (*DeviceMounterServer) GetSlavePods

func (s *DeviceMounterServer) GetSlavePods(devType string, ownerPod *v1.Pod, container *api.Container) ([]*v1.Pod, error)

func (*DeviceMounterServer) GetTargetPod

func (s *DeviceMounterServer) GetTargetPod(ctx context.Context, name, namespace string) (*v1.Pod, error)

func (*DeviceMounterServer) MountDevice

func (s *DeviceMounterServer) MountDevice(ctx context.Context, req *api.MountDeviceRequest) (resp *api.DeviceResponse, err error)

func (*DeviceMounterServer) MutationPodFunc

func (s *DeviceMounterServer) MutationPodFunc(devType string, container *api.Container, ownerPod, mutaPod *v1.Pod)

func (*DeviceMounterServer) PatchPod

func (s *DeviceMounterServer) PatchPod(pod *v1.Pod, patches []string) (*v1.Pod, error)

func (*DeviceMounterServer) UnMountDevice

func (s *DeviceMounterServer) UnMountDevice(ctx context.Context, req *api.UnMountDeviceRequest) (resp *api.DeviceResponse, err error)

Jump to

Keyboard shortcuts

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