v1alpha1

package
v0.0.1 Latest Latest
Warning

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

Go to latest
Published: Apr 10, 2024 License: MIT Imports: 5 Imported by: 0

Documentation

Overview

Package v1alpha1 implements the v1alpha1 apiVersion

Index

Constants

View Source
const (
	// CustomMetricKind is the kind for resource usage.
	CustomMetricKind = "CustomMetric"
)
View Source
const (
	// ExternalMetricKind is the kind for resource usage.
	ExternalMetricKind = "ExternalMetric"
)

Variables

View Source
var (
	// GroupVersion is group version used to register these objects
	GroupVersion = schema.GroupVersion{
		Group:   "custom-metrics-apiserver-simulator.zsm.io",
		Version: "v1alpha1",
	}

	// SchemeBuilder is used to add go types to the GroupVersionKind scheme
	SchemeBuilder = &scheme.Builder{GroupVersion: GroupVersion}

	// AddToScheme adds the types in this group-version to the given scheme
	AddToScheme = SchemeBuilder.AddToScheme
)
View Source
var SchemeGroupVersion = GroupVersion

SchemeGroupVersion is group version used to register these objects.

Functions

func RegisterDefaults

func RegisterDefaults(scheme *runtime.Scheme) error

RegisterDefaults adds defaulters functions to the given scheme. Public to allow building arbitrary schemes. All generated defaulters are covering - they call all nested defaulters.

func Resource

func Resource(resource string) schema.GroupResource

Resource takes an unqualified resource and returns a Group qualified GroupResource

func SetObjectDefaults_CustomMetric

func SetObjectDefaults_CustomMetric(in *CustomMetric)

func SetObjectDefaults_CustomMetricList

func SetObjectDefaults_CustomMetricList(in *CustomMetricList)

Types

type Condition

type Condition struct {
	// Type of condition in CamelCase or in foo.example.com/CamelCase.
	// Many .condition.type values are consistent across resources like Available, but because arbitrary conditions can be
	// useful (see .node.status.conditions), the ability to deconflict is important.
	// The regex it matches is (dns1123SubdomainFmt/)?(qualifiedNameFmt)
	// +kubebuilder:validation:Required
	// +kubebuilder:validation:Pattern=`^([a-z0-9]([-a-z0-9]*[a-z0-9])?(\.[a-z0-9]([-a-z0-9]*[a-z0-9])?)*/)?(([A-Za-z0-9][-A-Za-z0-9_.]*)?[A-Za-z0-9])$`
	// +kubebuilder:validation:MaxLength=316
	Type string `json:"type"`
	// Status of the condition
	// +kubebuilder:validation:Required
	Status ConditionStatus `json:"status"`
	// LastTransitionTime is the last time the condition transitioned from one status to another.
	// This should be when the underlying condition changed.  If that is not known, then using the time when the API field changed is acceptable.
	// +kubebuilder:validation:Required
	// +kubebuilder:validation:Type=string
	// +kubebuilder:validation:Format=date-time
	LastTransitionTime metav1.Time `json:"lastTransitionTime"`
	// Reason contains a programmatic identifier indicating the reason for the condition's last transition.
	// Producers of specific condition types may define expected values and meanings for this field,
	// and whether the values are considered a guaranteed API.
	// The value should be a CamelCase string.
	// This field may not be empty.
	// +kubebuilder:validation:Required
	// +kubebuilder:validation:MaxLength=1024
	// +kubebuilder:validation:MinLength=1
	// +kubebuilder:validation:Pattern=`^[A-Za-z]([A-Za-z0-9_,:]*[A-Za-z0-9_])?$`
	Reason string `json:"reason"`
	// Message is a human readable message indicating details about the transition.
	// This may be an empty string.
	// +kubebuilder:validation:Required
	// +kubebuilder:validation:MaxLength=32768
	Message string `json:"message"`
}

Condition contains details for one aspect of the current state of this API Resource.

func (*Condition) DeepCopy

func (in *Condition) DeepCopy() *Condition

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

func (*Condition) DeepCopyInto

func (in *Condition) DeepCopyInto(out *Condition)

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

