cue.dev/x/k8s.io@v0.12.0

api/autoscaling/v1/schema.cue raw

  1package v1
  2
  3import "cue.dev/x/k8s.io/apimachinery/pkg/apis/meta/v1"
  4
  5// CrossVersionObjectReference contains enough information to let you identify
  6// the referred resource.
  7#CrossVersionObjectReference: {
  8	// apiVersion is the API version of the referent
  9	"apiVersion"?: string
 10
 11	// kind is the kind of the referent; More info:
 12	// https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds
 13	"kind"!: string
 14
 15	// name is the name of the referent; More info:
 16	// https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names
 17	"name"!: string
 18}
 19
 20// configuration of a horizontal pod autoscaler.
 21#HorizontalPodAutoscaler: {
 22	// APIVersion defines the versioned schema of this representation of an object.
 23	// Servers should convert recognized schemas to the latest internal value, and
 24	// may reject unrecognized values. More info:
 25	// https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources
 26	"apiVersion": "autoscaling/v1"
 27
 28	// Kind is a string value representing the REST resource this object represents.
 29	// Servers may infer this from the endpoint the client submits requests to.
 30	// Cannot be updated. In CamelCase. More info:
 31	// https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds
 32	"kind": "HorizontalPodAutoscaler"
 33
 34	// Standard object metadata. More info:
 35	// https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata
 36	"metadata"?: v1.#ObjectMeta
 37
 38	// spec defines the behaviour of autoscaler. More info:
 39	// https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#spec-and-status.
 40	"spec"!: #HorizontalPodAutoscalerSpec
 41
 42	// status is the current information about the autoscaler.
 43	"status"?: #HorizontalPodAutoscalerStatus
 44}
 45
 46// list of horizontal pod autoscaler objects.
 47#HorizontalPodAutoscalerList: {
 48	// APIVersion defines the versioned schema of this representation of an object.
 49	// Servers should convert recognized schemas to the latest internal value, and
 50	// may reject unrecognized values. More info:
 51	// https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources
 52	"apiVersion": "autoscaling/v1"
 53
 54	// items is the list of horizontal pod autoscaler objects.
 55	"items"!: [...#HorizontalPodAutoscaler]
 56
 57	// Kind is a string value representing the REST resource this object represents.
 58	// Servers may infer this from the endpoint the client submits requests to.
 59	// Cannot be updated. In CamelCase. More info:
 60	// https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds
 61	"kind": "HorizontalPodAutoscalerList"
 62
 63	// Standard list metadata.
 64	"metadata"?: v1.#ListMeta
 65}
 66
 67// specification of a horizontal pod autoscaler.
 68#HorizontalPodAutoscalerSpec: {
 69	// maxReplicas is the upper limit for the number of pods that can be set by the
 70	// autoscaler; cannot be smaller than MinReplicas.
 71	"maxReplicas"!: int32 & int
 72
 73	// minReplicas is the lower limit for the number of replicas to which the
 74	// autoscaler can scale down. It defaults to 1 pod. minReplicas is allowed to
 75	// be 0 if the alpha feature gate HPAScaleToZero is enabled and at least one
 76	// Object or External metric is configured. Scaling is active as long as at
 77	// least one metric value is available.
 78	"minReplicas"?: int32 & int
 79
 80	// reference to scaled resource; horizontal pod autoscaler will learn the
 81	// current resource consumption and will set the desired number of pods by
 82	// using its Scale subresource.
 83	"scaleTargetRef"!: #CrossVersionObjectReference
 84
 85	// targetCPUUtilizationPercentage is the target average CPU utilization
 86	// (represented as a percentage of requested CPU) over all the pods; if not
 87	// specified the default autoscaling policy will be used.
 88	"targetCPUUtilizationPercentage"?: int32 & int
 89}
 90
 91// current status of a horizontal pod autoscaler
 92#HorizontalPodAutoscalerStatus: {
 93	// currentCPUUtilizationPercentage is the current average CPU utilization over
 94	// all pods, represented as a percentage of requested CPU, e.g. 70 means that
 95	// an average pod is using now 70% of its requested CPU.
 96	"currentCPUUtilizationPercentage"?: int32 & int
 97
 98	// currentReplicas is the current number of replicas of pods managed by this autoscaler.
 99	"currentReplicas"!: int32 & int
100
101	// desiredReplicas is the desired number of replicas of pods managed by this autoscaler.
102	"desiredReplicas"!: int32 & int
103
104	// lastScaleTime is the last time the HorizontalPodAutoscaler scaled the number
105	// of pods; used by the autoscaler to control how often the number of pods is
106	// changed.
107	"lastScaleTime"?: v1.#Time
108
109	// observedGeneration is the most recent generation observed by this autoscaler.
110	"observedGeneration"?: int64 & int
111}
112
113// Scale represents a scaling request for a resource.
114#Scale: {
115	// APIVersion defines the versioned schema of this representation of an object.
116	// Servers should convert recognized schemas to the latest internal value, and
117	// may reject unrecognized values. More info:
118	// https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources
119	"apiVersion": "autoscaling/v1"
120
121	// Kind is a string value representing the REST resource this object represents.
122	// Servers may infer this from the endpoint the client submits requests to.
123	// Cannot be updated. In CamelCase. More info:
124	// https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds
125	"kind": "Scale"
126
127	// Standard object metadata; More info:
128	// https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata.
129	"metadata"?: v1.#ObjectMeta
130
131	// spec defines the behavior of the scale. More info:
132	// https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#spec-and-status.
133	"spec"?: #ScaleSpec
134
135	// status is the current status of the scale. More info:
136	// https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#spec-and-status.
137	// Read-only.
138	"status"?: #ScaleStatus
139}
140
141// ScaleSpec describes the attributes of a scale subresource.
142#ScaleSpec: {
143	// replicas is the desired number of instances for the scaled object.
144	"replicas"?: int32 & int
145}
146
147// ScaleStatus represents the current status of a scale subresource.
148#ScaleStatus: {
149	// replicas is the actual number of observed instances of the scaled object.
150	"replicas"!: int32 & int
151
152	// selector is the label query over pods that should match the replicas count.
153	// This is same as the label selector but in the string format to avoid
154	// introspection by clients. The string will be in the same format as the
155	// query-param syntax. More info about label selectors:
156	// https://kubernetes.io/docs/concepts/overview/working-with-objects/labels/
157	"selector"?: string
158}