...
Package geolocation
- Constants
- func NewGeoLocationClusterAgentPlugin(configMap config.PluginConfig, clusterAgentServices pipeline.ClusterAgentServices) (pipeline.Plugin, error)
- func NewGeoLocationSchedulingPlugin(configMap config.PluginConfig, scheduler pipeline.PolarisScheduler) (pipeline.Plugin, error)
- type GeoLocationPlugin
- func (glp *GeoLocationPlugin) Filter(ctx pipeline.SchedulingContext, podInfo *pipeline.PodInfo, nodeInfo *pipeline.NodeInfo) pipeline.Status
- func (glp *GeoLocationPlugin) Name() string
- func (glp *GeoLocationPlugin) PreFilter(ctx pipeline.SchedulingContext, podInfo *pipeline.PodInfo) pipeline.Status
- func (glp *GeoLocationPlugin) Score(ctx pipeline.SchedulingContext, podInfo *pipeline.PodInfo, nodeInfo *pipeline.NodeInfo) (int64, pipeline.Status)
- func (glp *GeoLocationPlugin) ScoreExtensions() pipeline.ScoreExtensions
Package files
geo_location_plugin.go
geo_location_state.go
Constants
const (
PluginName = "GeoLocation"
NodeGeoLocationLabel = "polaris-slo-cloud.github.io/geo-location"
PodTargetGeoLocationLabel = "polaris-slo-cloud.github.io/geo-location.target-location"
PodMaxDistanceToTargetLocationLabel = "polaris-slo-cloud.github.io/geo-location.max-distance-km"
DefaultMaxDistanceToTargetLocationKm = 10.0
)
func NewGeoLocationClusterAgentPlugin(configMap config.PluginConfig, clusterAgentServices pipeline.ClusterAgentServices) (pipeline.Plugin, error)
func NewGeoLocationSchedulingPlugin(configMap config.PluginConfig, scheduler pipeline.PolarisScheduler) (pipeline.Plugin, error)
This GeoLocationPlugin ensures that a pod is placed in or close to its specified target geo-location.
The plugin has two main functions:
- Filter: filter out nodes that are further away from the pod's desired target location than the max distance specified by the pod.
- Score: assign a score, based on how far (as a percentage of the max distance) the node is away from the target location
type GeoLocationPlugin struct {
}
func (*GeoLocationPlugin) Filter
¶
func (glp *GeoLocationPlugin) Filter(ctx pipeline.SchedulingContext, podInfo *pipeline.PodInfo, nodeInfo *pipeline.NodeInfo) pipeline.Status
func (*GeoLocationPlugin) Name
¶
func (glp *GeoLocationPlugin) Name() string
func (*GeoLocationPlugin) PreFilter
¶
func (glp *GeoLocationPlugin) PreFilter(ctx pipeline.SchedulingContext, podInfo *pipeline.PodInfo) pipeline.Status
func (*GeoLocationPlugin) Score
¶
func (glp *GeoLocationPlugin) Score(ctx pipeline.SchedulingContext, podInfo *pipeline.PodInfo, nodeInfo *pipeline.NodeInfo) (int64, pipeline.Status)
func (glp *GeoLocationPlugin) ScoreExtensions() pipeline.ScoreExtensions