@@ -21,6 +21,7 @@ import (
2121 "github.com/openstack-k8s-operators/lib-common/modules/common/util"
2222 "k8s.io/apimachinery/pkg/api/resource"
2323 metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
24+ "k8s.io/apimachinery/pkg/runtime"
2425)
2526
2627const (
@@ -45,10 +46,37 @@ const (
4546 // ConsoleContainerImagePF5 is the fall-back console image for PatternFly 5 (OCP < 4.19)
4647 ConsoleContainerImagePF5 = "registry.redhat.io/openshift-lightspeed/lightspeed-console-plugin-pf5-rhel9:1.0.12"
4748
49+ // OKPContainerImage is the fall-back container image for OKP (Offline Knowledge Portal)
50+ OKPContainerImage = "registry.redhat.io/offline-knowledge-portal/rhokp-rhel9:latest"
51+
4852 // MaxTokensForResponseDefault is the default maximum number of tokens that should be used for response
4953 MaxTokensForResponseDefault = 2048
5054)
5155
56+ // DevSpec is the internal structure for the Dev field. Not exposed in the CRD.
57+ // May change at any time without backward compatibility.
58+ type DevSpec struct {
59+ FeatureFlags []string `json:"featureFlags,omitempty"`
60+ OKPChunkFilterQuery string `json:"okpChunkFilterQuery,omitempty"`
61+ OKPRagOnly bool `json:"okpRagOnly,omitempty"`
62+ }
63+
64+ // OKPSpec defines configuration for the Offline Knowledge Portal (OKP).
65+ type OKPSpec struct {
66+ // +kubebuilder:validation:Optional
67+ // +kubebuilder:default=true
68+ // Offline controls how source URLs are resolved.
69+ // When true, uses parent_id (offline/Mimir-style).
70+ // When false, uses reference_url (online).
71+ Offline * bool `json:"offline,omitempty"`
72+
73+ // +kubebuilder:validation:Optional
74+ // AccessKey is the name of the Secret containing the access key for the OKP server.
75+ // The secret must contain a key named "access_key".
76+ // An access key can be obtained from https://access.redhat.com/offline/access
77+ AccessKey string `json:"accessKey,omitempty"`
78+ }
79+
5280// DatabaseSpec defines configuration for persistent PostgreSQL storage.
5381type DatabaseSpec struct {
5482 // +kubebuilder:validation:Optional
@@ -84,6 +112,16 @@ type OpenStackLightspeedSpec struct {
84112 // When omitted, an emptyDir volume is used (data is lost on pod reschedule).
85113 // When set, a PersistentVolumeClaim is created and mounted.
86114 Database * DatabaseSpec `json:"database,omitempty"`
115+
116+ // +kubebuilder:validation:Optional
117+ // OKP configures the Offline Knowledge Portal (OKP) RAG source.
118+ OKP * OKPSpec `json:"okp,omitempty"`
119+
120+ // +kubebuilder:validation:Optional
121+ // +kubebuilder:pruning:PreserveUnknownFields
122+ // Dev contains developer/experimental configuration.
123+ // This section is not part of the stable API and may change at any time without backward compatibility.
124+ Dev runtime.RawExtension `json:"dev,omitempty"`
87125}
88126
89127// LoggingConfig defines logging configuration for OpenStackLightspeed components
@@ -242,6 +280,7 @@ type OpenStackLightspeedDefaults struct {
242280 PostgresImageURL string
243281 ConsoleImageURL string
244282 ConsoleImagePF5URL string
283+ OKPImageURL string
245284 MaxTokensForResponse int
246285}
247286
@@ -263,6 +302,8 @@ func SetupDefaults() {
263302 "RELATED_IMAGE_CONSOLE_IMAGE_URL_DEFAULT" , ConsoleContainerImage ),
264303 ConsoleImagePF5URL : util .GetEnvVar (
265304 "RELATED_IMAGE_CONSOLE_PF5_IMAGE_URL_DEFAULT" , ConsoleContainerImagePF5 ),
305+ OKPImageURL : util .GetEnvVar (
306+ "RELATED_IMAGE_OKP_IMAGE_URL_DEFAULT" , OKPContainerImage ),
266307 MaxTokensForResponse : MaxTokensForResponseDefault ,
267308 }
268309
0 commit comments