type ConditionStatus

type ConditionStatus string

ConditionStatus is the status of a condition. +enum

const (
	// ConditionTrue means a resource is in the condition.
	ConditionTrue ConditionStatus = "True"
	// ConditionFalse means a resource is not in the condition.
	ConditionFalse ConditionStatus = "False"
	// ConditionUnknown means kubernetes can't decide if a resource is in the condition or not.
	ConditionUnknown ConditionStatus = "Unknown"
)

type CustomMetric

type CustomMetric struct {
	//+k8s:conversion-gen=false
	metav1.TypeMeta `json:",inline"`
	// Standard list metadata.
	// More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata
	metav1.ObjectMeta `json:"metadata"`
	// Spec holds spec for resource usage.
	Spec CustomMetricSpec `json:"spec"`
	// Status holds status for resource usage
	//+k8s:conversion-gen=false
	Status CustomMetricStatus `json:"status,omitempty"`
}

CustomMetric provides resource usage for a single pod.

func (*CustomMetric) DeepCopy

func (in *CustomMetric) DeepCopy() *CustomMetric

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

func (*CustomMetric) DeepCopyInto

func (in *CustomMetric) DeepCopyInto(out *CustomMetric)

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

func (*CustomMetric) DeepCopyObject

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

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

type CustomMetricItem

type CustomMetricItem struct {
	// Name is the name for custom metric.
	Name string `json:"name"`
	// Value is the value for custom metric.
	Value *resource.Quantity `json:"value,omitempty"`
}

CustomMetricItem holds spec for custom metric item.

func (*CustomMetricItem) DeepCopy

func (in *CustomMetricItem) DeepCopy() *CustomMetricItem

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

func (*CustomMetricItem) DeepCopyInto

func (in *CustomMetricItem) DeepCopyInto(out *CustomMetricItem)

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

type CustomMetricList

type CustomMetricList struct {
	metav1.TypeMeta `json:",inline"`
	metav1.ListMeta `json:"metadata"`
	Items           []CustomMetric `json:"items"`
}

CustomMetricList is a list of CustomMetric.

func (*CustomMetricList) DeepCopy

func (in *CustomMetricList) DeepCopy() *CustomMetricList

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

func (*CustomMetricList) DeepCopyInto

func (in *CustomMetricList) DeepCopyInto(out *CustomMetricList)

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

func (*CustomMetricList) DeepCopyObject

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

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

type CustomMetricSpec

type CustomMetricSpec struct {
	// ResourceRef specifies the Kind and version of the resource.
	ResourceRef ResourceRef `json:"resourceRef"`
	// Selector is a selector to filter pods to configure.
	Selector *ObjectSelector `json:"selector,omitempty"`
	// Metrics is a list of custom metric.
	Metrics []CustomMetricItem `json:"metrics,omitempty"`
}

CustomMetricSpec holds spec for custom metric.

func (*CustomMetricSpec) DeepCopy

func (in *CustomMetricSpec) DeepCopy() *CustomMetricSpec

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

func (*CustomMetricSpec) DeepCopyInto

func (in *CustomMetricSpec) DeepCopyInto(out *CustomMetricSpec)

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

type CustomMetricStatus

type CustomMetricStatus struct {
	// Conditions holds conditions for custom metric.
	// +patchMergeKey=type
	// +patchStrategy=merge
	// +listType=map
	// +listMapKey=type
	Conditions []Condition `json:"conditions,omitempty" patchStrategy:"merge" patchMergeKey:"type"`
}

CustomMetricStatus holds status for custom metric.

func (*CustomMetricStatus) DeepCopy

func (in *CustomMetricStatus) DeepCopy() *CustomMetricStatus

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

func (*CustomMetricStatus) DeepCopyInto

func (in *CustomMetricStatus) DeepCopyInto(out *CustomMetricStatus)

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

type ExternalMetric

type ExternalMetric struct {
	//+k8s:conversion-gen=false
	metav1.TypeMeta `json:",inline"`
	// Standard list metadata.
	// More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata
	metav1.ObjectMeta `json:"metadata"`
	// Spec holds spec for resource usage.
	Spec ExternalMetricSpec `json:"spec"`
	// Status holds status for resource usage
	//+k8s:conversion-gen=false
	Status ExternalMetricStatus `json:"status,omitempty"`
}

