Documentation ¶
Overview ¶
Package v1alpha1 is the v1alpha1 version of the API. +groupName=autopilot.libopenstorage.org
Index ¶
- Constants
- Variables
- func Kind(kind string) schema.GroupKind
- func Resource(resource string) schema.GroupResource
- type AutopilotRule
- type AutopilotRuleConditionType
- type AutopilotRuleList
- type AutopilotRuleSpec
- type AutopilotRuleStatusType
- type EnforcementType
- type LabelSelectorOperator
- type LabelSelectorRequirement
- type PolicyConditionName
- type RuleAction
- type RuleConditions
- type RuleObjectSelector
Constants ¶
const ( // PolicyObjectPrefix is the key for any openstorage object used for policies PolicyObjectPrefix = openstorageDomain + ".object" // PolicyConditionPrefix is the key for any openstorage condition used for policies PolicyConditionPrefix = openstorageDomain + ".condition" // PolicyActionPrefix is the key for any openstorage action used for policies PolicyActionPrefix = openstorageDomain + ".action" // PolicyObjectTypeVolume is the key for volume objects PolicyObjectTypeVolume = PolicyObjectPrefix + ".volume" // PolicyObjectTypeStoragePool is the key for storagepool objects PolicyObjectTypeStoragePool = PolicyObjectPrefix + ".storagepool" // PolicyObjectTypeNode is the key for node objects PolicyObjectTypeNode = PolicyObjectPrefix + ".node" // PolicyObjectTypeDisk is the key for disk objects PolicyObjectTypeDisk = PolicyObjectPrefix + ".disk" // PolicyActionVolume is the key for volume actions for policies PolicyActionVolume = PolicyActionPrefix + ".volume" // PolicyActionStoragePool is the key for storagepool actions for policies PolicyActionStoragePool = PolicyActionPrefix + ".storagepool" // PolicyActionNode is the key for node actions for policies PolicyActionNode = PolicyActionPrefix + ".node" // PolicyActionDisk is the key for disk actions for policies PolicyActionDisk = PolicyActionPrefix + ".disk" )
const ( // PolicyActionVolumeResize is an action to resize volumes PolicyActionVolumeResize = "resize" // PolicyActionNodeRebalance is an action to rebalance a node PolicyActionNodeRebalance = PolicyActionNode + actionRebalance )
Variables ¶
var ( // SchemeBuilder is the scheme builder for the types SchemeBuilder = runtime.NewSchemeBuilder(addKnownTypes) // AddToScheme applies all the stored functions to the scheme AddToScheme = SchemeBuilder.AddToScheme )
var SchemeGroupVersion = schema.GroupVersion{Group: autopilot.GroupName, Version: "v1alpha1"}
SchemeGroupVersion is group version used to register these objects
Functions ¶
func Resource ¶
func Resource(resource string) schema.GroupResource
Resource takes an unqualified resource and returns a Group qualified GroupResource
Types ¶
type AutopilotRule ¶
type AutopilotRule struct { meta.TypeMeta `json:",inline"` meta.ObjectMeta `json:"metadata,omitempty"` Spec AutopilotRuleSpec `json:"spec"` }
AutopilotRule represents pairing with other clusters
func (*AutopilotRule) DeepCopy ¶
func (in *AutopilotRule) DeepCopy() *AutopilotRule
DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new AutopilotRule.
func (*AutopilotRule) DeepCopyInto ¶
func (in *AutopilotRule) DeepCopyInto(out *AutopilotRule)
DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
func (*AutopilotRule) DeepCopyObject ¶
func (in *AutopilotRule) DeepCopyObject() runtime.Object
DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object.
type AutopilotRuleConditionType ¶
type AutopilotRuleConditionType string
AutopilotRuleConditionType defines the type of a condition in a rule
const ( // RuleConditionMetrics is a metrics type of condition in a rule RuleConditionMetrics AutopilotRuleConditionType = "metrics" )
type AutopilotRuleList ¶
type AutopilotRuleList struct { meta.TypeMeta `json:",inline"` meta.ListMeta `json:"metadata,omitempty"` Items []AutopilotRule `json:"items"` }
AutopilotRuleList is a list of AutopilotRule objects in Kubernetes
func (*AutopilotRuleList) DeepCopy ¶
func (in *AutopilotRuleList) DeepCopy() *AutopilotRuleList
DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new AutopilotRuleList.
func (*AutopilotRuleList) DeepCopyInto ¶
func (in *AutopilotRuleList) DeepCopyInto(out *AutopilotRuleList)
DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
func (*AutopilotRuleList) DeepCopyObject ¶
func (in *AutopilotRuleList) DeepCopyObject() runtime.Object
DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object.
type AutopilotRuleSpec ¶
type AutopilotRuleSpec struct { // Weight defines the weight of the rule which allows to break the tie with other conflicting policies. A rule with // higher weight wins over one with lower weight. // (optional) Weight int64 `json:"weight,omitempty"` // PollInterval defined the interval in seconds at which the conditions for the // rule are queried from the metrics provider PollInterval int64 `json:"pollInterval,omitempty"` // Enforcement specifies the enforcement type for rule. Can take values: required or preferred. // (optional) Enforcement EnforcementType `json:"enforcement,omitempty"` // Selector allows to select the objects that are relevant with this rule using label selection Selector RuleObjectSelector `json:"selector"` // NamespaceSelector allows to select namespaces affecting the rule by labels:w NamespaceSelector RuleObjectSelector `json:"namespaceSelector"` // Conditions are the conditions to check on the rule objects Conditions RuleConditions `json:"conditions"` // Actions are the actions to run for the rule when the conditions are met Actions []*RuleAction `json:"actions"` // ActionsCoolDownPeriod is the duration in seconds for which autopilot will not // re-trigger any actions once they have been executed. ActionsCoolDownPeriod int64 `json:"actionsCoolDownPeriod,omitempty"` }
AutopilotRuleSpec is the spec to create the cluster pair
func (*AutopilotRuleSpec) DeepCopy ¶
func (in *AutopilotRuleSpec) DeepCopy() *AutopilotRuleSpec
DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new AutopilotRuleSpec.
func (*AutopilotRuleSpec) DeepCopyInto ¶
func (in *AutopilotRuleSpec) DeepCopyInto(out *AutopilotRuleSpec)
DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
type AutopilotRuleStatusType ¶
type AutopilotRuleStatusType string
AutopilotRuleStatusType is the type for rule statuses
const ( // AutopilotRuleConditonMet is for when the conditions in rule are met AutopilotRuleConditonMet AutopilotRuleStatusType = "ConditionMet" // AutopilotRuleActionFailed is when an action for a rule has failed AutopilotRuleActionFailed AutopilotRuleStatusType = "ActionFailed" // AutopilotRuleActionTriggered is when an action for a rule has triggerred AutopilotRuleActionTriggered AutopilotRuleStatusType = "ActionTriggered" // AutopilotRuleActionSuccessful is when an action for a rule is successful AutopilotRuleActionSuccessful AutopilotRuleStatusType = "ActionSuccessful" )
type EnforcementType ¶
type EnforcementType string
EnforcementType Defines the types of enforcement on the given policy
const ( // EnforcementRequired specifies that the policy is required and must be strictly enforced EnforcementRequired EnforcementType = "required" // EnforcementPreferred specifies that the policy is preferred and can be best effort EnforcementPreferred EnforcementType = "preferred" )
type LabelSelectorOperator ¶
type LabelSelectorOperator string
LabelSelectorOperator is the set of operators that can be used in a selector requirement.
const ( // AutopilotRuleResourceName is the name of the singular AutopilotRule objects AutopilotRuleResourceName = "autopilotrule" // AutopilotRuleResourceShortName is the short name for AutopilotRule objects AutopilotRuleResourceShortName = "ar" // AutopilotRuleResourcePlural is the name of the plural AutopilotRule objects AutopilotRuleResourcePlural = "autopilotrules" // LabelSelectorOpIn is operator where the key must have one of the values LabelSelectorOpIn LabelSelectorOperator = "In" // LabelSelectorOpNotIn is operator where the key must not have any of the values LabelSelectorOpNotIn LabelSelectorOperator = "NotIn" // LabelSelectorOpExists is operator where the key must exist LabelSelectorOpExists LabelSelectorOperator = "Exists" // LabelSelectorOpDoesNotExist is operator where the key must not exist LabelSelectorOpDoesNotExist LabelSelectorOperator = "DoesNotExist" // LabelSelectorOpGt is operator where the key must be greater than the values LabelSelectorOpGt LabelSelectorOperator = "Gt" // LabelSelectorOpGtEq is operator where the key must be greater than or equal to the values LabelSelectorOpGtEq LabelSelectorOperator = "GtEq" // LabelSelectorOpLt is operator where the key must be less than the values LabelSelectorOpLt LabelSelectorOperator = "Lt" // LabelSelectorOpLtEq is operator where the key must be less than or equal to the values LabelSelectorOpLtEq LabelSelectorOperator = "LtEq" )
type LabelSelectorRequirement ¶
type LabelSelectorRequirement struct { // key is the label key that the selector applies to. // +patchMergeKey=key // +patchStrategy=merge Key string `json:"key"` // operator represents a key's relationship to a set of values. // Valid operators are In, NotIn, Exists, DoesNotExist, Lt and Gt. Operator LabelSelectorOperator `json:"operator"` // values is an array of string values. If the operator is In or NotIn, // the values array must be non-empty. If the operator is Exists or DoesNotExist, // the values array must be empty. This array is replaced during a strategic // merge patch. // +optional Values []string `json:"values"` }
LabelSelectorRequirement is a selector that contains values, a key, and an operator that relates the key and values.
func (*LabelSelectorRequirement) DeepCopy ¶
func (in *LabelSelectorRequirement) DeepCopy() *LabelSelectorRequirement
DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new LabelSelectorRequirement.
func (*LabelSelectorRequirement) DeepCopyInto ¶
func (in *LabelSelectorRequirement) DeepCopyInto(out *LabelSelectorRequirement)
DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
type PolicyConditionName ¶
type PolicyConditionName string
PolicyConditionName is the type for policy condition names
const ( // PolicyConditionVolumeLatencyMS is the latency (reads + writes) for a volume in milliseconds PolicyConditionVolumeLatencyMS PolicyConditionName = PolicyObjectTypeVolume + latencyMS // PolicyConditionStoragePoolLatencyMS is the latency (reads + writes) for a storage pool in milliseconds PolicyConditionStoragePoolLatencyMS PolicyConditionName = PolicyObjectTypeStoragePool + latencyMS // PolicyConditionDiskLatencyMS is the latency (reads + writes) for a disk in milliseconds PolicyConditionDiskLatencyMS PolicyConditionName = PolicyObjectTypeDisk + latencyMS )
type RuleAction ¶
type RuleAction struct { // Name is the name of the rule Name string `json:"name"` // Params are the opaque paramters that will be used for the above action Params map[string]string `json:"params"` }
RuleAction defines an action for the rule
func (*RuleAction) DeepCopy ¶
func (in *RuleAction) DeepCopy() *RuleAction
DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new RuleAction.
func (*RuleAction) DeepCopyInto ¶
func (in *RuleAction) DeepCopyInto(out *RuleAction)
DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
type RuleConditions ¶
type RuleConditions struct { // Expressions are the actual rule conditions Expressions []*LabelSelectorRequirement `json:"expressions,omitempty"` // For is the duration in seconds for which the conditions must hold true For int64 `json:"for,omitempty"` // Type is the condition type // If not provided, the controller for the CRD will pick the default type Type AutopilotRuleConditionType `json:"type,omitempty"` // Provider is an optional provider for the above condition type // If not provided, the controller for the CRD will pick the default provider Provider string `json:"provider,omitempty"` }
RuleConditions defines the conditions for the rule
func (*RuleConditions) DeepCopy ¶
func (in *RuleConditions) DeepCopy() *RuleConditions
DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new RuleConditions.
func (*RuleConditions) DeepCopyInto ¶
func (in *RuleConditions) DeepCopyInto(out *RuleConditions)
DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
type RuleObjectSelector ¶
type RuleObjectSelector struct { // LabelSelector selects the rule objects meta.LabelSelector }
RuleObjectSelector defines an object for the rule
func (*RuleObjectSelector) DeepCopy ¶
func (in *RuleObjectSelector) DeepCopy() *RuleObjectSelector
DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new RuleObjectSelector.
func (*RuleObjectSelector) DeepCopyInto ¶
func (in *RuleObjectSelector) DeepCopyInto(out *RuleObjectSelector)
DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.