framework

package
v0.29.0 Latest Latest
Warning

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

Go to latest
Published: Jan 22, 2024 License: Apache-2.0 Imports: 33 Imported by: 1

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

Types

type ClusterCapacity

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

func New

func New(kubeSchedulerConfig *schedconfig.CompletedConfig, kubeConfig *restclient.Config, simulatedPod *v1.Pod, maxPods int, excludeNodes []string) (*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) Close

func (c *ClusterCapacity) Close()

func (*ClusterCapacity) Report

func (*ClusterCapacity) Run

func (c *ClusterCapacity) Run() error

func (*ClusterCapacity) ScheduledPods added in v0.23.0

func (c *ClusterCapacity) ScheduledPods() []*v1.Pod

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 PodGenerator added in v0.23.0

type PodGenerator interface {
	Generate() *v1.Pod
}

func NewSinglePodGenerator added in v0.23.0

func NewSinglePodGenerator(podTemplate *v1.Pod) PodGenerator

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
plugins

Jump to

Keyboard shortcuts

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