@@ -35,8 +35,10 @@ type InferencePool struct {
3535 // +optional
3636 metav1.ObjectMeta `json:"metadata,omitempty"`
3737
38+ // Spec defines the desired state of the InferencePool.
39+ //
3840 // +required
39- Spec InferencePoolSpec `json:"spec,omitzero "`
41+ Spec InferencePoolSpec `json:"spec"`
4042
4143 // Status defines the observed state of the InferencePool.
4244 //
@@ -45,7 +47,7 @@ type InferencePool struct {
4547 Status InferencePoolStatus `json:"status,omitempty"`
4648}
4749
48- // InferencePoolList contains a list of InferencePool .
50+ // InferencePoolList contains a list InferencePools .
4951//
5052// +kubebuilder:object:root=true
5153type InferencePoolList struct {
@@ -54,7 +56,7 @@ type InferencePoolList struct {
5456 Items []InferencePool `json:"items"`
5557}
5658
57- // InferencePoolSpec defines the desired state of InferencePool
59+ // InferencePoolSpec defines the desired state of the InferencePool.
5860type InferencePoolSpec struct {
5961 // Selector determines which Pods are members of this inference pool.
6062 // It matches Pods by their labels only within the same namespace; cross-namespace
@@ -65,19 +67,22 @@ type InferencePoolSpec struct {
6567 // this configuration into a Service resource.
6668 //
6769 // +required
68- Selector LabelSelector `json:"selector,omitempty,omitzero "`
70+ Selector LabelSelector `json:"selector"`
6971
7072 // TargetPorts defines a list of ports that are exposed by this InferencePool.
7173 // Currently, the list may only include a single port definition.
74+ //
7275 // +kubebuilder:validation:MinItems=1
7376 // +kubebuilder:validation:MaxItems=1
7477 // +listType=atomic
7578 // +required
76- TargetPorts []Port `json:"targetPorts,omitempty "`
79+ TargetPorts []Port `json:"targetPorts"`
7780
78- // EndpointPickerRef configures an endpoint picker as an extension service.
81+ // EndpointPickerRef is a reference to the Endpoint Picker extension and its
82+ // associated configuration.
83+ //
7984 // +required
80- EndpointPickerRef EndpointPickerRef `json:"endpointPickerRef,omitempty,omitzero "`
85+ EndpointPickerRef EndpointPickerRef `json:"endpointPickerRef"`
8186}
8287
8388// Port defines the network port that will be exposed by this InferencePool.
@@ -86,21 +91,22 @@ type Port struct {
8691 // The number must be in the range 1 to 65535.
8792 //
8893 // +required
89- Number PortNumber `json:"number,omitempty "`
94+ Number PortNumber `json:"number"`
9095}
9196
92- // Extension specifies how to configure an extension that runs the endpoint picker.
97+ // EndpointPickerRef specifies a reference to an Endpoint Picker extension and its
98+ // associated configuration.
9399type EndpointPickerRef struct {
94- // Group is the group of the referent.
95- // The default value is "", representing the Core API group.
100+ // Group is the group of the referent API object. When unspecified, the default value
101+ // is "", representing the Core API group.
96102 //
97103 // +optional
98104 // +kubebuilder:default=""
99105 Group * Group `json:"group,omitempty"`
100106
101107 // Kind is the Kubernetes resource kind of the referent.
102108 //
103- // Required if the referent is ambiguous( e.g. service with one port is unambiguous) .
109+ // Required if the referent is ambiguous, e.g. service with multiple ports .
104110 //
105111 // Defaults to "Service" when not specified.
106112 //
@@ -112,40 +118,42 @@ type EndpointPickerRef struct {
112118 //
113119 // +optional
114120 // +kubebuilder:default=Service
115- Kind Kind `json:"kind,omitempty"`
121+ Kind * Kind `json:"kind,omitempty"`
116122
117- // Name is the name of the referent.
123+ // Name is the name of the referent API object .
118124 //
119125 // +required
120- Name ObjectName `json:"name,omitempty "`
126+ Name ObjectName `json:"name"`
121127
122- // The port number on the service running the extension. When unspecified,
123- // implementations SHOULD infer a default value of 9002 when the Kind is
124- // Service.
128+ // PortNumber is the port number of the Endpoint Picker extension service . When unspecified,
129+ // implementations SHOULD infer a default value of 9002 when the kind field is "Service" or
130+ // unspecified (defaults to " Service") .
125131 //
126132 // +optional
127133 //nolint:kubeapilinter // ignore kubeapilinter here as we want to use pointer here as 0 usually means all ports.
128134 PortNumber * PortNumber `json:"portNumber,omitempty"`
129135
130- // Configures how the parent handles the case when the extension is not responsive.
131- // Defaults to failClose .
136+ // FailureMode configures how the parent handles the case when the Endpoint Picker extension
137+ // is non-responsive. When unspecified, defaults to "FailClose" .
132138 //
133139 // +optional
134140 // +kubebuilder:default="FailClose"
135- FailureMode ExtensionFailureMode `json:"failureMode,omitempty"`
141+ FailureMode * EndpointPickerFailureMode `json:"failureMode,omitempty"`
136142}
137143
138- // ExtensionFailureMode defines the options for how the parent handles the case when the extension is not
139- // responsive.
144+ // EndpointPickerFailureMode defines the options for how the parent handles the case when the
145+ // Endpoint Picker extension is non-responsive.
146+ //
140147// +kubebuilder:validation:Enum=FailOpen;FailClose
141- type ExtensionFailureMode string
148+ type EndpointPickerFailureMode string
142149
143150const (
144- // FailOpen specifies that the proxy should forward the request to an endpoint of its picking when
145- // the Endpoint Picker fails.
146- FailOpen ExtensionFailureMode = "FailOpen"
147- // FailClose specifies that the proxy should drop the request when the Endpoint Picker fails.
148- FailClose ExtensionFailureMode = "FailClose"
151+ // EndpointPickerFailOpen specifies that the parent should forward the request to an endpoint
152+ // of its picking when the Endpoint Picker extension fails.
153+ EndpointPickerFailOpen EndpointPickerFailureMode = "FailOpen"
154+ // EndpointPickerFailClose specifies that the parent should drop the request when the Endpoint
155+ // Picker extension fails.
156+ EndpointPickerFailClose EndpointPickerFailureMode = "FailClose"
149157)
150158
151159// InferencePoolStatus defines the observed state of the InferencePool.
@@ -190,7 +198,7 @@ type ParentStatus struct {
190198 // resource, such as a Gateway.
191199 //
192200 // +required
193- ParentRef ParentReference `json:"parentRef,omitzero "`
201+ ParentRef ParentReference `json:"parentRef"`
194202}
195203
196204// InferencePoolConditionType is a type of status condition for the InferencePool.
@@ -205,7 +213,7 @@ const (
205213 //
206214 // Possible reasons for this condition to be True are:
207215 //
208- // * "Accepted "
216+ // * "SupportedByParent "
209217 //
210218 // Possible reasons for this condition to be False are:
211219 //
@@ -221,8 +229,9 @@ const (
221229 InferencePoolConditionAccepted InferencePoolConditionType = "Accepted"
222230
223231 // InferencePoolReasonAccepted is a reason used with the "Accepted" condition
224- // when the InferencePool has been accepted by the Parent.
225- InferencePoolReasonAccepted InferencePoolReason = "Accepted"
232+ // when the InferencePool is accepted by a Parent because the Parent supports
233+ // InferencePool as a backend.
234+ InferencePoolReasonAccepted InferencePoolReason = "SupportedByParent"
226235
227236 // InferencePoolReasonNotSupportedByParent is a reason used with the "Accepted"
228237 // condition when the InferencePool has not been accepted by a Parent because
0 commit comments