Documentation
¶
Index ¶
- Variables
- type APIServer
- type Options
- type PodSetPlanner
- func (p *PodSetPlanner) BuildPlan(parentCtx context.Context, podSetHandler *podSetHandlerImpl, podList []*v1.Pod, ...) (map[string]string, error)
- func (p *PodSetPlanner) BuildSchedulePlan(parentCtx context.Context, namespace, podSet string, scheduledPod string, ...) (map[string]string, error)
- func (p *PodSetPlanner) FindNodeLister(node string) (*v1.Node, error)
- func (p *PodSetPlanner) GetNodeName(pod *v1.Pod) (string, error)
- func (p *PodSetPlanner) Stop()
Constants ¶
This section is empty.
Variables ¶
View Source
var ( // ErrNotFound is returned when a resource is not found. ErrNotFound = errors.New("not-found") // ErrNoNodesFound returned when no elible nodes are found for pod. ErrNoNodesFound = errors.New("no eligible nodes found") // ErrPodNotAssigned returned when a pod has net yet been assigned to // a node. ErrPodNotAssigned = errors.New("pod-not-assigned") // ErrEmptyPriorityList returned when no node scores are found to select a // node for the pod. ErrEmptyPriorityList = errors.New("empty-priority-list") )
Functions ¶
This section is empty.
Types ¶
type APIServer ¶
type APIServer struct { Listen string Log logr.Logger Planner *PodSetPlanner api.UnimplementedSchedulePlannerServer }
APIServer Structure anchor for the implementation of the telemetry API server.
func (*APIServer) BuildSchedulePlan ¶
func (a *APIServer) BuildSchedulePlan(ctx context.Context, in *api.SchedulePlanRequest, ) (*api.SchedulePlanResponse, error)
BuildSchedulePlan builds a schedule plan based on the podset for the namespace.
type PodSetPlanner ¶
PodSetPlanner stores the info related to podset planning.
func NewPlanner ¶
func NewPlanner(options Options, clientset *kubernetes.Clientset, plannerClient *client.SchedulePlannerClient, log logr.Logger) (*PodSetPlanner, error)
NewPlanner is used to instantate a podset planner.
func (*PodSetPlanner) BuildPlan ¶
func (p *PodSetPlanner) BuildPlan(parentCtx context.Context, podSetHandler *podSetHandlerImpl, podList []*v1.Pod, schedulingMap map[ktypes.NamespacedName]*podPlannerInfo) (map[string]string, error)
BuildPlan builds the plan for podsets with pod to node assignment map.
func (*PodSetPlanner) BuildSchedulePlan ¶
func (p *PodSetPlanner) BuildSchedulePlan(parentCtx context.Context, namespace, podSet string, scheduledPod string, eligibleNodes []string) (map[string]string, error, )
BuildSchedulePlan builds a schedule plan for the podset and returns an assignment map containing pod to node assignments.
func (*PodSetPlanner) FindNodeLister ¶
func (p *PodSetPlanner) FindNodeLister(node string) (*v1.Node, error)
FindNodeLister finds an node reference from the lister cache.
func (*PodSetPlanner) GetNodeName ¶
func (p *PodSetPlanner) GetNodeName(pod *v1.Pod) (string, error)
GetNodeName returns the nodename for the given pod.
Click to show internal directories.
Click to hide internal directories.