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 AccessRequestConfig ¶ added in v0.6.0
type AccessRequestConfig struct { // If set, only AccessRequests that match the selector will be reconciled. Selector *Selector `json:"selector,omitempty"` }
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 *Selector `json:"selector,omitempty"` }
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 Config ¶
type Config struct { // Scheduler is the configuration for the cluster scheduler. Scheduler *SchedulerConfig `json:"scheduler,omitempty"` // AccessRequest is the configuration for the access request controller. AccessRequest *AccessRequestConfig `json:"accessRequest,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"` // Note that the cluster selector specified here 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. // +optional Selectors SchedulerSelectors `json:"selectors"` 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 Selector ¶ added in v0.6.0
type Selector struct { *metav1.LabelSelector `json:",inline"` // contains filtered or unexported fields }
func (*Selector) Combine ¶ added in v0.6.0
Combine returns a new selector that is a combination of the two selectors. Neither the original nor the other selector is modified. For the MatchLabels field, entries from other overwrite entries from the receiver object in case of key collisions. Note that the requirements of both selectors are ANDed. This can lead to selectors that cannot be satisfied. The returned selector is completed, even if neither the receiver nor the other one was.