framework

package
v0.19.0 Latest Latest
Warning

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

Go to latest
Published: Feb 3, 2021 License: Apache-2.0 Imports: 27 Imported by: 0

Documentation

Index

Constants

View Source
const (
	ResourceNvidiaGPU v1.ResourceName = "nvdia.com/gpu"
)

Variables

This section is empty.

Functions

func ClusterCapacityReviewPrint

func ClusterCapacityReviewPrint(r *ClusterCapacityReview, verbose bool, format string) error

func InitKubeSchedulerConfiguration added in v0.5.0

func InitKubeSchedulerConfiguration(opts *schedoptions.Options) (*schedconfig.CompletedConfig, error)

Types

type ClusterCapacity

type ClusterCapacity struct {
	// contains filtered or unexported fields
}

func New

func New(kubeSchedulerConfig *schedconfig.CompletedConfig, simulatedPod *v1.Pod, maxPods int) (*ClusterCapacity, error)

Create new cluster capacity analysis The analysis is completely independent of apiserver so no need for kubeconfig nor for apiserver url

func (*ClusterCapacity) Bind

func (c *ClusterCapacity) Bind(ctx context.Context, state *framework.CycleState, p *v1.Pod, nodeName string, schedulerName string) *framework.Status

func (*ClusterCapacity) Close

func (c *ClusterCapacity) Close()

func (*ClusterCapacity) NewBindPlugin added in v0.18.0

func (c *ClusterCapacity) NewBindPlugin(schedulerName string, configuration runtime.Object, f framework.FrameworkHandle) (framework.Plugin, error)

func (*ClusterCapacity) Report

func (*ClusterCapacity) Run

func (c *ClusterCapacity) Run() error

func (*ClusterCapacity) SyncWithClient

func (c *ClusterCapacity) SyncWithClient(client externalclientset.Interface) error

func (*ClusterCapacity) Update

func (c *ClusterCapacity) Update(pod *v1.Pod, podCondition *v1.PodCondition, schedulerName string) error

type ClusterCapacityReview

type ClusterCapacityReview struct {
	metav1.TypeMeta
	Spec   ClusterCapacityReviewSpec   `json:"spec"`
	Status ClusterCapacityReviewStatus `json:"status"`
}

func GetReport

func GetReport(pods []*v1.Pod, status Status) *ClusterCapacityReview

type ClusterCapacityReviewResult

type ClusterCapacityReviewResult struct {
	PodName string `json:"podName"`
	// numbers of replicas on nodes
	ReplicasOnNodes []*ReplicasOnNode `json:"replicasOnNodes"`
	// reason why no more pods could schedule (if any on this node)
	FailSummary []FailReasonSummary `json:"failSummary"`
}

type ClusterCapacityReviewScheduleFailReason

type ClusterCapacityReviewScheduleFailReason struct {
	FailType    string `json:"failType"`
	FailMessage string `json:"failMessage"`
}

type ClusterCapacityReviewSpec

type ClusterCapacityReviewSpec struct {
	// the pod desired for scheduling
	Templates []v1.Pod `json:"templates"`

	// desired number of replicas that should be scheduled
	// +optional
	Replicas int32 `json:"replicas"`

	PodRequirements []*Requirements `json:"podRequirements"`
}

type ClusterCapacityReviewStatus

type ClusterCapacityReviewStatus struct {
	CreationTimestamp time.Time `json:"creationTimestamp"`
	// actual number of replicas that could schedule
	Replicas int32 `json:"replicas"`

	FailReason *ClusterCapacityReviewScheduleFailReason `json:"failReason"`

	// per node information about the scheduling simulation
	Pods []*ClusterCapacityReviewResult `json:"pods"`
}

type FailReasonSummary

type FailReasonSummary struct {
	Reason string `json:"reason"`
	Count  int    `json:"count"`
}

type ReplicasOnNode

type ReplicasOnNode struct {
	NodeName string `json:"nodeName"`
	Replicas int    `json:"replicas"`
}

type Requirements

type Requirements struct {
	PodName       string            `json:"podName"`
	Resources     *Resources        `json:"resources"`
	NodeSelectors map[string]string `json:"nodeSelectors"`
}

type Resources

type Resources struct {
	PrimaryResources v1.ResourceList           `json:"primaryResources"`
	ScalarResources  map[v1.ResourceName]int64 `json:"scalarResources"`
}

type Status

type Status struct {
	Pods       []*v1.Pod
	StopReason string
}

capture all scheduled pods with reason why the analysis could not continue

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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