Skip to content

Commit b4fe73b

Browse files
committed
configuration implementation
Signed-off-by: Shmuel Kallner <[email protected]>
1 parent 1aed90e commit b4fe73b

25 files changed

+1637
-28
lines changed

PROJECT

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,4 +24,12 @@ resources:
2424
kind: InferenceModel
2525
path: sigs.k8s.io/gateway-api-inference-extension/api/v1alpha1
2626
version: v1alpha1
27+
- api:
28+
crdVersion: v1
29+
namespaced: true
30+
domain: x-k8s.io
31+
group: inference
32+
kind: EndpointPickerConfig
33+
path: sigs.k8s.io/gateway-api-inference-extension/api/config/v1alpha1
34+
version: v1alpha1
2735
version: "3"

api/config/v1alpha1/defaults.go

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
/*
2+
Copyright 2025 The Kubernetes Authors.
3+
4+
Licensed under the Apache License, Version 2.0 (the "License");
5+
you may not use this file except in compliance with the License.
6+
You may obtain a copy of the License at
7+
8+
http://www.apache.org/licenses/LICENSE-2.0
9+
10+
Unless required by applicable law or agreed to in writing, software
11+
distributed under the License is distributed on an "AS IS" BASIS,
12+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13+
See the License for the specific language governing permissions and
14+
limitations under the License.
15+
*/
16+
17+
package v1alpha1
18+
19+
// SetDefaults_EndpointPickerConfig sets default values in a
20+
// EndpointPickerConfig struct.
21+
//
22+
// This naming convension is required by the defalter-gen code.
23+
func SetDefaults_EndpointPickerConfig(cfg *EndpointPickerConfig) {
24+
25+
}

api/config/v1alpha1/doc.go

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
/*
2+
Copyright 2025 The Kubernetes Authors.
3+
4+
Licensed under the Apache License, Version 2.0 (the "License");
5+
you may not use this file except in compliance with the License.
6+
You may obtain a copy of the License at
7+
8+
http://www.apache.org/licenses/LICENSE-2.0
9+
10+
Unless required by applicable law or agreed to in writing, software
11+
distributed under the License is distributed on an "AS IS" BASIS,
12+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13+
See the License for the specific language governing permissions and
14+
limitations under the License.
15+
*/
16+
17+
// Package v1alpha1 contains API Schema definitions for the
18+
// inference.networking.x-k8s.io API group.
19+
//
20+
// +kubebuilder:object:generate=true
21+
// +groupName=inference.networking.x-k8s.io
22+
package v1alpha1
Lines changed: 62 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,62 @@
1+
/*
2+
Copyright 2025 The Kubernetes Authors.
3+
4+
Licensed under the Apache License, Version 2.0 (the "License");
5+
you may not use this file except in compliance with the License.
6+
You may obtain a copy of the License at
7+
8+
http://www.apache.org/licenses/LICENSE-2.0
9+
10+
Unless required by applicable law or agreed to in writing, software
11+
distributed under the License is distributed on an "AS IS" BASIS,
12+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13+
See the License for the specific language governing permissions and
14+
limitations under the License.
15+
*/
16+
17+
package v1alpha1
18+
19+
import (
20+
"encoding/json"
21+
22+
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
23+
)
24+
25+
// +k8s:defaulter-gen=true
26+
// +kubebuilder:object:root=true
27+
28+
// EndpointPickerConfig is the Schema for the endpointpickerconfigs API
29+
type EndpointPickerConfig struct {
30+
metav1.TypeMeta `json:",inline"`
31+
32+
// +required
33+
// +kubebuilder:validation:Required
34+
Plugins map[string]PluginSpec `json:"plugins"`
35+
36+
// +required
37+
// +kubebuilder:validation:Required
38+
SchedulingProfiles map[string]SchedulingProfile `json:"schedulingProfiles"`
39+
}
40+
type PluginSpec struct {
41+
// +required
42+
// +kubebuilder:validation:Required
43+
PluginName string `json:"pluginName"`
44+
45+
// +optional
46+
Parameters json.RawMessage `json:"parameters"`
47+
}
48+
49+
type SchedulingProfile struct {
50+
// +required
51+
// +kubebuilder:validation:Required
52+
Plugins []SchedulingProfilePlugin `json:"plugins"`
53+
}
54+
55+
type SchedulingProfilePlugin struct {
56+
// +required
57+
// +kubebuilder:validation:Required
58+
PluginRef string `json:"pluginRef"`
59+
60+
// +optional
61+
Weight *int `json:"weight"`
62+
}

api/config/v1alpha1/zz_generated.deepcopy.go

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

api/config/v1alpha1/zz_generated.defaults.go

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

api/config/v1alpha1/zz_generated.register.go

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

0 commit comments

Comments
 (0)