@@ -59,8 +59,86 @@ type InferencePoolSpec struct {
59
59
// +kubebuilder:validation:Maximum=65535
60
60
// +kubebuilder:validation:Required
61
61
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"`
62
82
}
63
83
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
+
64
142
// LabelKey was originally copied from: https://github.com/kubernetes-sigs/gateway-api/blob/99a3934c6bc1ce0874f3a4c5f20cafd8977ffcb4/apis/v1/shared_types.go#L694-L731
65
143
// Duplicated as to not take an unexpected dependency on gw's API.
66
144
//
0 commit comments