v1alpha1

package
v0.1.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Apr 11, 2023 License: Apache-2.0 Imports: 4 Imported by: 3

Documentation

Overview

Package v1alpha1 is the v1alpha1 version of the API.

Package v1alpha1 contains API Schema definitions for the common v1alpha1 API group +groupName=core.api.onmetal.de

Index

Constants

View Source
const (
	// ResourceCPU is the amount of cpu in cores.
	ResourceCPU ResourceName = "cpu"
	// ResourceMemory is the amount of memory in bytes.
	ResourceMemory ResourceName = "memory"
	// ResourceStorage is the amount of storage, in bytes.
	ResourceStorage ResourceName = "storage"
	// ResourceTPS defines max throughput per second. (e.g. 1Gi)
	ResourceTPS ResourceName = "tps"
	// ResourceIOPS defines max IOPS in input/output operations per second.
	ResourceIOPS ResourceName = "iops"

	// ResourcesRequestsPrefix is the prefix used for limiting resource requests in ResourceQuota.
	ResourcesRequestsPrefix = "requests."

	// ResourceRequestsCPU is the amount of requested cpu in cores.
	ResourceRequestsCPU = ResourcesRequestsPrefix + ResourceCPU
	// ResourceRequestsMemory is the amount of requested memory in bytes.
	ResourceRequestsMemory = ResourcesRequestsPrefix + ResourceMemory
	// ResourceRequestsStorage is the amount of requested storage in bytes.
	ResourceRequestsStorage = ResourcesRequestsPrefix + ResourceStorage

	// ResourceCountNamespacePrefix is resource namespace prefix for counting resources.
	ResourceCountNamespacePrefix = "count/"
)

Variables

View Source
var (
	// SchemeGroupVersion is group version used to register these objects
	SchemeGroupVersion = schema.GroupVersion{Group: "core.api.onmetal.de", Version: "v1alpha1"}

	// SchemeBuilder is used to add go types to the GroupVersionKind scheme
	SchemeBuilder = runtime.NewSchemeBuilder(addKnownTypes)

	// AddToScheme adds the types in this group-version to the given scheme.
	AddToScheme = SchemeBuilder.AddToScheme
)

Functions

func Resource

func Resource(resource string) schema.GroupResource

Types

type ResourceList

type ResourceList map[ResourceName]resource.Quantity

ResourceList is a list of ResourceName alongside their resource.Quantity.

func (*ResourceList) CPU

func (rl *ResourceList) CPU() *resource.Quantity

CPU is a shorthand for getting the quantity associated with ResourceCPU.

func (ResourceList) DeepCopy

func (in ResourceList) DeepCopy() ResourceList

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ResourceList.

func (ResourceList) DeepCopyInto

func (in ResourceList) DeepCopyInto(out *ResourceList)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

func (*ResourceList) IOPS

func (rl *ResourceList) IOPS() *resource.Quantity

IOPS is a shorthand for getting the quantity associated with ResourceIOPS.

func (*ResourceList) Memory

func (rl *ResourceList) Memory() *resource.Quantity

Memory is a shorthand for getting the quantity associated with ResourceMemory.

func (*ResourceList) Name

func (rl *ResourceList) Name(name ResourceName, defaultFormat resource.Format) *resource.Quantity

Name returns the resource with name if specified, otherwise it returns a nil quantity with default format.

func (*ResourceList) Storage

func (rl *ResourceList) Storage() *resource.Quantity

Storage is a shorthand for getting the quantity associated with ResourceStorage.

func (*ResourceList) TPS

func (rl *ResourceList) TPS() *resource.Quantity

TPS is a shorthand for getting the quantity associated with ResourceTPS.

type ResourceName

type ResourceName string

ResourceName is the name of a resource, most often used alongside a resource.Quantity.

func ObjectCountQuotaResourceNameFor

func ObjectCountQuotaResourceNameFor(groupResource schema.GroupResource) ResourceName

ObjectCountQuotaResourceNameFor returns the ResourceName for counting the given groupResource.

type ResourceQuota

type ResourceQuota struct {
	metav1.TypeMeta   `json:",inline"`
	metav1.ObjectMeta `json:"metadata,omitempty"`

	Spec   ResourceQuotaSpec   `json:"spec,omitempty"`
	Status ResourceQuotaStatus `json:"status,omitempty"`
}

ResourceQuota is the Schema for the resourcequotas API

func (*ResourceQuota) DeepCopy

func (in *ResourceQuota) DeepCopy() *ResourceQuota

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ResourceQuota.

func (*ResourceQuota) DeepCopyInto

func (in *ResourceQuota) DeepCopyInto(out *ResourceQuota)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

func (*ResourceQuota) DeepCopyObject

func (in *ResourceQuota) DeepCopyObject() runtime.Object

DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object.

type ResourceQuotaList

