Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Environment ¶
func Environment() string
func SetEnvironment ¶
func SetEnvironment(env string)
Types ¶
type ClusterDefinition ¶ added in v0.4.0
type ClusterDefinition struct {
// TenancyCount determines how many ClusterRequests may point to the same Cluster.
// Has no effect if the tenancy in the Cluster template is set to "Exclusive".
// Must be equal to or greater than 0 otherwise, with 0 meaning "unlimited".
TenancyCount int `json:"tenancyCount,omitempty"`
Template ClusterTemplate `json:"template"`
Selector *metav1.LabelSelector `json:"selector,omitempty"`
CompletedSelector labels.Selector `json:"-"`
}
type ClusterTemplate ¶ added in v0.4.0
type ClusterTemplate struct {
metav1.ObjectMeta `json:"metadata"`
Spec clustersv1alpha1.ClusterSpec `json:"spec"`
}
type Completable ¶
type Completable interface {
// Complete performs any required transformations on the configuration,
// e.g. filling a map[string]X field from an []X field with keys.
// It is expected to modify the configuration in place.
// The fieldPath parameter can be used to create error messages.
Complete(fldPath *field.Path) error
}
type CompletedSchedulerSelectors ¶ added in v0.4.0
type Config ¶
type Config struct {
// Scheduler is the configuration for the cluster scheduler.
Scheduler *SchedulerConfig `json:"scheduler,omitempty"`
}
func LoadFromBytes ¶
LoadFromBytes builds the config from multiple raw YAML byte slices. It merges the configs together, with later configs overriding earlier ones.
func LoadFromFiles ¶
LoadFromFiles builds the config from multiple YAML files.
func (*Config) Complete ¶
Complete completes the config by calling the Complete() method on each field that implements the Completable interface.
func (*Config) Default ¶
Default defaults the config by calling the Default() method on each field that implements the Defaultable interface.
type Defaultable ¶
type SchedulerConfig ¶ added in v0.4.0
type SchedulerConfig struct {
// Scope determines whether the scheduler considers all clusters or only the ones in the same namespace as the ClusterRequest.
// Defaults to "Namespaced".
Scope SchedulerScope `json:"scope"`
// Strategy determines how the scheduler chooses between multiple fitting clusters:
// - Random: chooses a random cluster
// - Simple: chooses the first cluster in the list
// - Balanced: chooses the cluster with the least number of requests (first one in case of a tie)
// Defaults to "Balanced".
Strategy Strategy `json:"strategy"`
// +optional
Selectors *SchedulerSelectors `json:"selectors,omitempty"`
// Note that CompletedSelectors.Clusters holds the global cluster selector.
// During Complete(), the local selector is merged with the global one (or set to the global one if nil).
// This means that always the local completed selector should be used, unless the task is not tied to a specific ClusterDefinition.
CompletedSelectors CompletedSchedulerSelectors `json:"-"`
PurposeMappings map[string]*ClusterDefinition `json:"purposeMappings"`
}
func (*SchedulerConfig) Complete ¶ added in v0.4.0
func (c *SchedulerConfig) Complete(fldPath *field.Path) error
type SchedulerScope ¶ added in v0.4.0
type SchedulerScope string
const ( SCOPE_CLUSTER SchedulerScope = "Cluster" SCOPE_NAMESPACED SchedulerScope = "Namespaced" )
type SchedulerSelectors ¶ added in v0.4.0
type SchedulerSelectors struct {
Clusters *metav1.LabelSelector `json:"clusters,omitempty"`
Requests *metav1.LabelSelector `json:"requests,omitempty"`
}
type Validatable ¶
Click to show internal directories.
Click to hide internal directories.