Skip to content

Commit 380eacf

Browse files
committed
Merge branch 'rq-54596' of github.com:ryancham715/models-as-a-service into ryan/rq-54596
2 parents 3c267b3 + 0d2907e commit 380eacf

File tree

32 files changed

+5592
-100
lines changed

32 files changed

+5592
-100
lines changed

deployment/base/maas-controller/crd/bases/maas.opendatahub.io_maasmodelrefs.yaml

Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,25 @@ spec:
5555
spec:
5656
description: MaaSModelSpec defines the desired state of MaaSModelRef
5757
properties:
58+
credentialRef:
59+
description: |-
60+
CredentialRef references a Kubernetes Secret containing the provider API key.
61+
The Secret must contain a data key "api-key" with the credential value.
62+
Only used when modelRef.kind=ExternalModel.
63+
properties:
64+
name:
65+
description: Name is the name of the Secret
66+
maxLength: 253
67+
minLength: 1
68+
type: string
69+
namespace:
70+
description: Namespace is the namespace of the Secret. Defaults
71+
to the MaaSModelRef namespace if omitted.
72+
maxLength: 253
73+
type: string
74+
required:
75+
- name
76+
type: object
5877
endpointOverride:
5978
description: |-
6079
EndpointOverride, when set, overrides the endpoint URL that the controller
@@ -64,6 +83,16 @@ spec:
6483
modelRef:
6584
description: ModelRef references the actual model endpoint
6685
properties:
86+
endpoint:
87+
description: |-
88+
Endpoint is the FQDN of the external provider (no scheme or path).
89+
e.g. "api.openai.com". Only used when kind=ExternalModel.
90+
This field is metadata for downstream consumers (e.g. BBR provider-resolver plugin)
91+
and is not used by the controller for endpoint derivation. Use spec.endpointOverride
92+
to override the controller-derived endpoint.
93+
maxLength: 253
94+
pattern: ^[a-zA-Z0-9]([a-zA-Z0-9\-]*[a-zA-Z0-9])?(\.[a-zA-Z0-9]([a-zA-Z0-9\-]*[a-zA-Z0-9])?)*$
95+
type: string
6796
kind:
6897
description: Kind determines which fields are available
6998
enum:
@@ -73,10 +102,20 @@ spec:
73102
name:
74103
description: Name is the name of the model resource
75104
type: string
105+
provider:
106+
description: |-
107+
Provider identifies the API format and auth type for external models.
108+
e.g. "openai", "anthropic". Only used when kind=ExternalModel.
109+
maxLength: 63
110+
type: string
76111
required:
77112
- kind
78113
- name
79114
type: object
115+
x-kubernetes-validations:
116+
- message: provider is required when kind is ExternalModel
117+
rule: self.kind != 'ExternalModel' || has(self.provider) && self.provider
118+
!= ''
80119
required:
81120
- modelRef
82121
type: object

maas-controller/api/maas/v1alpha1/maasmodelref_types.go

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,16 +29,50 @@ type MaaSModelSpec struct {
2929
// or Gateway/HTTPRoute).
3030
// +optional
3131
EndpointOverride string `json:"endpointOverride,omitempty"`
32+
// CredentialRef references a Kubernetes Secret containing the provider API key.
33+
// The Secret must contain a data key "api-key" with the credential value.
34+
// Only used when modelRef.kind=ExternalModel.
35+
// +optional
36+
CredentialRef *CredentialReference `json:"credentialRef,omitempty"`
37+
}
38+
39+
// CredentialReference references a Kubernetes Secret with provider API credentials.
40+
type CredentialReference struct {
41+
// Name is the name of the Secret
42+
// +kubebuilder:validation:MinLength=1
43+
// +kubebuilder:validation:MaxLength=253
44+
Name string `json:"name"`
45+
// Namespace is the namespace of the Secret. Defaults to the MaaSModelRef namespace if omitted.
46+
// +kubebuilder:validation:MaxLength=253
47+
// +optional
48+
Namespace string `json:"namespace,omitempty"`
3249
}
3350

