Skip to content

Commit 24f2af3

Browse files
committed
[OSPRH-16305] Introduce OpenStackLightspeed
Introduce the OpenStackLightspeed custom resource that manages the deployment of Lightspeed-related functionalities. As of now, we expect the OLS operator to be present in the cluster; otherise, enabling OpenStackLightspeed will fail. The Lightspeed functionalities can be enbled through OpenStackControlPlane: openstacklightspeed: enabled: true template: llmEndpoint: "https://models.com" llmEndpointType: "rhelai_vllm" llmCredentials: <secret_name> modelName: "/data/granite-3.1-8b-instruct" TLSCACertBundle: <CM name> Only one OpenStackControlPlane CR can configure OpenStack Lightspeed at a single time. If the user tries to manage the Lightspeed functionalities through two or more OpenStackControlPlanes, it will fail. Current limitations of the implementation: - We use uns.unstructured{} to work with OLSConfig [1] due to Go version incompatibilities between the OLS operator and openstack-operator. - The changes are cluster-wide. They will not work nicely if other services are installed. [1] https://github.com/openshift/lightspeed-operator/blob/main/api/v1alpha1/olsconfig_types.go Shorten webhook_suite_test.go Discover Index ID Discover Index ID by spawning a pod with the rag-content container image. By inspecting the value stored in INDEX_NAME env variable we can conclude what Index ID value should be utilized [1]. This is only temporarly solution until the IndexID gets removed from required fields in OLSConfig. [1] https://github.com/openstack-lightspeed/rag-content/blob/5e8339870c3600120bf6080e68a6ffb14a115d61/Containerfile#L53C5-L53C15 Rename TLSCACertBundle field to tlsCACertBundle Mark LLMCredentials and TLSCACertBundle optional This commit marks the LLMCredentials and TLSCACertBundle as optional. Also it ensures that when patching the OLSConfig Optional values are checked for nil. If an optional value is not set it won't be added into the patched OLSConfig. Mark llmCredentials as required The llmCredentials parameter is required in OLSConfig and therefore should remain as required in our CRD as well. Also, do not pass the tlsCACertBundle value to OLSConfig when it is nil as it is an optional parameter. Rename TLSCACertBundle in config/sample Remove rights for olsconfig/{status,finalizers} Fix finalizers removal in reconcileDelete Remove Optional from LLMCredentials Rename LightSpeed to Lightspeed
1 parent 5f8fbc7 commit 24f2af3

42 files changed

