{"modulePath":"github.com/stackpointcloud/kubernetes","version":"v1.3.4","isLatest":true,"isStandardLibrary":false,"goos":"all","goarch":"all","docs":"# package factory\n\nPackage factory can set up a scheduler. This code is here instead of plugin/cmd/scheduler for both testability and reuse.\n\n## Constants\n\n```go\nconst (\n\tDefaultProvider = \"DefaultProvider\"\n)\n```\n\n```go\nconst (\n\tSchedulerAnnotationKey = \"scheduler.alpha.kubernetes.io/name\"\n)\n```\n\n## Functions\n\n```go\nfunc IsFitPredicateRegistered(name string) bool\n```\nThis check is useful for testing providers.\n\n```go\nfunc IsPriorityFunctionRegistered(name string) bool\n```\nThis check is useful for testing providers.\n\n```go\nfunc ListAlgorithmProviders() string\n```\nListAlgorithmProviders is called when listing all available algortihm providers in \\`kube-scheduler --help\\`\n\n```go\nfunc RegisterAlgorithmProvider(name string, predicateKeys, priorityKeys sets.String) string\n```\nRegisters a new algorithm provider with the algorithm registry. This should be called from the init function in a provider plugin.\n\n```go\nfunc RegisterCustomFitPredicate(policy schedulerapi.PredicatePolicy) string\n```\nRegisters a custom fit predicate with the algorithm registry. Returns the name, with which the predicate was registered.\n\n```go\nfunc RegisterCustomPriorityFunction(policy schedulerapi.PriorityPolicy) string\n```\nRegisters a custom priority function with the algorithm registry. Returns the name, with which the priority function was registered.\n\n```go\nfunc RegisterFitPredicate(name string, predicate algorithm.FitPredicate) string\n```\nRegisterFitPredicate registers a fit predicate with the algorithm registry. Returns the name with which the predicate was registered.\n\n```go\nfunc RegisterFitPredicateFactory(name string, predicateFactory FitPredicateFactory) string\n```\nRegisterFitPredicateFactory registers a fit predicate factory with the algorithm registry. Returns the name with which the predicate was registered.\n\n```go\nfunc RegisterPriorityConfigFactory(name string, pcf PriorityConfigFactory) string\n```\n\n```go\nfunc RegisterPriorityFunction(name string, function algorithm.PriorityFunction, weight int) string\n```\nRegisters a priority function with the algorithm registry. Returns the name, with which the function was registered.\n\n## Types\n\n```go\ntype AlgorithmProviderConfig struct {\n\tFitPredicateKeys     sets.String\n\tPriorityFunctionKeys sets.String\n}\n```\n\n```go\nfunc GetAlgorithmProvider(name string) (*AlgorithmProviderConfig, error)\n```\nThis function should not be used to modify providers. It is publicly visible for testing.\n\n```go\ntype ConfigFactory struct {\n\tClient *client.Client\n\t// queue for pods that need scheduling\n\tPodQueue *cache.FIFO\n\t// a means to list all known scheduled pods.\n\tScheduledPodLister *cache.StoreToPodLister\n\t// a means to list all known scheduled pods and pods assumed to have been scheduled.\n\tPodLister algorithm.PodLister\n\t// a means to list all nodes\n\tNodeLister *cache.StoreToNodeLister\n\t// a means to list all PersistentVolumes\n\tPVLister *cache.StoreToPVFetcher\n\t// a means to list all PersistentVolumeClaims\n\tPVCLister *cache.StoreToPVCFetcher\n\t// a means to list all services\n\tServiceLister *cache.StoreToServiceLister\n\t// a means to list all controllers\n\tControllerLister *cache.StoreToReplicationControllerLister\n\t// a means to list all replicasets\n\tReplicaSetLister *cache.StoreToReplicaSetLister\n\n\t// Close this to stop all reflectors\n\tStopEverything chan struct{}\n\n\t// SchedulerName of a scheduler is used to select which pods will be\n\t// processed by this scheduler, based on pods's annotation key:\n\t// 'scheduler.alpha.kubernetes.io/name'\n\tSchedulerName string\n\n\t// RequiredDuringScheduling affinity is not symmetric, but there is an implicit PreferredDuringScheduling affinity rule\n\t// corresponding to every RequiredDuringScheduling affinity rule.\n\t// HardPodAffinitySymmetricWeight represents the weight of implicit PreferredDuringScheduling affinity rule, in the range 0-100.\n\tHardPodAffinitySymmetricWeight int\n\n\t// Indicate the \"all topologies\" set for empty topologyKey when it's used for PreferredDuringScheduling pod anti-affinity.\n\tFailureDomains string\n\t// contains filtered or unexported fields\n}\n```\nConfigFactory knows how to fill out a scheduler config with its support functions.\n\n```go\nfunc NewConfigFactory(client *client.Client, schedulerName string, hardPodAffinitySymmetricWeight int, failureDomains string) *ConfigFactory\n```\nInitializes the factory.\n\n```go\nfunc (f *ConfigFactory) Create() (*scheduler.Config, error)\n```\nCreate creates a scheduler with the default algorithm provider.\n\n```go\nfunc (f *ConfigFactory) CreateFromConfig(policy schedulerapi.Policy) (*scheduler.Config, error)\n```\nCreates a scheduler from the configuration file\n\n```go\nfunc (f *ConfigFactory) CreateFromKeys(predicateKeys, priorityKeys sets.String, extenders []algorithm.SchedulerExtender) (*scheduler.Config, error)\n```\nCreates a scheduler from a set of registered fit predicate keys and priority keys.\n\n```go\nfunc (f *ConfigFactory) CreateFromProvider(providerName string) (*scheduler.Config, error)\n```\nCreates a scheduler from the name of a registered algorithm provider.\n\n```go\nfunc (f *ConfigFactory) GetPredicates(predicateKeys sets.String) (map[string]algorithm.FitPredicate, error)\n```\n\n```go\nfunc (f *ConfigFactory) GetPriorityFunctionConfigs(priorityKeys sets.String) ([]algorithm.PriorityConfig, error)\n```\n\n```go\nfunc (f *ConfigFactory) Run()\n```\n\n```go\ntype FitPredicateFactory func(PluginFactoryArgs) algorithm.FitPredicate\n```\nA FitPredicateFactory produces a FitPredicate from the given args.\n\n```go\ntype PluginFactoryArgs struct {\n\tPodLister                      algorithm.PodLister\n\tServiceLister                  algorithm.ServiceLister\n\tControllerLister               algorithm.ControllerLister\n\tReplicaSetLister               algorithm.ReplicaSetLister\n\tNodeLister                     algorithm.NodeLister\n\tNodeInfo                       predicates.NodeInfo\n\tPVInfo                         predicates.PersistentVolumeInfo\n\tPVCInfo                        predicates.PersistentVolumeClaimInfo\n\tHardPodAffinitySymmetricWeight int\n\tFailureDomains                 []string\n}\n```\nPluginFactoryArgs are passed to all plugin factory functions.\n\n```go\ntype PriorityConfigFactory struct {\n\tFunction PriorityFunctionFactory\n\tWeight   int\n}\n```\nA PriorityConfigFactory produces a PriorityConfig from the given function and weight\n\n```go\ntype PriorityFunctionFactory func(PluginFactoryArgs) algorithm.PriorityFunction\n```\nA PriorityFunctionFactory produces a PriorityConfig from the given args.\n\n","path":"github.com/stackpointcloud/kubernetes/plugin/pkg/scheduler/factory","name":"factory","synopsis":"Package factory can set up a scheduler.","isRedistributable":true}