3451
// ModelReference references a model endpoint in the same namespace
52+
// +kubebuilder:validation:XValidation:rule="self.kind != 'ExternalModel' || has(self.provider) && self.provider != ''",message="provider is required when kind is ExternalModel"
3553
type ModelReference struct {
3654
// Kind determines which fields are available
3755
// +kubebuilder:validation:Enum=LLMInferenceService;ExternalModel
3856
Kind string `json:"kind"`
3957

4058
// Name is the name of the model resource
4159
Name string `json:"name"`
60+
61+
// Provider identifies the API format and auth type for external models.
62+
// e.g. "openai", "anthropic". Only used when kind=ExternalModel.
63+
// +kubebuilder:validation:MaxLength=63
64+
// +optional
65+
Provider string `json:"provider,omitempty"`
66+
67+
// Endpoint is the FQDN of the external provider (no scheme or path).
68+
// e.g. "api.openai.com". Only used when kind=ExternalModel.
69+
// This field is metadata for downstream consumers (e.g. BBR provider-resolver plugin)
70+
// and is not used by the controller for endpoint derivation. Use spec.endpointOverride
71+
// to override the controller-derived endpoint.
72+
// +kubebuilder:validation:MaxLength=253
73+
// +kubebuilder:validation:Pattern=`^[a-zA-Z0-9]([a-zA-Z0-9\-]*[a-zA-Z0-9])?(\.[a-zA-Z0-9]([a-zA-Z0-9\-]*[a-zA-Z0-9])?)*$`
74+
// +optional
75+
Endpoint string `json:"endpoint,omitempty"`
4276
}
4377

4478
// MaaSModelStatus defines the observed state of MaaSModelRef

maas-controller/api/maas/v1alpha1/zz_generated.deepcopy.go

Lines changed: 21 additions & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

maas-controller/go.mod

Lines changed: 19 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -14,29 +14,30 @@ require (
1414
)
1515