ExternalMetric provides resource usage for a single pod.

func (*ExternalMetric) DeepCopy

func (in *ExternalMetric) DeepCopy() *ExternalMetric

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

func (*ExternalMetric) DeepCopyInto

func (in *ExternalMetric) DeepCopyInto(out *ExternalMetric)

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

func (*ExternalMetric) DeepCopyObject

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

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

type ExternalMetricItem

type ExternalMetricItem struct {
	// Value is the value for external metric.
	Value *resource.Quantity `json:"value,omitempty"`
}

ExternalMetricItem holds spec for external metric item.

func (*ExternalMetricItem) DeepCopy

func (in *ExternalMetricItem) DeepCopy() *ExternalMetricItem

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

func (*ExternalMetricItem) DeepCopyInto

func (in *ExternalMetricItem) DeepCopyInto(out *ExternalMetricItem)

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

type ExternalMetricList

type ExternalMetricList struct {
	metav1.TypeMeta `json:",inline"`
	metav1.ListMeta `json:"metadata"`
	Items           []ExternalMetric `json:"items"`
}

ExternalMetricList is a list of ExternalMetric.

func (*ExternalMetricList) DeepCopy

func (in *ExternalMetricList) DeepCopy() *ExternalMetricList

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

func (*ExternalMetricList) DeepCopyInto

func (in *ExternalMetricList) DeepCopyInto(out *ExternalMetricList)

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

func (*ExternalMetricList) DeepCopyObject

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

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

type ExternalMetricSpec

type ExternalMetricSpec struct {
	// Name is the name of external metric.
	Name string `json:"name,omitempty"`
	// Metrics is a list of external metric.
	Metrics []ExternalMetricItem `json:"metrics,omitempty"`
}

ExternalMetricSpec holds spec for external metric.

func (*ExternalMetricSpec) DeepCopy

func (in *ExternalMetricSpec) DeepCopy() *ExternalMetricSpec

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

func (*ExternalMetricSpec) DeepCopyInto

func (in *ExternalMetricSpec) DeepCopyInto(out *ExternalMetricSpec)

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

type ExternalMetricStatus

type ExternalMetricStatus struct {
	// Conditions holds conditions for external metric.
	// +patchMergeKey=type
	// +patchStrategy=merge
	// +listType=map
	// +listMapKey=type
	Conditions []Condition `json:"conditions,omitempty" patchStrategy:"merge" patchMergeKey:"type"`
}

ExternalMetricStatus holds status for external metric.

func (*ExternalMetricStatus) DeepCopy

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

func (*ExternalMetricStatus) DeepCopyInto

func (in *ExternalMetricStatus) DeepCopyInto(out *ExternalMetricStatus)

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

type ObjectSelector

type ObjectSelector struct {
	// MatchNamespaces is a list of namespaces to match.
	// if not set, all namespaces will be matched.
	MatchNamespaces []string `json:"matchNamespaces,omitempty"`
	// MatchNames is a list of names to match.
	// if not set, all names will be matched.
	MatchNames []string `json:"matchNames,omitempty"`
}

ObjectSelector holds information how to match based on namespace and name.

func (*ObjectSelector) DeepCopy

func (in *ObjectSelector) DeepCopy() *ObjectSelector

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

func (*ObjectSelector) DeepCopyInto

func (in *ObjectSelector) DeepCopyInto(out *ObjectSelector)

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

type ResourceRef

type ResourceRef struct {
	// APIGroup of the referent.
	// +default="v1"
	// +kubebuilder:default="v1"
	APIGroup string `json:"apiGroup,omitempty"`
	// Kind of the referent.
	Kind string `json:"kind"`
}

ResourceRef specifies the kind and version of the resource.

func (*ResourceRef) DeepCopy

func (in *ResourceRef) DeepCopy() *ResourceRef

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

func (*ResourceRef) DeepCopyInto

func (in *ResourceRef) DeepCopyInto(out *ResourceRef)

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