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