type ResourceQuotaList struct {
	metav1.TypeMeta `json:",inline"`
	metav1.ListMeta `json:"metadata,omitempty"`
	Items           []ResourceQuota `json:"items"`
}

ResourceQuotaList contains a list of ResourceQuota

func (*ResourceQuotaList) DeepCopy

func (in *ResourceQuotaList) DeepCopy() *ResourceQuotaList

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ResourceQuotaList.

func (*ResourceQuotaList) DeepCopyInto

func (in *ResourceQuotaList) DeepCopyInto(out *ResourceQuotaList)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

func (*ResourceQuotaList) DeepCopyObject

func (in *ResourceQuotaList) DeepCopyObject() runtime.Object

DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object.

type ResourceQuotaSpec

type ResourceQuotaSpec struct {
	// Hard is a ResourceList of the strictly enforced amount of resources.
	Hard ResourceList `json:"hard,omitempty"`
	// ScopeSelector selects the resources that are subject to this quota.
	// Note: By using certain ScopeSelectors, only certain resources may be tracked.
	ScopeSelector *ResourceScopeSelector `json:"scopeSelector,omitempty"`
}

ResourceQuotaSpec defines the desired state of ResourceQuotaSpec

func (*ResourceQuotaSpec) DeepCopy

func (in *ResourceQuotaSpec) DeepCopy() *ResourceQuotaSpec

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ResourceQuotaSpec.

func (*ResourceQuotaSpec) DeepCopyInto

func (in *ResourceQuotaSpec) DeepCopyInto(out *ResourceQuotaSpec)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

type ResourceQuotaStatus

type ResourceQuotaStatus struct {
	// Hard are the currently enforced hard resource limits. Hard may be less than used in
	// case the limits were introduced / updated after more than allowed resources were already present.
	Hard ResourceList `json:"hard,omitempty"`
	// Used is the amount of currently used resources.
	Used ResourceList `json:"used,omitempty"`
}

ResourceQuotaStatus is the status of a ResourceQuota.

func (*ResourceQuotaStatus) DeepCopy

func (in *ResourceQuotaStatus) DeepCopy() *ResourceQuotaStatus

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ResourceQuotaStatus.

func (*ResourceQuotaStatus) DeepCopyInto

func (in *ResourceQuotaStatus) DeepCopyInto(out *ResourceQuotaStatus)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

type ResourceScope

type ResourceScope string

ResourceScope is a scope of a resource.

const (
	// ResourceScopeMachineClass refers to the machine class of a resource.
	ResourceScopeMachineClass ResourceScope = "MachineClass"
	// ResourceScopeVolumeClass refers to the volume class of a resource.
	ResourceScopeVolumeClass ResourceScope = "VolumeClass"
	// ResourceScopeBucketClass refers to the bucket class of a resource.
	ResourceScopeBucketClass ResourceScope = "BucketClass"
)

type ResourceScopeSelector

type ResourceScopeSelector struct {
	// MatchExpressions is a list of ResourceScopeSelectorRequirement to match resources by.
	MatchExpressions []ResourceScopeSelectorRequirement `json:"matchExpressions,omitempty"`
}

ResourceScopeSelector selects

func (*ResourceScopeSelector) DeepCopy

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ResourceScopeSelector.

func (*ResourceScopeSelector) DeepCopyInto

func (in *ResourceScopeSelector) DeepCopyInto(out *ResourceScopeSelector)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

type ResourceScopeSelectorOperator

type ResourceScopeSelectorOperator string

ResourceScopeSelectorOperator is an operator to compare a ResourceScope with values.

const (
	ResourceScopeSelectorOperatorIn           ResourceScopeSelectorOperator = "In"
	ResourceScopeSelectorOperatorNotIn        ResourceScopeSelectorOperator = "NotIn"
	ResourceScopeSelectorOperatorExists       ResourceScopeSelectorOperator = "Exists"
	ResourceScopeSelectorOperatorDoesNotExist ResourceScopeSelectorOperator = "DoesNotExist"
)

type ResourceScopeSelectorRequirement

type ResourceScopeSelectorRequirement struct {
	// ScopeName is the ResourceScope to make a requirement for.
	ScopeName ResourceScope `json:"scopeName"`
	// Operator is the ResourceScopeSelectorOperator to check the ScopeName with in a resource.
	Operator ResourceScopeSelectorOperator `json:"operator"`
	// Values are the values to compare the Operator with the ScopeName. May be optional.
	Values []string `json:"values,omitempty"`
}

ResourceScopeSelectorRequirement is a requirement for a resource using a ResourceScope alongside a ResourceScopeSelectorOperator with Values (depending on the ResourceScopeSelectorOperator).

func (*ResourceScopeSelectorRequirement) DeepCopy

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ResourceScopeSelectorRequirement.

func (*ResourceScopeSelectorRequirement) DeepCopyInto

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL