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:
type GeoLocationPlugin struct {
}
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