1616
require (
17-
cel.dev/expr v0.19.2 // indirect
17+
cel.dev/expr v0.25.1 // indirect
1818
cloud.google.com/go v0.118.3 // indirect
1919
cloud.google.com/go/auth v0.15.0 // indirect
2020
cloud.google.com/go/auth/oauth2adapt v0.2.8 // indirect
21-
cloud.google.com/go/compute/metadata v0.6.0 // indirect
21+
cloud.google.com/go/compute/metadata v0.9.0 // indirect
2222
cloud.google.com/go/iam v1.4.1 // indirect
2323
cloud.google.com/go/monitoring v1.24.1 // indirect
2424
cloud.google.com/go/storage v1.51.0 // indirect
25-
github.com/GoogleCloudPlatform/opentelemetry-operations-go/detectors/gcp v1.25.0 // indirect
25+
github.com/GoogleCloudPlatform/opentelemetry-operations-go/detectors/gcp v1.30.0 // indirect
2626
github.com/GoogleCloudPlatform/opentelemetry-operations-go/exporter/metric v0.51.0 // indirect
2727
github.com/GoogleCloudPlatform/opentelemetry-operations-go/internal/resourcemapping v0.51.0 // indirect
2828
github.com/aws/aws-sdk-go v1.55.6 // indirect
2929
github.com/beorn7/perks v1.0.1 // indirect
3030
github.com/cespare/xxhash/v2 v2.3.0 // indirect
31-
github.com/cncf/xds/go v0.0.0-20250121191232-2f005788dc42 // indirect
31+
github.com/cncf/xds/go v0.0.0-20251210132809-ee656c7534f5 // indirect
3232
github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc // indirect
3333
github.com/emicklei/go-restful/v3 v3.12.2 // indirect
34-
github.com/envoyproxy/go-control-plane/envoy v1.32.4 // indirect
35-
github.com/envoyproxy/protoc-gen-validate v1.2.1 // indirect
34+
github.com/envoyproxy/go-control-plane/envoy v1.36.0 // indirect
35+
github.com/envoyproxy/protoc-gen-validate v1.3.0 // indirect
3636
github.com/evanphx/json-patch/v5 v5.9.11 // indirect
3737
github.com/felixge/httpsnoop v1.0.4 // indirect
3838
github.com/fsnotify/fsnotify v1.9.0 // indirect
3939
github.com/fxamacker/cbor/v2 v2.8.0 // indirect
40+
github.com/go-jose/go-jose/v4 v4.1.3 // indirect
4041
github.com/go-logr/stdr v1.2.2 // indirect
4142
github.com/go-logr/zapr v1.3.0 // indirect
4243
github.com/go-openapi/jsonpointer v0.21.1 // indirect
@@ -68,9 +69,10 @@ require (
6869
github.com/prometheus/common v0.64.0 // indirect
6970
github.com/prometheus/procfs v0.16.1 // indirect
7071
github.com/spf13/pflag v1.0.6 // indirect
72+
github.com/spiffe/go-spiffe/v2 v2.6.0 // indirect
7173
github.com/x448/float16 v0.8.4 // indirect
7274
go.opentelemetry.io/auto/sdk v1.2.1 // indirect
73-
go.opentelemetry.io/contrib/detectors/gcp v1.34.0 // indirect
75+
go.opentelemetry.io/contrib/detectors/gcp v1.39.0 // indirect
7476
go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc v0.59.0 // indirect
7577
go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.60.0 // indirect
7678
go.opentelemetry.io/otel v1.40.0 // indirect
@@ -80,21 +82,21 @@ require (
8082
go.opentelemetry.io/otel/trace v1.40.0 // indirect
8183
go.uber.org/multierr v1.11.0 // indirect
8284
go.uber.org/zap v1.27.0 // indirect
83-
golang.org/x/crypto v0.45.0 // indirect
84-
golang.org/x/net v0.47.0 // indirect
85-
golang.org/x/oauth2 v0.30.0 // indirect
86-
golang.org/x/sync v0.18.0 // indirect
85+
golang.org/x/crypto v0.46.0 // indirect
86+
golang.org/x/net v0.48.0 // indirect
87+
golang.org/x/oauth2 v0.34.0 // indirect
88+
golang.org/x/sync v0.19.0 // indirect
8789
golang.org/x/sys v0.40.0 // indirect
88-
golang.org/x/term v0.37.0 // indirect
89-
golang.org/x/text v0.31.0 // indirect
90+
golang.org/x/term v0.38.0 // indirect
91+
golang.org/x/text v0.32.0 // indirect
9092
golang.org/x/time v0.12.0 // indirect
9193
gomodules.xyz/jsonpatch/v2 v2.5.0 // indirect
9294
google.golang.org/api v0.228.0 // indirect
9395
google.golang.org/genproto v0.0.0-20250303144028-a0af3efb3deb // indirect
94-
google.golang.org/genproto/googleapis/api v0.0.0-20250303144028-a0af3efb3deb // indirect
95-
google.golang.org/genproto/googleapis/rpc v0.0.0-20250313205543-e70fdf4c4cb4 // indirect
96-
google.golang.org/grpc v1.71.1 // indirect
97-
google.golang.org/protobuf v1.36.6 // indirect
96+
google.golang.org/genproto/googleapis/api v0.0.0-20251202230838-ff82c1b0f217 // indirect
97+
google.golang.org/genproto/googleapis/rpc v0.0.0-20251202230838-ff82c1b0f217 // indirect
98+
google.golang.org/grpc v1.79.3 // indirect
99+
google.golang.org/protobuf v1.36.10 // indirect
98100
gopkg.in/evanphx/json-patch.v4 v4.12.0 // indirect
99101
gopkg.in/go-playground/validator.v9 v9.31.0 // indirect
100102
gopkg.in/inf.v0 v0.9.1 // indirect

0 commit comments

Comments
 (0)