plugin

package
v0.7.1 Latest Latest
Warning

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

Go to latest
Published: Apr 20, 2023 License: Apache-2.0 Imports: 34 Imported by: 0

Documentation

Overview

Copyright 2022/8/21 Alibaba Cloud.

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

Copyright 2022/8/23 Alibaba Cloud.

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

Index

Constants

View Source
const PluginName = "Open-Local"

Variables

This section is empty.

Functions

func NewLocalPlugin

func NewLocalPlugin(configuration runtime.Object, f framework.Handle) (framework.Plugin, error)

NewLocalPlugin

func NewLocalPluginWithKubeconfig added in v0.7.0

func NewLocalPluginWithKubeconfig(configuration runtime.Object, f framework.Handle, cfg *restclient.Config) (framework.Plugin, error)

NewLocalPluginWithKubeconfig

Types

type DeviceScorer

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

func NewDeviceScorer

func NewDeviceScorer(strategy localtype.StrategyType, nodeAntiAffinityWeight *localtype.NodeAntiAffinityWeight) *DeviceScorer

func (*DeviceScorer) ScoreByCapacity

func (scorer *DeviceScorer) ScoreByCapacity(nodeAllocate *cache.NodeAllocateState) (score int64)

func (*DeviceScorer) ScoreByCount

func (scorer *DeviceScorer) ScoreByCount(nodeAllocate *cache.NodeAllocateState) (score int64)

func (*DeviceScorer) ScoreByNodeAntiAffinity

func (scorer *DeviceScorer) ScoreByNodeAntiAffinity(nodeAllocate *cache.NodeAllocateState) (score int64)

type LocalPlugin

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

func (*LocalPlugin) Filter

func (plugin *LocalPlugin) Filter(ctx context.Context, state *framework.CycleState, pod *corev1.Pod, nodeInfo *framework.NodeInfo) *framework.Status

TODO This plugin can't get staticBindings pvc bound by volume_binding plugin here, so node storage that have no space but exist matchingVolume may also fail

func (*LocalPlugin) Name

func (plugin *LocalPlugin) Name() string

Name returns name of the plugin. It is used in logs, etc.

func (*LocalPlugin) NormalizeScore

func (plugin *LocalPlugin) NormalizeScore(ctx context.Context, state *framework.CycleState, pod *corev1.Pod, scores framework.NodeScoreList) *framework.Status

NormalizeScore invoked after scoring all nodes.

func (*LocalPlugin) OnNodeLocalStorageAdd

func (plugin *LocalPlugin) OnNodeLocalStorageAdd(obj interface{})

func (*LocalPlugin) OnNodeLocalStorageUpdate

func (plugin *LocalPlugin) OnNodeLocalStorageUpdate(oldObj, newObj interface{})

func (*LocalPlugin) OnPVAdd

func (plugin *LocalPlugin) OnPVAdd(obj interface{})

func (*LocalPlugin) OnPVCAdd

func (plugin *LocalPlugin) OnPVCAdd(obj interface{})

func (*LocalPlugin) OnPVCDelete

func (plugin *LocalPlugin) OnPVCDelete(obj interface{})

func (*LocalPlugin) OnPVCUpdate

func (plugin *LocalPlugin) OnPVCUpdate(oldObj, newObj interface{})

func (*LocalPlugin) OnPVDelete

func (plugin *LocalPlugin) OnPVDelete(obj interface{})

func (*LocalPlugin) OnPVUpdate

func (plugin *LocalPlugin) OnPVUpdate(oldObj, newObj interface{})

func (*LocalPlugin) OnPodAdd

func (plugin *LocalPlugin) OnPodAdd(obj interface{})

func (*LocalPlugin) OnPodDelete

func (plugin *LocalPlugin) OnPodDelete(obj interface{})

func (*LocalPlugin) OnPodUpdate

func (plugin *LocalPlugin) OnPodUpdate(oldObj, newObj interface{})

func (*LocalPlugin) PreBind

func (plugin *LocalPlugin) PreBind(ctx context.Context, state *framework.CycleState, p *corev1.Pod, nodeName string) *framework.Status

