Skip to content

Commit dd82de1

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 # Conflicts: # api/v1/zz_generated.deepcopy.go # client-go/applyconfiguration/api/v1/inferencepoolspec.go
1 parent 26c460e commit dd82de1

File tree

6 files changed

+197
-61
lines changed

6 files changed

+197
-61
lines changed

api/v1/inferencepool_types.go

Lines changed: 20 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -62,14 +62,31 @@ type InferencePoolSpec struct {
6262
// +kubebuilder:validation:Required
6363
Selector LabelSelector `json:"selector"`
6464

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

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

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

api/v1/zz_generated.deepcopy.go

Lines changed: 87 additions & 35 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: 29 additions & 14 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
@@ -131,18 +131,29 @@ spec:
131131
required:
132132
- matchLabels
133133
type: object
134-
targetPortNumber:
135-
description: |-
136-
TargetPortNumber defines the port number to access the selected model server Pods.
137-
The number must be in the range 1 to 65535.
138-
format: int32
139-
maximum: 65535
140-
minimum: 1
141-
type: integer
134+
targetPorts:
135+
description: TargetPorts defines the ports to access the selected
136+
model server Pods.
137+
items:
138+
properties:
139+
portNumber:
140+
description: |-
141+
PortNumber defines the port number to access the selected model server Pods.
142+
The number must be in the range 1 to 65535.
143+
format: int32
144+
maximum: 65535
145+
minimum: 1
146+
type: integer
147+
required:
148+
- portNumber
149+
type: object
150+
maxItems: 1
151+
minItems: 1
152+
type: array
142153
required:
143154
- extensionRef
144155
- selector
145-
- targetPortNumber
156+
- targetPorts
146157
type: object
147158
status:
148159
default:

0 commit comments

Comments
 (0)