@@ -38,9 +38,8 @@ type InferencePool struct {
38
38
// +required
39
39
Spec InferencePoolSpec `json:"spec,omitzero"`
40
40
41
- // Status defines the observed state of InferencePool.
41
+ // Status defines the observed state of the InferencePool.
42
42
//
43
- // +kubebuilder:default={parent: {{parentRef: {kind: "Status", name: "default"}, conditions: {{type: "Accepted", status: "Unknown", reason: "Pending", message: "Waiting for controller", lastTransitionTime: "1970-01-01T00:00:00Z"}}}}}
44
43
// +optional
45
44
Status InferencePoolStatus `json:"status,omitzero"`
46
45
}
@@ -145,57 +144,59 @@ const (
145
144
FailClose ExtensionFailureMode = "FailClose"
146
145
)
147
146
148
- // InferencePoolStatus defines the observed state of InferencePool.
149
- // +kubebuilder:validation:MinProperties=1
147
+ // InferencePoolStatus defines the observed state of the InferencePool.
150
148
type InferencePoolStatus struct {
151
- // Parents is a list of parent resources (usually Gateways) that are
152
- // associated with the InferencePool, and the status of the InferencePool with respect to
153
- // each parent.
149
+ // Parents is a list of parent resources, typically Gateways, that are associated with
150
+ // the InferencePool, and the status of the InferencePool with respect to each parent.
154
151
//
155
- // A maximum of 32 Gateways will be represented in this list. When the list contains
156
- // `kind: Status, name: default`, it indicates that the InferencePool is not
157
- // associated with any Gateway and a controller must perform the following:
152
+ // A controller that manages the InferencePool, must add an entry for each parent it manages
153
+ // and remove the parent entry when the controller no longer considers the InferencePool to
154
+ // be associated with that parent.
158
155
//
159
- // - Remove the parent when setting the "Accepted" condition.
160
- // - Add the parent when the controller will no longer manage the InferencePool
161
- // and no other parents exist.
156
+ // A maximum of 32 parents will be represented in this list. When the list is empty,
157
+ // it indicates that the InferencePool is not associated with any parents.
162
158
//
163
159
// +kubebuilder:validation:MaxItems=32
164
160
// +optional
165
161
// +listType=atomic
166
162
Parents []PoolStatus `json:"parent,omitempty"`
167
163
}
168
164
169
- // PoolStatus defines the observed state of InferencePool from a Gateway .
165
+ // PoolStatus defines the observed state of the InferencePool .
170
166
type PoolStatus struct {
171
- // Conditions track the state of the InferencePool.
167
+ // Conditions is a list of status conditions that provide information about the observed
168
+ // state of the InferencePool. This field is required to be set by the controller that
169
+ // manages the InferencePool.
172
170
//
173
171
// Known condition types are:
174
172
//
175
173
// * "Accepted"
176
174
// * "ResolvedRefs"
177
175
//
178
- // +optional
176
+ // +required
179
177
// +listType=map
180
178
// +listMapKey=type
179
+ // +kubebuilder:validation:MinItems=1
181
180
// +kubebuilder:validation:MaxItems=8
182
- // +kubebuilder:default={{type: "Accepted", status: "Unknown", reason:"Pending", message:"Waiting for controller", lastTransitionTime: "1970-01-01T00:00:00Z"}}
183
- Conditions []metav1.Condition `json:"conditions,omitempty"`
181
+ Conditions []metav1.Condition `json:"conditions"`
184
182
185
- // GatewayRef indicates the gateway that observed state of InferencePool.
183
+ // ParentRef is used to identify the parent resource that this status
184
+ // is associated with. It is used to match the InferencePool with the parent
185
+ // resource, such as a Gateway.
186
+ //
186
187
// +required
187
- GatewayRef ParentGatewayReference `json:"parentRef,omitzero "`
188
+ ParentRef ParentReference `json:"parentRef"`
188
189
}
189
190
190
- // InferencePoolConditionType is a type of condition for the InferencePool
191
+ // InferencePoolConditionType is a type of status condition for the InferencePool.
191
192
type InferencePoolConditionType string
192
193
193
- // InferencePoolReason is the reason for a given InferencePoolConditionType
194
+ // InferencePoolReason is the reason for a type of InferencePool status condition.
194
195
type InferencePoolReason string
195
196
196
197
const (
197
- // This condition indicates whether the InferencePool has been accepted or rejected
198
- // by a Gateway, and why.
198
+ // InferencePoolConditionAccepted is a type of condition that indicates whether
199
+ // the InferencePool has been accepted or rejected by a Gateway, and why.
199
200
//
200
201
// Possible reasons for this condition to be True are:
201
202
//
@@ -214,18 +215,19 @@ const (
214
215
// prefer to use the reasons listed above to improve interoperability.
215
216
InferencePoolConditionAccepted InferencePoolConditionType = "Accepted"
216
217
217
- // This reason is used with the "Accepted" condition when the InferencePool has been
218
- // accepted by the Gateway.
218
+ // InferencePoolReasonAccepted is a reason used with the "Accepted" condition
219
+ // when the InferencePool has been accepted by the Gateway.
219
220
InferencePoolReasonAccepted InferencePoolReason = "Accepted"
220
221
221
- // This reason is used with the "Accepted" condition when the InferencePool
222
- // has not been accepted by a Gateway because the Gateway does not support
223
- // InferencePool as a backend.
222
+ // InferencePoolReasonNotSupportedByGateway is a reason used with the "Accepted"
223
+ // condition when the InferencePool has not been accepted by a Gateway because
224
+ // the Gateway does not support InferencePool as a backend.
224
225
InferencePoolReasonNotSupportedByGateway InferencePoolReason = "NotSupportedByGateway"
225
226
226
- // This reason is used with the "Accepted" condition when the InferencePool is
227
- // referenced by an HTTPRoute that has been rejected by the Gateway. The user
228
- // should inspect the status of the referring HTTPRoute for the specific reason.
227
+ // InferencePoolReasonHTTPRouteNotAccepted is a reason used with the "Accepted"
228
+ // condition when the InferencePool is referenced by an HTTPRoute that has been
229
+ // rejected by the Gateway. The user should inspect the status of the referring
230
+ // HTTPRoute for the specific reason.
229
231
InferencePoolReasonHTTPRouteNotAccepted InferencePoolReason = "HTTPRouteNotAccepted"
230
232
231
233
// This reason is used with the "Accepted" when a controller has not yet
@@ -234,8 +236,8 @@ const (
234
236
)
235
237
236
238
const (
237
- // This condition indicates whether the controller was able to resolve all
238
- // the object references for the InferencePool.
239
+ // InferencePoolConditionResolvedRefs is a type of condition that indicates whether
240
+ // the controller was able to resolve all the object references for the InferencePool.
239
241
//
240
242
// Possible reasons for this condition to be True are:
241
243
//
@@ -249,39 +251,42 @@ const (
249
251
// prefer to use the reasons listed above to improve interoperability.
250
252
InferencePoolConditionResolvedRefs InferencePoolConditionType = "ResolvedRefs"
251
253
252
- // This reason is used with the "ResolvedRefs" condition when the condition
253
- // is true.
254
+ // InferencePoolReasonResolvedRefs is a reason used with the "ResolvedRefs"
255
+ // condition when the condition is true.
254
256
InferencePoolReasonResolvedRefs InferencePoolReason = "ResolvedRefs"
255
257
256
- // This reason is used with the "ResolvedRefs" condition when the
257
- // Extension is invalid in some way. This can include an unsupported kind
258
- // or API group, or a reference to a resource that can not be found.
258
+ // InferencePoolReasonInvalidExtensionRef is a reason used with the "ResolvedRefs"
259
+ // condition when the Extension is invalid in some way. This can include an
260
+ // unsupported kind or API group, or a reference to a resource that cannot be found.
259
261
InferencePoolReasonInvalidExtensionRef InferencePoolReason = "InvalidExtensionRef"
260
262
)
261
263
262
- // ParentGatewayReference identifies an API object including its namespace,
263
- // defaulting to Gateway.
264
- type ParentGatewayReference struct {
265
- // Group is the group of the referent.
264
+ // ParentReference identifies an API object. It is used to associate the InferencePool with a
265
+ // parent resource, such as a Gateway.
266
+ type ParentReference struct {
267
+ // Group is the group of the referent API object. When unspecified, the referent is assumed
268
+ // to be in the "gateway.networking.k8s.io" API group.
266
269
//
267
270
// +optional
268
271
// +kubebuilder:default="gateway.networking.k8s.io"
269
272
Group * Group `json:"group,omitempty"`
270
273
271
- // Kind is kind of the referent. For example "Gateway".
274
+ // Kind is the kind of the referent API object. When unspecified, the referent is assumed
275
+ // to be a "Gateway" kind.
272
276
//
273
277
// +optional
274
278
// +kubebuilder:default=Gateway
275
- Kind Kind `json:"kind,omitempty"`
279
+ Kind * Kind `json:"kind,omitempty"`
276
280
277
- // Name is the name of the referent.
281
+ // Name is the name of the referent API object.
282
+ //
278
283
// +required
279
- Name ObjectName `json:"name,omitempty "`
284
+ Name ObjectName `json:"name"`
280
285
281
- // Namespace is the namespace of the referent. If not present ,
282
- // the namespace of the referent is assumed to be the same as
283
- // the namespace of the referring object.
286
+ // Namespace is the namespace of the referent API object. When unspecified ,
287
+ // the namespace of the referent is assumed to be the same as the namespace
288
+ // of the referring object.
284
289
//
285
290
// +optional
286
- Namespace Namespace `json:"namespace,omitempty"`
291
+ Namespace * Namespace `json:"namespace,omitempty"`
287
292
}
0 commit comments