Skip to content

Commit f006714

Browse files
committed
InferencePool Config API
1 parent 4448a4b commit f006714

9 files changed

+474
-2
lines changed

api/v1alpha1/inferencepool_types.go

+78
Original file line numberDiff line numberDiff line change
@@ -59,8 +59,86 @@ type InferencePoolSpec struct {
5959
// +kubebuilder:validation:Maximum=65535
6060
// +kubebuilder:validation:Required
6161
TargetPortNumber int32 `json:"targetPortNumber"`
62+
63+
// EndpointPickerConfig configures the extension that runs the endpoint picking service.
64+
// to this pool.
65+
EndpointPickerConfig `json:"endpointPickerConfig"`
66+
}
67+
68+
type EndpointPickerConfig struct {
69+
// Extension configures an endpoint picker as an extension service.
70+
//
71+
// +optional
72+
Extension *ExtensionConfig `json:"extension"`
73+
}
74+
75+
// ExtensionConfig specifies how to configure an extension that runs the endpoint picker.
76+
type ExtensionConfig struct {
77+
// ExtensionRef is a reference to a service extension.
78+
ExtensionRef *ExtensionReference `json:"extensionRef"`
79+
80+
// ExtensionConnection configures the connection between the gateway and the extension.
81+
ExtensionConnection `json:"extensionConnection"`
6282
}
6383

84+
// ExtensionReference is a reference to the extension deployment.
85+
type ExtensionReference struct {
86+
// Group is the group of the referent.
87+
// When unspecified or empty string, core API group is inferred.
88+
//
89+
// +optional
90+
// +kubebuilder:default=""
91+
Group *string `json:"group,omitempty"`
92+
93+
// Kind is the Kubernetes resource kind of the referent. For example
94+
// "Service".
95+
//
96+
// Defaults to "Service" when not specified.
97+
//
98+
// ExternalName services can refer to CNAME DNS records that may live
99+
// outside of the cluster and as such are difficult to reason about in
100+
// terms of conformance. They also may not be safe to forward to (see
101+
// CVE-2021-25740 for more information). Implementations SHOULD NOT
102+
// support ExternalName Services.
103+
//
104+
// Support: Core (Services with a type other than ExternalName)
105+
//
106+
// Support: Implementation-specific (Services with type ExternalName)
107+
//
108+
// +optional
109+
// +kubebuilder:default=Service
110+
Kind *string `json:"kind,omitempty"`
111+
112+
// Name is the name of the referent.
113+
Name string `json:"name"`
114+
}
115+
116+
// ExtensionConnection encapsulates options that configures the connection to the extension.
117+
type ExtensionConnection struct {
118+
// The port number on the pods running the extension. Defaults to 9002 if not set.
119+
//
120+
// +kubebuilder:default=9002
121+
TargetPortNumber *int32 `json:"targetPortNumber"`
122+
123+
// Configures how the gateway handles the case when the extension is not responsive.
124+
// Defaults to failClose.
125+
//
126+
// +kubebuilder:default="FailClose"
127+
FailureMode ExtensionFailureMode `json:"failureMode"`
128+
}
129+
130+
// ExtensionFailureMode defines the options for how the gateway handles the case when the extension is not
131+
// responsive.
132+
// +kubebuilder:validation:Enum=FailOpen;FailClose
133+
type ExtensionFailureMode string
134+
135+
const (
136+
// The endpoint will be selected via the provider’s LB configured algorithm.
137+
FailOpen ExtensionFailureMode = "FailOpen"
138+
// Requests should be dropped.
139+
FailClose ExtensionFailureMode = "FailClose"
140+
)
141+
64142
// LabelKey was originally copied from: https://github.com/kubernetes-sigs/gateway-api/blob/99a3934c6bc1ce0874f3a4c5f20cafd8977ffcb4/apis/v1/shared_types.go#L694-L731
65143
// Duplicated as to not take an unexpected dependency on gw's API.
66144
//

api/v1alpha1/zz_generated.deepcopy.go

+87
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

client-go/applyconfiguration/api/v1alpha1/endpointpickerconfig.go

+38
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

client-go/applyconfiguration/api/v1alpha1/extensionconfig.go

+67
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

client-go/applyconfiguration/api/v1alpha1/extensionconnection.go

+51
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)