diff --git a/api/v1alpha2/inferencepool_types.go b/api/v1alpha2/inferencepool_types.go index 33759ba61..bffcda617 100644 --- a/api/v1alpha2/inferencepool_types.go +++ b/api/v1alpha2/inferencepool_types.go @@ -31,7 +31,11 @@ type InferencePool struct { metav1.TypeMeta `json:",inline"` metav1.ObjectMeta `json:"metadata,omitempty"` - Spec InferencePoolSpec `json:"spec,omitempty"` + Spec InferencePoolSpec `json:"spec,omitempty"` + + // Status defines the observed state of InferencePool. + // + // +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"}}}}} Status InferencePoolStatus `json:"status,omitempty"` } @@ -150,14 +154,19 @@ const ( FailClose ExtensionFailureMode = "FailClose" ) -// InferencePoolStatus defines the observed state of InferencePool +// InferencePoolStatus defines the observed state of InferencePool. type InferencePoolStatus struct { // Parents is a list of parent resources (usually Gateways) that are - // associated with the route, and the status of the InferencePool with respect to + // associated with the InferencePool, and the status of the InferencePool with respect to // each parent. // - // A maximum of 32 Gateways will be represented in this list. An empty list - // means the route has not been attached to any Gateway. + // A maximum of 32 Gateways will be represented in this list. When the list contains + // `kind: Status, name: default`, it indicates that the InferencePool is not + // associated with any Gateway and a controller must perform the following: + // + // - Remove the parent when setting the "Accepted" condition. + // - Add the parent when the controller will no longer manage the InferencePool + // and no other parents exist. // // +kubebuilder:validation:MaxItems=32 Parents []PoolStatus `json:"parent,omitempty"` @@ -190,7 +199,7 @@ type InferencePoolConditionType string type InferencePoolReason string const ( - // This condition indicates whether the route has been accepted or rejected + // This condition indicates whether the InferencePool has been accepted or rejected // by a Gateway, and why. // // Possible reasons for this condition to be True are: @@ -209,7 +218,7 @@ const ( // prefer to use the reasons listed above to improve interoperability. InferencePoolConditionAccepted InferencePoolConditionType = "Accepted" - // This reason is used with the "Accepted" condition when the Route has been + // This reason is used with the "Accepted" condition when the InferencePool has been // accepted by the Gateway. InferencePoolReasonAccepted InferencePoolReason = "Accepted" @@ -219,7 +228,7 @@ const ( InferencePoolReasonNotSupportedByGateway InferencePoolReason = "NotSupportedByGateway" // This reason is used with the "Accepted" when a controller has not yet - // reconciled the route. + // reconciled the InferencePool. InferencePoolReasonPending InferencePoolReason = "Pending" ) diff --git a/config/crd/bases/inference.networking.x-k8s.io_inferencepools.yaml b/config/crd/bases/inference.networking.x-k8s.io_inferencepools.yaml index 8386db82c..db342d034 100644 --- a/config/crd/bases/inference.networking.x-k8s.io_inferencepools.yaml +++ b/config/crd/bases/inference.networking.x-k8s.io_inferencepools.yaml @@ -134,16 +134,32 @@ spec: - targetPortNumber type: object status: - description: InferencePoolStatus defines the observed state of InferencePool + default: + parent: + - conditions: + - lastTransitionTime: "1970-01-01T00:00:00Z" + message: Waiting for controller + reason: Pending + status: Unknown + type: Accepted + parentRef: + kind: Status + name: default + description: Status defines the observed state of InferencePool. properties: parent: description: |- Parents is a list of parent resources (usually Gateways) that are - associated with the route, and the status of the InferencePool with respect to + associated with the InferencePool, and the status of the InferencePool with respect to each parent. - A maximum of 32 Gateways will be represented in this list. An empty list - means the route has not been attached to any Gateway. + A maximum of 32 Gateways will be represented in this list. When the list contains + `kind: Status, name: default`, it indicates that the InferencePool is not + associated with any Gateway and a controller must perform the following: + + - Remove the parent when setting the "Accepted" condition. + - Add the parent when the controller will no longer manage the InferencePool + and no other parents exist. items: description: PoolStatus defines the observed state of InferencePool from a Gateway.