Lines changed: 2146 additions & 1 deletion

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -137,7 +137,7 @@ help: ## Display this help.
137137
manifests: controller-gen ## Generate WebhookConfiguration, ClusterRole and CustomResourceDefinition objects.
138138
mkdir -p config/operator/rbac && \
139139
$(CONTROLLER_GEN) crd$(CRDDESC_OVERRIDE) output:crd:artifacts:config=config/crd/bases webhook paths="./..." && \
140-
$(CONTROLLER_GEN) rbac:roleName=manager-role paths="{./apis/client/...,./apis/core/...,./apis/dataplane/...,./controllers/client/...,./controllers/core/...,./controllers/dataplane/...,./pkg/...}" output:dir=config/rbac && \
140+
$(CONTROLLER_GEN) rbac:roleName=manager-role paths="{./apis/lightspeed/...,./apis/client/...,./apis/core/...,./apis/dataplane/...,./controllers/lightspeed/...,./controllers/client/...,./controllers/core/...,./controllers/dataplane/...,./pkg/...}" output:dir=config/rbac && \
141141
$(CONTROLLER_GEN) rbac:roleName=operator-role paths="./controllers/operator/..." paths="./apis/operator/..." output:dir=config/operator/rbac && \
142142
rm -f apis/bases/* && cp -a config/crd/bases apis/
143143

PROJECT

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -86,4 +86,17 @@ resources:
8686
kind: OpenStack
8787
path: github.com/openstack-k8s-operators/openstack-operator/apis/operator/v1beta1
8888
version: v1beta1
89+
- api:
90+
crdVersion: v1
91+
namespaced: true
92+
controller: true
93+
domain: openstack.org
94+
group: lightspeed
95+
kind: OpenStackLightspeed
96+
path: github.com/openstack-k8s-operators/openstack-operator/apis/lightspeed/v1beta1
97+
version: v1beta1
98+
webhooks:
99+
defaulting: true
100+
validation: true
101+
webhookVersion: v1
89102
version: "3"

apis/bases/core.openstack.org_openstackcontrolplanes.yaml

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11727,6 +11727,38 @@ spec:
1172711727
- openStackConfigSecret
1172811728
type: object
1172911729
type: object
11730+
openstacklightspeed:
11731+
properties:
11732+
enabled:
11733+
default: false
11734+
type: boolean
11735+
template:
11736+
properties:
11737+
llmCredentials:
11738+
type: string
11739+
llmEndpoint:
11740+
type: string
11741+
llmEndpointType:
11742+
enum:
11743+
- azure_openai
11744+
- bam
11745+
- openai
11746+
- watsonx
11747+
- rhoai_vllm
11748+
- rhelai_vllm
11749+
- fake_provider
11750+
type: string
11751+
modelName:
11752+
type: string
11753+
tlsCACertBundle:
11754+
type: string
11755+
required:
11756+
- llmCredentials
11757+
- llmEndpoint
11758+
- llmEndpointType
11759+
- modelName
11760+
type: object
11761+
type: object
1173011762
ovn:
1173111763
properties:
1173211764
enabled:
@@ -18769,6 +18801,8 @@ spec:
1876918801
type: string
1877018802
openstackClientImage:
1877118803
type: string
18804+
openstackLightspeedImage:
18805+
type: string
1877218806
osContainerImage:
1877318807
type: string
1877418808
ovnControllerImage:

apis/bases/core.openstack.org_openstackversions.yaml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -191,6 +191,8 @@ spec:
191191
type: string
192192
openstackClientImage:
193193
type: string
194+
openstackLightspeedImage:
195+
type: string
194196
osContainerImage:
195197
type: string
196198
ovnControllerImage:
@@ -413,6 +415,8 @@ spec:
413415
type: string
414416
openstackClientImage:
415417
type: string
418+
openstackLightspeedImage:
419+
type: string
416420
osContainerImage:
417421
type: string
418422
ovnControllerImage:
@@ -605,6 +609,8 @@ spec:
605609
type: string
606610
openstackClientImage:
607611
type: string
612+
openstackLightspeedImage:
613+
type: string
608614
osContainerImage:
609615
type: string
610616
ovnControllerImage:
Lines changed: 88 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,88 @@
1+
---
2+
apiVersion: apiextensions.k8s.io/v1
3+
kind: CustomResourceDefinition
4+
metadata:
5+
annotations:
6+
controller-gen.kubebuilder.io/version: v0.14.0
7+
name: openstacklightspeeds.lightspeed.openstack.org
8+
spec:
9+
group: lightspeed.openstack.org
10+
names:
11+
kind: OpenStackLightspeed
12+
listKind: OpenStackLightspeedList
13+
plural: openstacklightspeeds
14+
singular: openstacklightspeed
15+
scope: Namespaced
16+
versions:
17+
- name: v1beta1
18+
schema:
19+
openAPIV3Schema:
20+
properties:
21+
apiVersion:
22+
type: string
23+
kind:
24+
type: string
25+
metadata:
26+
type: object
27+
spec:
28+
properties:
29+
llmCredentials:
30+
type: string
31+
llmEndpoint:
32+
type: string
33+
llmEndpointType:
34+
enum:
35+
- azure_openai
36+
- bam
37+
- openai
38+
- watsonx
39+
- rhoai_vllm
40+
- rhelai_vllm
41+
- fake_provider
42+
type: string
43+
modelName:
44+
type: string
45+
ragImage:
46+
type: string
47+
tlsCACertBundle:
48+
type: string
49+
required:
50+
- llmCredentials
51+
- llmEndpoint
52+
- llmEndpointType
53+
- modelName
54+
- ragImage
55+
type: object
56+
status:
57+
properties:
58+
conditions:
59+
items:
60+
properties:
61+
lastTransitionTime:
62+
format: date-time
63+
type: string
64+
message:
65+
type: string
66+
reason:
67+
type: string
68+
severity:
69+
type: string
70+
status:
71+
type: string
72+
type:
73+
type: string
74+
required:
75+
- lastTransitionTime
76+
- status
77+
- type
78+
type: object
79+
type: array
80+
observedGeneration:
81+
format: int64
82+
type: integer
83+
type: object
84+
type: object
85+
served: true
86+
storage: true
87+
subresources:
88+
status: {}

apis/core/v1beta1/conditions.go

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -90,6 +90,9 @@ const (
9090
// OpenStackControlPlaneClientReadyCondition Status=True condition which indicates if OpenStackClient is configured and operational
9191
OpenStackControlPlaneClientReadyCondition condition.Type = "OpenStackControlPlaneClientReady"
9292

93+
// OpenStackControlPlaneLightspeedReadyCondition Status=True condition which indicates if OpenStackLightspeed is configured and operational
94+
OpenStackControlPlaneLightspeedReadyCondition condition.Type = "OpenStackControlPlaneLightspeedReady"
95+
9396
// OpenStackClientReadyCondition Status=True condition which indicates if OpenStackClient is configured and operational
9497
OpenStackClientReadyCondition condition.Type = "OpenStackClientReady"
9598

@@ -325,6 +328,15 @@ const (
325328
// OpenStackControlPlaneClientReadyErrorMessage
326329
OpenStackControlPlaneClientReadyErrorMessage = "OpenStackControlPlane Client error occured %s"
327330

331+
// OpenStackControlPlaneLightspeedReadyErrorMessage
332+
OpenStackControlPlaneLightspeedReadyErrorMessage = "OpenStackControlPlane Lightspeed error occured %s"
333+
334+
// OpenStackControlPlaneLightspeedReadyRunningMessage
335+
OpenStackControlPlaneLightspeedReadyRunningMessage = "OpenStackControlPlane Lightspeed in progress"
336+
337+
// OpenStackControlPlaneLightspeedReadyMessage
338+
OpenStackControlPlaneLightspeedReadyMessage = "OpenStackControlPlane Lightspeed completed"
339+
328340
// OpenStackControlPlaneHorizonReadyInitMessage
329341
OpenStackControlPlaneHorizonReadyInitMessage = "OpenStackControlPlane Horizon not started"
330342

apis/core/v1beta1/openstackcontrolplane_types.go

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,7 @@ import (
4343
novav1 "github.com/openstack-k8s-operators/nova-operator/api/v1beta1"
4444
octaviav1 "github.com/openstack-k8s-operators/octavia-operator/api/v1beta1"
4545
"github.com/openstack-k8s-operators/openstack-operator/apis/client/v1beta1"
46+
lightspeedv1 "github.com/openstack-k8s-operators/openstack-operator/apis/lightspeed/v1beta1"
4647
ovnv1 "github.com/openstack-k8s-operators/ovn-operator/api/v1beta1"
4748
placementv1 "github.com/openstack-k8s-operators/placement-operator/api/v1beta1"
4849
swiftv1 "github.com/openstack-k8s-operators/swift-operator/api/v1beta1"
@@ -199,6 +200,11 @@ type OpenStackControlPlaneSpec struct {
199200
// OpenStackClient - Parameters related to the OpenStackClient
200201
OpenStackClient OpenStackClientSection `json:"openstackclient,omitempty"`
201202

203+
// +kubebuilder:validation:Optional
204+
// +operator-sdk:csv:customresourcedefinitions:type=spec,displayName="OpenStack Lightspeed"
205+
// OpenStackLightspeed - Parameters related to the OpenStackLightspeed
206+
OpenStackLightspeed OpenStackLightspeedSection `json:"openstacklightspeed,omitempty"`
207+
202208
// ExtraMounts containing conf files and credentials that should be provided
203209
// to the underlying operators.
204210
// This struct can be defined in the top level CR and propagated to the
@@ -798,6 +804,20 @@ type OpenStackClientSection struct {
798804
Template v1beta1.OpenStackClientSpecCore `json:"template,omitempty"`
799805
}
800806

807+
// OpenStackLightspeedSection defines the desired state of the OpenStackLightspeed
808+
type OpenStackLightspeedSection struct {
809+
// +kubebuilder:validation:Optional
810+
// Enabled - Whether the OpenStack LightSpeed service should be deployed and managed
811+
// +kubebuilder:default=false
812+
// +operator-sdk:csv:customresourcedefinitions:type=spec,xDescriptors={"urn:alm:descriptor:com.tectonic.ui:booleanSwitch"}
813+
Enabled bool `json:"enabled"`
814+
815+
// +kubebuilder:validation:Optional
816+
// +operator-sdk:csv:customresourcedefinitions:type=spec
817+
// Template - Overrides to use when creating the OpenStackLightspeed Resource
818+
Template *lightspeedv1.OpenStackLightspeedCore `json:"template,omitempty"`
819+
}
820+
801821
// OpenStackControlPlaneStatus defines the observed state of OpenStackControlPlane
802822
type OpenStackControlPlaneStatus struct {
803823
// +operator-sdk:csv:customresourcedefinitions:type=status,xDescriptors={"urn:alm:descriptor:io.kubernetes.conditions"}

apis/core/v1beta1/openstackversion_types.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -164,6 +164,7 @@ type ContainerTemplate struct {
164164
TestTobikoImage *string `json:"testTobikoImage,omitempty"`
165165
TestHorizontestImage *string `json:"testHorizontestImage,omitempty"`
166166
TestAnsibletestImage *string `json:"testAnsibletestImage,omitempty"`
167+
OpenstackLightspeedImage *string `json:"openstackLightspeedImage,omitempty"`
167168
}
168169

169170
// ServiceDefaults - struct that contains defaults for OSP services that can change over time

apis/core/v1beta1/zz_generated.deepcopy.go

Lines changed: 27 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
/*
2+
Copyright 2025.
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 v1beta1
18+
19+
import (
20+
condition "github.com/openstack-k8s-operators/lib-common/modules/common/condition"
21+
)
22+
23+
// OpenStackLightspeed Condition Types used by API objects.
24+
const (
25+
// OpenStackLightspeedReadyCondition Status=True condition which indicates if OpenStackLightspeedReadyCondition
26+
// is configured and operational
27+
OpenStackLightspeedReadyCondition condition.Type = "OpenStackLightspeedReady"
28+
)
29+
30+
// Common Messages used by API objects.
31+
const (
32+
// OpenStackLightspeedReadyInitMessage
33+
OpenStackLightspeedReadyInitMessage = "OpenStack Lightspeed not started"
34+
35+
// OpenStackLightspeedReadyMessage
36+
OpenStackLightspeedReadyMessage = "OpenStack Lightspeed created"
37+
)

0 commit comments

Comments
 (0)