Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
31 changes: 30 additions & 1 deletion api/v1alpha1/olsconfig_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ import (
corev1 "k8s.io/api/core/v1"
resource "k8s.io/apimachinery/pkg/api/resource"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
runtime "k8s.io/apimachinery/pkg/runtime"
)

// OLSConfigSpec defines the desired state of OLSConfig
Expand All @@ -36,6 +37,7 @@ type OLSConfigSpec struct {
// +operator-sdk:csv:customresourcedefinitions:type=spec,displayName="OLS Data Collector Settings"
OLSDataCollectorConfig OLSDataCollectorSpec `json:"olsDataCollector,omitempty"`
// MCP Server settings
// +kubebuilder:validation:MaxItems=20
// +operator-sdk:csv:customresourcedefinitions:type=spec,displayName="MCP Server Settings"
MCPServers []MCPServerConfig `json:"mcpServers,omitempty"`
// Feature Gates holds list of features to be enabled explicitly, otherwise they are disabled by default.
Expand Down Expand Up @@ -160,6 +162,7 @@ const (
// LLMSpec defines the desired state of the large language model (LLM).
type LLMSpec struct {
// +kubebuilder:validation:Required
// +kubebuilder:validation:MaxItems=10
// +required
// +operator-sdk:csv:customresourcedefinitions:type=spec,displayName="Providers"
Providers []ProviderSpec `json:"providers"`
Expand Down Expand Up @@ -443,6 +446,11 @@ type ModelSpec struct {
// ProviderSpec defines the desired state of LLM provider.
// +kubebuilder:validation:XValidation:message="'deploymentName' must be specified for 'azure_openai' provider",rule="self.type != \"azure_openai\" || self.deploymentName != \"\""
// +kubebuilder:validation:XValidation:message="'projectID' must be specified for 'watsonx' provider",rule="self.type != \"watsonx\" || self.projectID != \"\""
// +kubebuilder:validation:XValidation:message="'providerType' and 'config' must be used together in llamaStackGeneric mode",rule="!has(self.providerType) || has(self.config)"
// +kubebuilder:validation:XValidation:message="'config' requires 'providerType' to be set",rule="!has(self.config) || has(self.providerType)"
// +kubebuilder:validation:XValidation:message="Llama Stack Generic mode (providerType set) requires type='llamaStackGeneric'",rule="!has(self.providerType) || self.type == \"llamaStackGeneric\""
// +kubebuilder:validation:XValidation:message="Llama Stack Generic mode cannot use legacy provider-specific fields",rule="self.type != \"llamaStackGeneric\" || (!has(self.deploymentName) && !has(self.projectID))"
// +kubebuilder:validation:XValidation:message="credentialKey must not be empty or whitespace",rule="!has(self.credentialKey) || !self.credentialKey.matches('^[ \\t\\n\\r]*$')"
type ProviderSpec struct {
// Provider name
// +kubebuilder:validation:Required
Expand All @@ -460,13 +468,14 @@ type ProviderSpec struct {
CredentialsSecretRef corev1.LocalObjectReference `json:"credentialsSecretRef"`
// List of models from the provider
// +kubebuilder:validation:Required
// +kubebuilder:validation:MaxItems=50
// +required
// +operator-sdk:csv:customresourcedefinitions:type=spec,displayName="Models"
Models []ModelSpec `json:"models"`
// Provider type
// +kubebuilder:validation:Required
// +required
// +kubebuilder:validation:Enum=azure_openai;bam;openai;watsonx;rhoai_vllm;rhelai_vllm;fake_provider
// +kubebuilder:validation:Enum=azure_openai;bam;openai;watsonx;rhoai_vllm;rhelai_vllm;fake_provider;llamaStackGeneric
// +operator-sdk:csv:customresourcedefinitions:type=spec,displayName="Provider Type"
Type string `json:"type"`
// Azure OpenAI deployment name
Expand All @@ -485,6 +494,25 @@ type ProviderSpec struct {
// +kubebuilder:validation:Optional
// +operator-sdk:csv:customresourcedefinitions:type=spec,displayName="TLS Security Profile",xDescriptors={"urn:alm:descriptor:com.tectonic.ui:advanced"}
TLSSecurityProfile *configv1.TLSSecurityProfile `json:"tlsSecurityProfile,omitempty"`
// Llama Stack Generic provider type for provider configuration (e.g., "remote::openai", "inline::sentence-transformers")
// When set, this provider uses Llama Stack Generic mode instead of legacy mode.
// Must follow pattern: (inline|remote)::<provider-name>
// +kubebuilder:validation:Pattern=`^(inline|remote)::[a-z0-9][a-z0-9_-]*$`
// +operator-sdk:csv:customresourcedefinitions:type=spec,displayName="Llama Stack Provider Type"
ProviderType string `json:"providerType,omitempty"`
// Arbitrary configuration for the provider (Llama Stack Generic mode only)
// This map is passed directly to Llama Stack provider configuration.
// Credentials are automatically injected as environment variable substitutions.
// Example: {"url": "https://...", "custom_field": "value"}
// +kubebuilder:pruning:PreserveUnknownFields
// +operator-sdk:csv:customresourcedefinitions:type=spec,displayName="Llama Stack Provider Config"
Config *runtime.RawExtension `json:"config,omitempty"`
// Secret key name for provider credentials (defaults to "apitoken" if not set)
// Specifies which key in credentialsSecretRef contains the API token.
// The operator creates an environment variable named {PROVIDER_NAME}_API_KEY.
// +kubebuilder:validation:Optional
// +operator-sdk:csv:customresourcedefinitions:type=spec,displayName="Credential Key Name"
CredentialKey string `json:"credentialKey,omitempty"`
}

// UserDataCollectionSpec defines how we collect user data.
Expand Down Expand Up @@ -679,6 +707,7 @@ type MCPServerConfig struct {
// Headers to send to the MCP server
// Each header can reference a secret or use a special source (kubernetes token, client token)
// +optional
// +kubebuilder:validation:MaxItems=20
// +operator-sdk:csv:customresourcedefinitions:type=spec,displayName="Headers"
Headers []MCPHeader `json:"headers,omitempty"`
}
Expand Down
7 changes: 6 additions & 1 deletion api/v1alpha1/zz_generated.deepcopy.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

23 changes: 22 additions & 1 deletion bundle/manifests/lightspeed-operator.clusterserviceversion.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,9 @@ spec:
- description: The name of the secret object that stores API provider credentials
displayName: Credential Secret
path: llm.providers[0].credentialsSecretRef
- description: 'Feature Gates holds list of features to be enabled explicitly, otherwise they are disabled by default. possible values: MCPServer, ToolFiltering'
- description: |-
Feature Gates holds list of features to be enabled explicitly, otherwise they are disabled by default.
possible values: MCPServer, ToolFiltering
displayName: Feature Gates
path: featureGates
- displayName: LLM Settings
Expand All @@ -91,6 +93,19 @@ spec:
- description: API Version for Azure OpenAI provider
displayName: Azure OpenAI API Version
path: llm.providers[0].apiVersion
- description: |-
Arbitrary configuration for the provider (Llama Stack Generic mode only)
This map is passed directly to Llama Stack provider configuration.
Credentials are automatically injected as environment variable substitutions.
Example: {"url": "https://...", "custom_field": "value"}
displayName: Llama Stack Provider Config
path: llm.providers[0].config
- description: |-
Secret key name for provider credentials (defaults to "apitoken" if not set)
Specifies which key in credentialsSecretRef contains the API token.
The operator creates an environment variable named {PROVIDER_NAME}_API_KEY.
displayName: Credential Key Name
path: llm.providers[0].credentialKey
- description: Azure OpenAI deployment name
displayName: Azure OpenAI deployment name
path: llm.providers[0].deploymentName
Expand Down Expand Up @@ -118,6 +133,12 @@ spec:
- description: Watsonx Project ID
displayName: Watsonx Project ID
path: llm.providers[0].projectID
- description: |-
Llama Stack Generic provider type for provider configuration (e.g., "remote::openai", "inline::sentence-transformers")
When set, this provider uses Llama Stack Generic mode instead of legacy mode.
Must follow pattern: (inline|remote)::<provider-name>
displayName: Llama Stack Provider Type
path: llm.providers[0].providerType
- description: TLS Security Profile used by connection to provider
displayName: TLS Security Profile
path: llm.providers[0].tlsSecurityProfile
Expand Down
41 changes: 41 additions & 0 deletions bundle/manifests/ols.openshift.io_olsconfigs.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,20 @@ spec:
apiVersion:
description: API Version for Azure OpenAI provider
type: string
config:
description: |-
Arbitrary configuration for the provider (Llama Stack Generic mode only)
This map is passed directly to Llama Stack provider configuration.
Credentials are automatically injected as environment variable substitutions.
Example: {"url": "https://...", "custom_field": "value"}
type: object
x-kubernetes-preserve-unknown-fields: true
credentialKey:
description: |-
Secret key name for provider credentials (defaults to "apitoken" if not set)
Specifies which key in credentialsSecretRef contains the API token.
The operator creates an environment variable named {PROVIDER_NAME}_API_KEY.
type: string
credentialsSecretRef:
description: The name of the secret object that stores API
provider credentials
Expand Down Expand Up @@ -111,13 +125,21 @@ spec:
required:
- name
type: object
maxItems: 50
type: array
name:
description: Provider name
type: string
projectID:
description: Watsonx Project ID
type: string
providerType:
description: |-
Llama Stack Generic provider type for provider configuration (e.g., "remote::openai", "inline::sentence-transformers")
When set, this provider uses Llama Stack Generic mode instead of legacy mode.
Must follow pattern: (inline|remote)::<provider-name>
pattern: ^(inline|remote)::[a-z0-9][a-z0-9_-]*$
type: string
tlsSecurityProfile:
description: TLS Security Profile used by connection to
provider
Expand Down Expand Up @@ -259,6 +281,7 @@ spec:
- rhoai_vllm
- rhelai_vllm
- fake_provider
- llamaStackGeneric
type: string
url:
description: Provider API URL
Expand All @@ -278,6 +301,22 @@ spec:
- message: '''projectID'' must be specified for ''watsonx''
provider'
rule: self.type != "watsonx" || self.projectID != ""
- message: '''providerType'' and ''config'' must be used together
in llamaStackGeneric mode'
rule: '!has(self.providerType) || has(self.config)'
- message: '''config'' requires ''providerType'' to be set'
rule: '!has(self.config) || has(self.providerType)'
- message: Llama Stack Generic mode (providerType set) requires
type='llamaStackGeneric'
rule: '!has(self.providerType) || self.type == "llamaStackGeneric"'
- message: Llama Stack Generic mode cannot use legacy provider-specific
fields
rule: self.type != "llamaStackGeneric" || (!has(self.deploymentName)
&& !has(self.projectID))
- message: credentialKey must not be empty or whitespace
rule: '!has(self.credentialKey) || !self.credentialKey.matches(''^[
\t\n\r]*$'')'
maxItems: 10
type: array
required:
- providers
Expand Down Expand Up @@ -347,6 +386,7 @@ spec:
- name
- valueFrom
type: object
maxItems: 20
type: array
name:
description: Name of the MCP server
Expand All @@ -364,6 +404,7 @@ spec:
- name
- url
type: object
maxItems: 20
type: array
ols:
description: OLSSpec defines the desired state of OLS deployment.
Expand Down
2 changes: 1 addition & 1 deletion bundle/metadata/annotations.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ annotations:
operators.operatorframework.io.bundle.package.v1: lightspeed-operator
operators.operatorframework.io.bundle.channels.v1: alpha
operators.operatorframework.io.bundle.channel.default.v1: alpha
operators.operatorframework.io.metrics.builder: operator-sdk-v1.33.0
operators.operatorframework.io.metrics.builder: operator-sdk-v1.36.1
operators.operatorframework.io.metrics.mediatype.v1: metrics+v1
operators.operatorframework.io.metrics.project_layout: go.kubebuilder.io/v4
# Annotations for testing.
Expand Down
41 changes: 41 additions & 0 deletions config/crd/bases/ols.openshift.io_olsconfigs.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,20 @@ spec:
apiVersion:
description: API Version for Azure OpenAI provider
type: string
config:
description: |-
Arbitrary configuration for the provider (Llama Stack Generic mode only)
This map is passed directly to Llama Stack provider configuration.
Credentials are automatically injected as environment variable substitutions.
Example: {"url": "https://...", "custom_field": "value"}
type: object
x-kubernetes-preserve-unknown-fields: true
credentialKey:
description: |-
Secret key name for provider credentials (defaults to "apitoken" if not set)
Specifies which key in credentialsSecretRef contains the API token.
The operator creates an environment variable named {PROVIDER_NAME}_API_KEY.
type: string
credentialsSecretRef:
description: The name of the secret object that stores API
provider credentials
Expand Down Expand Up @@ -111,13 +125,21 @@ spec:
required:
- name
type: object
maxItems: 50
type: array
name:
description: Provider name
type: string
projectID:
description: Watsonx Project ID
type: string
providerType:
description: |-
Llama Stack Generic provider type for provider configuration (e.g., "remote::openai", "inline::sentence-transformers")
When set, this provider uses Llama Stack Generic mode instead of legacy mode.
Must follow pattern: (inline|remote)::<provider-name>
pattern: ^(inline|remote)::[a-z0-9][a-z0-9_-]*$
type: string
tlsSecurityProfile:
description: TLS Security Profile used by connection to
provider
Expand Down Expand Up @@ -259,6 +281,7 @@ spec:
- rhoai_vllm
- rhelai_vllm
- fake_provider
- llamaStackGeneric
type: string
url:
description: Provider API URL
Expand All @@ -278,6 +301,22 @@ spec:
- message: '''projectID'' must be specified for ''watsonx''
provider'
rule: self.type != "watsonx" || self.projectID != ""
- message: '''providerType'' and ''config'' must be used together
in llamaStackGeneric mode'
rule: '!has(self.providerType) || has(self.config)'
- message: '''config'' requires ''providerType'' to be set'
rule: '!has(self.config) || has(self.providerType)'
- message: Llama Stack Generic mode (providerType set) requires
type='llamaStackGeneric'
rule: '!has(self.providerType) || self.type == "llamaStackGeneric"'
- message: Llama Stack Generic mode cannot use legacy provider-specific
fields
rule: self.type != "llamaStackGeneric" || (!has(self.deploymentName)
&& !has(self.projectID))
- message: credentialKey must not be empty or whitespace
rule: '!has(self.credentialKey) || !self.credentialKey.matches(''^[
\t\n\r]*$'')'
maxItems: 10
type: array
required:
- providers
Expand Down Expand Up @@ -347,6 +386,7 @@ spec:
- name
- valueFrom
type: object
maxItems: 20
type: array
name:
description: Name of the MCP server
Expand All @@ -364,6 +404,7 @@ spec:
- name
- url
type: object
maxItems: 20
type: array
ols:
description: OLSSpec defines the desired state of OLS deployment.
Expand Down
Loading