TODO 1) staticBindings PVC which bound by volume_binding plugin may patch a wrong VG or Device to pod. TODO 1) such as pvc allocated with VG1 OR Device1 by scheduler, but bound by volume_binding with pv of VG2 OR Device2 TODO 2) if Prebind step error, we will not revert patch info of pod, it can update next schedule cycle

func (*LocalPlugin) PreFilter

func (plugin *LocalPlugin) PreFilter(ctx context.Context, state *framework.CycleState, pod *corev1.Pod) *framework.Status

func (*LocalPlugin) PreFilterExtensions

func (plugin *LocalPlugin) PreFilterExtensions() framework.PreFilterExtensions

func (*LocalPlugin) Reserve

func (plugin *LocalPlugin) Reserve(ctx context.Context, state *framework.CycleState, pod *corev1.Pod, nodeName string) *framework.Status

PVC which will be bound as a staticBindings at step volume_binding.PreBind, finally allocate by pv and no need revert by pvc

func (*LocalPlugin) ReserveReservation

func (plugin *LocalPlugin) ReserveReservation(ctx context.Context, state *framework.CycleState, pod *corev1.Pod, reservationPod *corev1.Pod, nodeName string) *framework.Status

func (*LocalPlugin) Score

func (plugin *LocalPlugin) Score(ctx context.Context, state *framework.CycleState, pod *corev1.Pod, nodeName string) (int64, *framework.Status)

func (*LocalPlugin) ScoreExtensions

func (plugin *LocalPlugin) ScoreExtensions() framework.ScoreExtensions

ScoreExtensions of the Score plugin.

func (*LocalPlugin) Unreserve

func (plugin *LocalPlugin) Unreserve(ctx context.Context, state *framework.CycleState, p *corev1.Pod, nodeName string)

func (*LocalPlugin) UnreserveReservation

func (plugin *LocalPlugin) UnreserveReservation(ctx context.Context, state *framework.CycleState, pod *corev1.Pod, reservationPod *corev1.Pod, nodeName string)

type OpenLocalArg

type OpenLocalArg struct {
	KubeConfigPath       string `json:"kubeConfigPath,omitempty"`
	SchedulerStrategy    string `json:"schedulerStrategy,omitempty"`
	NodeAntiAffinityConf string `json:"nodeAntiAffinityConf,omitempty"`
}

type ScoreCalculator

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

func NewScoreCalculator

func NewScoreCalculator(strategy localtype.StrategyType, nodeAntiAffinityWeight *localtype.NodeAntiAffinityWeight) *ScoreCalculator

func (*ScoreCalculator) Score

func (scorer *ScoreCalculator) Score(nodeAllocate *cache.NodeAllocateState) (score int64)

func (*ScoreCalculator) ScoreByCapacity

func (scorer *ScoreCalculator) ScoreByCapacity(nodeAllocate *cache.NodeAllocateState) (score int64)

func (*ScoreCalculator) ScoreByCount

func (scorer *ScoreCalculator) ScoreByCount(nodeAllocate *cache.NodeAllocateState) (score int64)

func (*ScoreCalculator) ScoreByNodeAntiAffinity

func (scorer *ScoreCalculator) ScoreByNodeAntiAffinity(nodeAllocate *cache.NodeAllocateState) (score int64)

type Scorer

type Scorer interface {
	ScoreByCapacity(nodeAllocate *cache.NodeAllocateState) (score int64)
	ScoreByCount(nodeAllocate *cache.NodeAllocateState) (score int64)
	ScoreByNodeAntiAffinity(nodeAllocate *cache.NodeAllocateState) (score int64)
}

type VolumeGroupScorer

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

func NewVolumeGroupScorer

func NewVolumeGroupScorer(strategy localtype.StrategyType) *VolumeGroupScorer

func (*VolumeGroupScorer) ScoreByCapacity

func (scorer *VolumeGroupScorer) ScoreByCapacity(nodeAllocate *cache.NodeAllocateState) (score int64)

func (*VolumeGroupScorer) ScoreByCount

func (scorer *VolumeGroupScorer) ScoreByCount(nodeAllocate *cache.NodeAllocateState) (score int64)

func (*VolumeGroupScorer) ScoreByNodeAntiAffinity

func (scorer *VolumeGroupScorer) ScoreByNodeAntiAffinity(nodeAllocate *cache.NodeAllocateState) (score int64)

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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