Skip to content

Commit c46b9e2

Browse files
committed
TargetPortNumber int32 to become TargetPorts []Port
# Conflicts: # api/v1/inferencepool_types.go # api/v1/zz_generated.deepcopy.go # client-go/applyconfiguration/api/v1/inferencepoolspec.go
1 parent 4fa525d commit c46b9e2

File tree

6 files changed

+175
-33
lines changed

6 files changed

+175
-33
lines changed

api/v1/inferencepool_types.go

Lines changed: 20 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -61,14 +61,31 @@ type InferencePoolSpec struct {
6161
// +kubebuilder:validation:Required
6262
Selector map[LabelKey]LabelValue `json:"selector"`
6363

64-
// TargetPortNumber defines the port number to access the selected model server Pods.
64+
// TargetPorts defines the ports to access the selected model server Pods.
65+
//
66+
// +kubebuilder:validation:Required
67+
// +kubebuilder:validation:MinItems=1
68+
// +kubebuilder:validation:MaxItems=1
69+
TargetPorts []Port `json:"targetPorts"`
70+
71+
// EndpointPickerConfig specifies the configuration needed by the proxy to discover and connect to the endpoint
72+
// picker service that picks endpoints for the requests routed to this pool.
73+
EndpointPickerConfig `json:",inline"`
74+
}
75+
76+
type Port struct {
77+
// PortNumber defines the port number to access the selected model server Pods.
6578
// The number must be in the range 1 to 65535.
6679
//
6780
// +kubebuilder:validation:Minimum=1
6881
// +kubebuilder:validation:Maximum=65535
6982
// +kubebuilder:validation:Required
70-
TargetPortNumber int32 `json:"targetPortNumber"`
83+
PortNumber int32 `json:"portNumber"`
84+
}
7185

86+
// EndpointPickerConfig specifies the configuration needed by the proxy to discover and connect to the endpoint picker extension.
87+
// This type is intended to be a union of mutually exclusive configuration options that we may add in the future.
88+
type EndpointPickerConfig struct {
7289
// Extension configures an endpoint picker as an extension service.
7390
//
7491
// +kubebuilder:validation:Required
@@ -235,7 +252,7 @@ const (
235252
InferencePoolReasonResolvedRefs InferencePoolReason = "ResolvedRefs"
236253

237254
// This reason is used with the "ResolvedRefs" condition when the
238-
// Extension is invalid in some way. This can include an unsupported kind
255+
// ExtensionRef is invalid in some way. This can include an unsupported kind
239256
// or API group, or a reference to a resource that can not be found.
240257
InferencePoolReasonInvalidExtensionRef InferencePoolReason = "InvalidExtensionRef"
241258
)

api/v1/zz_generated.deepcopy.go

Lines changed: 80 additions & 12 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

client-go/applyconfiguration/api/v1/inferencepoolspec.go

Lines changed: 14 additions & 9 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

client-go/applyconfiguration/api/v1/port.go

Lines changed: 39 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

client-go/applyconfiguration/utils.go

Lines changed: 2 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

config/crd/bases/inference.networking.k8s.io_inferencepools.yaml

Lines changed: 20 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -121,18 +121,29 @@ spec:
121121
If specified, it will be applied to match the model server pods in the same namespace as the InferencePool.
122122
Cross namesoace selector is not supported.
123123
type: object
124-
targetPortNumber:
125-
description: |-
126-
TargetPortNumber defines the port number to access the selected model server Pods.
127-
The number must be in the range 1 to 65535.
128-
format: int32
129-
maximum: 65535
130-
minimum: 1
131-
type: integer
124+
targetPorts:
125+
description: TargetPorts defines the ports to access the selected
126+
model server Pods.
127+
items:
128+
properties:
129+
portNumber:
130+
description: |-
131+
PortNumber defines the port number to access the selected model server Pods.
132+
The number must be in the range 1 to 65535.
133+
format: int32
134+
maximum: 65535
135+
minimum: 1
136+
type: integer
137+
required:
138+
- portNumber
139+
type: object
140+
maxItems: 1
141+
minItems: 1
142+
type: array
132143
required:
133144
- extensionRef
134145
- selector
135-
- targetPortNumber
146+
- targetPorts
136147
type: object
137148
status:
138149
default:

0 commit comments

Comments
 (0)