Documentation ¶
Index ¶
- Constants
- func SchedulerEmulatorReviewPrettyPrint(r *SchedulerEmulatorReview, verbose bool)
- func SchedulerEmulatorReviewPrint(r *SchedulerEmulatorReview, verbose bool, format string) error
- func SchedulerEmulatorReviewPrintJson(r *SchedulerEmulatorReview) error
- func SchedulerEmulatorReviewPrintYaml(r *SchedulerEmulatorReview) error
- type AccessSwitch
- type AccessSwitchSpec
- type AccessSwitchStatus
- type AddNodesEmulator
- type AppsEmulator
- type DeleteNodesEmulator
- type DeprecatedAppsEmulator
- type DeprecatedPredictionEmulator
- type EmulatorReport
- type FailReasonSummary
- type HorizontalEmulator
- type JobReport
- type Kubesim
- func (ks *Kubesim) AddNodes(nodeConfig *utils.NodeConfig) (map[string][]string, *utils.NodeInfoList, error)
- func (ks *Kubesim) Bind(ctx context.Context, state *framework.CycleState, p *v1.Pod, nodeName string, ...) *framework.Status
- func (ks *Kubesim) CSIDriverWatch(client externalclientset.Interface) error
- func (ks *Kubesim) CSINodeWatch(client externalclientset.Interface) error
- func (ks *Kubesim) CleanPendingPod(pod *v1.Pod) error
- func (ks *Kubesim) CleanPod() error
- func (ks *Kubesim) CleanStatusPods()
- func (ks *Kubesim) Close()
- func (ks *Kubesim) CreateApps(appgroup *utils.AppGroup, key string) (*SchedulerPrediction, error)
- func (ks *Kubesim) CreateAppsPod(pod *v1.Pod) error
- func (ks *Kubesim) CreateFakeNode(nodeConfig *utils.NodeConfig, predictionNode int) (map[string][]string, error)
- func (ks *Kubesim) DeleteAppsPod(namespace, name string) error
- func (ks *Kubesim) DeleteNodes() error
- func (ks *Kubesim) GetAppPod(namespace, label string) ([]v1.Pod, error)
- func (se *Kubesim) GetAppsPod(podsConfig *utils.PodsConfig) ([]*v1.Pod, []*v1.Pod)
- func (ks *Kubesim) GetNodeInfo() (*[]utils.NodeInfo, error)
- func (se *Kubesim) GetPod(name, namespace string) (*v1.Pod, error)
- func (ks *Kubesim) HorizontalEmulator(appgroup *utils.AppGroup, key string) (*SchedulerEmulatorReviewList, error)
- func (ks *Kubesim) ListNodes() (*utils.NodeInfoList, error)
- func (ks *Kubesim) NewBindPlugin(schedulerName string, configuration runtime.Object, f framework.Handle) (framework.Plugin, error)
- func (ks *Kubesim) NodeWatch(client externalclientset.Interface) error
- func (ks *Kubesim) PVCWatch(client externalclientset.Interface) error
- func (ks *Kubesim) PVWatch(client externalclientset.Interface) error
- func (ks *Kubesim) PodWatch(client externalclientset.Interface) error
- func (ks *Kubesim) PredictionEmulator(appgroup *utils.AppGroup, key string) (*SchedulerEmulatorReviewList, error)
- func (ks *Kubesim) Report() *SchedulerEmulatorReview
- func (ks *Kubesim) Run() error
- func (ks *Kubesim) SavePrediction(access map[string][]string, key string, minNode, maxNode, predictionNode int, ...)
- func (ks *Kubesim) SchedulerPod() error
- func (ks *Kubesim) StorageClassWatch(client externalclientset.Interface) error
- func (ks *Kubesim) SyncWithClient(client externalclientset.Interface) error
- func (ks *Kubesim) Update(pod *v1.Pod, podCondition *v1.PodCondition, schedulerName string) error
- func (ks *Kubesim) UpdatePodRequest(pod *v1.Pod, replicas int32) *Kubesim
- func (ks *Kubesim) VerticalEmulator(appgroup *utils.AppGroup, key string) (*SchedulerEmulatorReviewList, error)
- func (ks *Kubesim) VolumeAttachmentsWatch(client externalclientset.Interface) error
- type ListNodeInfoEmulator
- type ListNodesEmulator
- type PredictionEmulator
- type PredictionNodeReview
- type ReplicasOnNode
- type Requirements
- type Resources
- type SchedulerEmulatorReview
- type SchedulerEmulatorReviewList
- type SchedulerEmulatorReviewResult
- type SchedulerEmulatorReviewScheduleFailReason
- type SchedulerEmulatorReviewSpec
- type SchedulerEmulatorReviewStatus
- type SchedulerPrediction
- type Status
- type VerticalEmulator
Constants ¶
View Source
const ( JobQueuing = "queuing" JobProcessing = "processing" JobSucceed = "succeed" JobFailed = "failed" JobStopped = "stopped" )
View Source
const (
ResourceNvidiaGPU v1.ResourceName = "nvdia.com/gpu"
)
Variables ¶
This section is empty.
Functions ¶
func SchedulerEmulatorReviewPrettyPrint ¶
func SchedulerEmulatorReviewPrettyPrint(r *SchedulerEmulatorReview, verbose bool)
func SchedulerEmulatorReviewPrint ¶
func SchedulerEmulatorReviewPrint(r *SchedulerEmulatorReview, verbose bool, format string) error
func SchedulerEmulatorReviewPrintJson ¶
func SchedulerEmulatorReviewPrintJson(r *SchedulerEmulatorReview) error
func SchedulerEmulatorReviewPrintYaml ¶
func SchedulerEmulatorReviewPrintYaml(r *SchedulerEmulatorReview) error
Types ¶
type AccessSwitch ¶
type AccessSwitchSpec ¶
type AccessSwitchStatus ¶
type AccessSwitchStatus struct { PredictionNode int32 `json:"predictionNode"` NetType string `json:"netType"` Access []*AccessSwitch `json:"access"` }
type AddNodesEmulator ¶
type AddNodesEmulator struct { Name string Func func(nodeConfig *utils.NodeConfig, ks *Kubesim) (*utils.NodeInfoList, error) // contains filtered or unexported fields }
func NewAddNodesEmulator ¶
func NewAddNodesEmulator(clientset clientset.Interface, ks *Kubesim) *AddNodesEmulator
func (AddNodesEmulator) AddNodesHandler ¶
func (e AddNodesEmulator) AddNodesHandler(nodeConfig *utils.NodeConfig) (*utils.NodeInfoList, error)
type AppsEmulator ¶
type AppsEmulator struct { Name string Func func(nodes []utils.NodeConfig, apps utils.MutiAppsRequest, ks *Kubesim) *utils.SimulatorJob // contains filtered or unexported fields }
func NewAppsEmulator ¶
func NewAppsEmulator(clientset clientset.Interface, ks *Kubesim) *AppsEmulator
func (AppsEmulator) AppsHandler ¶
func (e AppsEmulator) AppsHandler(nodes []utils.NodeConfig, apps utils.MutiAppsRequest) *utils.SimulatorJob
type DeleteNodesEmulator ¶
type DeleteNodesEmulator struct { Name string Func func(S *Kubesim) error // contains filtered or unexported fields }
func NewDeleteNodesEmulator ¶
func NewDeleteNodesEmulator(clientset clientset.Interface, ks *Kubesim) *DeleteNodesEmulator
func (DeleteNodesEmulator) DeleteNodesHandler ¶
func (e DeleteNodesEmulator) DeleteNodesHandler() error
type DeprecatedAppsEmulator ¶
type DeprecatedAppsEmulator struct { Name string Func func(nodes []utils.NodeConfig, apps utils.MutiAppsRequest, ks *Kubesim) (*SchedulerEmulatorReviewList, error) // contains filtered or unexported fields }
func NewDeprecatedAppsEmulator ¶
func NewDeprecatedAppsEmulator(clientset clientset.Interface, ks *Kubesim) *DeprecatedAppsEmulator
func (DeprecatedAppsEmulator) DeprecatedAppsHandler ¶
func (e DeprecatedAppsEmulator) DeprecatedAppsHandler(nodes []utils.NodeConfig, apps utils.MutiAppsRequest) (*SchedulerEmulatorReviewList, error)
type DeprecatedPredictionEmulator ¶
type DeprecatedPredictionEmulator struct { Name string Func func(nodes []utils.NodeConfig, apps utils.MutiAppsRequest, ks *Kubesim) (*SchedulerPrediction, error) // contains filtered or unexported fields }
func NewDeprecatedPredictionEmulator ¶
func NewDeprecatedPredictionEmulator(clientset clientset.Interface, ks *Kubesim) *DeprecatedPredictionEmulator
func (DeprecatedPredictionEmulator) DeprecatedPredictionHandler ¶
func (e DeprecatedPredictionEmulator) DeprecatedPredictionHandler(nodes []utils.NodeConfig, apps utils.MutiAppsRequest) (*SchedulerPrediction, error)
type EmulatorReport ¶
type EmulatorReport struct { Name string Func func(id string, ks *Kubesim) (*JobReport, error) // contains filtered or unexported fields }
func NewEmulatorReport ¶
func NewEmulatorReport(clientset clientset.Interface, ks *Kubesim) *EmulatorReport
func (EmulatorReport) EmulatorReportHandler ¶
func (e EmulatorReport) EmulatorReportHandler(id string) (*JobReport, error)
type FailReasonSummary ¶
type HorizontalEmulator ¶
type HorizontalEmulator struct { Name string Func func(nodes []utils.NodeConfig, apps utils.MutiAppsRequest, ks *Kubesim) (*utils.SimulatorJob, error) // contains filtered or unexported fields }
func NewHorizontalEmulator ¶
func NewHorizontalEmulator(clientset clientset.Interface, ks *Kubesim) *HorizontalEmulator
func (HorizontalEmulator) HorizontalHandler ¶
func (e HorizontalEmulator) HorizontalHandler(nodes []utils.NodeConfig, apps utils.MutiAppsRequest) (*utils.SimulatorJob, error)
type JobReport ¶
type JobReport struct { JobID string `json:"job"` Status string `json:"status"` Report []SchedulerEmulatorReview `json:"report"` PredictionNode *PredictionNodeReview `json:"prediction"` }
type Kubesim ¶
type Kubesim struct { // real cluster client KubeClient externalclientset.Interface // recorder used to send event to real cluster Recorder record.EventRecorder Broadcaster record.EventBroadcaster // contains filtered or unexported fields }
func New ¶
func New(addStrategy string, cc *schedconfig.CompletedConfig, client, kubeClient externalclientset.Interface, outOfTreeRegistryOptions ...utils.Option) (*Kubesim, error)
Create new cluster capacity analysis The analysis is completely independent of apiserver so no need for kubeconfig nor for apiserver url
func (*Kubesim) AddNodes ¶
func (ks *Kubesim) AddNodes(nodeConfig *utils.NodeConfig) (map[string][]string, *utils.NodeInfoList, error)
Create simulator node
func (*Kubesim) CSIDriverWatch ¶
func (ks *Kubesim) CSIDriverWatch(client externalclientset.Interface) error
func (*Kubesim) CSINodeWatch ¶
func (ks *Kubesim) CSINodeWatch(client externalclientset.Interface) error
func (*Kubesim) CleanPendingPod ¶
Clean simulated pending pod
func (*Kubesim) CreateApps ¶
func (*Kubesim) CreateFakeNode ¶
func (*Kubesim) DeleteAppsPod ¶
delete apps pod by pod name
func (*Kubesim) GetAppsPod ¶
get apps newpod and oldpods
func (*Kubesim) GetNodeInfo ¶
get nodeinfo
func (*Kubesim) HorizontalEmulator ¶
func (*Kubesim) ListNodes ¶
func (ks *Kubesim) ListNodes() (*utils.NodeInfoList, error)
List simulator node
func (*Kubesim) NewBindPlugin ¶
func (*Kubesim) PredictionEmulator ¶
func (*Kubesim) Report ¶
func (ks *Kubesim) Report() *SchedulerEmulatorReview
func (*Kubesim) SavePrediction ¶
func (*Kubesim) StorageClassWatch ¶
func (ks *Kubesim) StorageClassWatch(client externalclientset.Interface) error
func (*Kubesim) SyncWithClient ¶
func (ks *Kubesim) SyncWithClient(client externalclientset.Interface) error
func (*Kubesim) UpdatePodRequest ¶
Pod request
func (*Kubesim) VerticalEmulator ¶
func (*Kubesim) VolumeAttachmentsWatch ¶
func (ks *Kubesim) VolumeAttachmentsWatch(client externalclientset.Interface) error
type ListNodeInfoEmulator ¶
type ListNodeInfoEmulator struct { Name string Func func(ks *Kubesim) (*[]utils.NodeInfo, error) // contains filtered or unexported fields }
func NewListNodeInfoEmulator ¶
func NewListNodeInfoEmulator(clientset clientset.Interface, ks *Kubesim) *ListNodeInfoEmulator
func (ListNodeInfoEmulator) ListNodeInfoHandler ¶
func (e ListNodeInfoEmulator) ListNodeInfoHandler() (*[]utils.NodeInfo, error)
type ListNodesEmulator ¶
type ListNodesEmulator struct { Name string Func func(ks *Kubesim) (*utils.NodeInfoList, error) // contains filtered or unexported fields }
func NewListNodesEmulator ¶
func NewListNodesEmulator(clientset clientset.Interface, ks *Kubesim) *ListNodesEmulator
func (ListNodesEmulator) ListNodesHandler ¶
func (e ListNodesEmulator) ListNodesHandler() (*utils.NodeInfoList, error)
type PredictionEmulator ¶
type PredictionEmulator struct { Name string Func func(nodes []utils.NodeConfig, apps utils.MutiAppsRequest, ks *Kubesim) *utils.SimulatorJob // contains filtered or unexported fields }
func NewPredictionEmulator ¶
func NewPredictionEmulator(clientset clientset.Interface, ks *Kubesim) *PredictionEmulator
func (PredictionEmulator) PredictionHandler ¶
func (e PredictionEmulator) PredictionHandler(nodes []utils.NodeConfig, apps utils.MutiAppsRequest) *utils.SimulatorJob
type PredictionNodeReview ¶
type PredictionNodeReview struct { metav1.TypeMeta Spec AccessSwitchSpec `json:"spec"` Status AccessSwitchStatus `json:"status"` }
type ReplicasOnNode ¶
type Requirements ¶
type Resources ¶
type Resources struct { PrimaryResources v1.ResourceList `json:"primaryResources"` ScalarResources map[v1.ResourceName]int64 `json:"scalarResources"` }
type SchedulerEmulatorReview ¶
type SchedulerEmulatorReview struct { metav1.TypeMeta Spec SchedulerEmulatorReviewSpec `json:"spec"` Status SchedulerEmulatorReviewStatus `json:"status"` }
type SchedulerEmulatorReviewList ¶
type SchedulerEmulatorReviewList struct {
ReportList []SchedulerEmulatorReview `json:"reportList"`
}
type SchedulerEmulatorReviewResult ¶
type SchedulerEmulatorReviewResult struct { UsName string `json:"usName"` // 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 SchedulerEmulatorReviewSpec ¶
type SchedulerEmulatorReviewSpec struct { // desired number of replicas that should be scheduled // +optional DesiredReplicas int32 `json:"desiredReplicas"` PodRequirements []*Requirements `json:"podRequirements"` }
type SchedulerEmulatorReviewStatus ¶
type SchedulerEmulatorReviewStatus struct { CreationTimestamp time.Time `json:"creationTimestamp"` // actual number of replicas that could schedule Replicas int32 `json:"replicas"` Reason *SchedulerEmulatorReviewScheduleFailReason `json:"reason"` // per node information about the scheduling simulation Pods []*SchedulerEmulatorReviewResult `json:"pods"` }
type SchedulerPrediction ¶
type SchedulerPrediction struct { SuccessAppsName []string `json:"successAppsName"` SuccessAppsCount int32 `json:"successAppsCount"` FailedAppsCount int32 `json:"failedAppsCount"` FirstAppfailedReason string `json:"firstAppFailedReason"` PredictionGo bool `json:"predictionGo"` ReportList *SchedulerEmulatorReviewList `json:"reportList"` }
type VerticalEmulator ¶
type VerticalEmulator struct { Name string Func func(nodes []utils.NodeConfig, apps utils.MutiAppsRequest, ks *Kubesim) (*utils.SimulatorJob, error) // contains filtered or unexported fields }
func NewVerticalEmulator ¶
func NewVerticalEmulator(clientset clientset.Interface, ks *Kubesim) *VerticalEmulator
func (VerticalEmulator) VerticalHandler ¶
func (e VerticalEmulator) VerticalHandler(nodes []utils.NodeConfig, apps utils.MutiAppsRequest) (*utils.SimulatorJob, error)
Click to show internal directories.
Click to hide internal directories.