Skip to content
This repository was archived by the owner on Dec 16, 2025. It is now read-only.

Commit d5f33fb

Browse files
authored
Add controller docs (#46)
Signed-off-by: Matej Feder <[email protected]>
1 parent b2d267d commit d5f33fb

9 files changed

+119
-1
lines changed

README.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -149,6 +149,13 @@ kubectl --kubeconfig kubeconfig.yaml get nodes
149149

150150
Refer to the [doc page](./docs/develop.md) to find more information about how to develop this operator.
151151

152+
# Controllers
153+
154+
CSPO consists of two controllers. They should ensure that the desired node images are present in the targeted OpenStack project.
155+
Refer to the documentation for the CSPO controllers:
156+
- [OpenStackClusterStackRelease controller](./docs/openstackclusterstackrelease-controller.md)
157+
- [OpenStackNodeImageRelease controller](./docs/openstacknodeimagerelease-controller.md)
158+
152159
# API Reference
153160

154161
CSPO currently exposes the following APIs:

docs/develop.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ Next, configure your environment variables. Once that's done, you can initiate d
1414

1515
## Developing with Tilt
1616

17-
![tilt](./pics/tilt.png "Tilt")
17+
![tilt](./images/tilt.png "Tilt")
1818

1919
Operator development requires a lot of iteration, and the “build, tag, push, update deployment” workflow can be very tedious. Tilt makes this process much simpler by watching for updates and automatically building and deploying them. To build a kind cluster and to start Tilt, run:
2020

Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
@startuml openstack-clusterstack-release-controller
2+
3+
start;
4+
:OpenStackClusterStackRelease controller;
5+
6+
repeat
7+
:OpenStackClusterStackRelease controller enqueues a Reconcile call;
8+
:Create GitHub client;
9+
if (Release assets have been download into the CSPO container) then (no)
10+
#LightBlue:Download Release assets;
11+
#Pink:Return RequeueError;
12+
note left: make sure that Release can be accessed
13+
else (yes)
14+
endif
15+
:Load list of required NodeImages from downloaded Release assets;
16+
repeat
17+
#LightBlue:Create OpenStackNodeImageRelease;
18+
if (OpenStackNodeImageRelease already exists) then (yes)
19+
#LightBlue:Ensure addoption of OpenStackNodeImageRelease \n /OpenStackNodeImageRelease could be shared/;
20+
else (no)
21+
#LightBlue:Create OpenStackNodeImageRelease;
22+
endif
23+
repeat while (More NodeImages) is (yes)
24+
:List all owned OpenStackNodeImageReleases in namespace;
25+
if (No owned OpenStackNodeImageReleases found) then (yes)
26+
#Pink:Return RequeueError;
27+
note left: waiting for OpenStackNodeImageRelease to be created
28+
else (no)
29+
endif
30+
repeat
31+
if (OpenStackNodeImageRelease is ready) then (yes)
32+
else (no)
33+
#LightBlue:Set OpenStackClusterStackRelease status to not ready;
34+
#Pink:Return RequeueError;
35+
note left: waiting for OpenStackNodeImageRelease to be ready
36+
endif
37+
repeat while (More owned OpenStackNodeImageReleases) is (yes)
38+
#LightBlue:Set OpenStackClusterStackRelease status to ready;
39+
repeat while (Reconcile returned RequeueError?) is (yes)
40+
if (Reconcile returned error) then (yes)
41+
#Pink:Error reconciling OpenStackClusterStackRelease;
42+
else (no)
43+
endif
44+
stop;
45+
46+
@enduml
85 KB
Loading
Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
@startuml openstack-nodeimage-release-controller
2+
3+
start;
4+
:OpenStackNodeImageRelease controller;
5+
6+
repeat
7+
:OpenStackNodeImageRelease controller enqueues a Reconcile call;
8+
:Load OpenStack Cloud configuration from Secret referenced in spec.IdentityRef;
9+
:Create an OpenStack provider client;
10+
:Create an OpenStack image service client;
11+
if (Is the image specified in spec.Image already part of the OpenStack project?) then (no)
12+
#LightBlue: Create an Image based on the spec.Image.CreateOpts;
13+
#LightBlue: Import an Image using Glance's web-download method;
14+
#Pink:Return RequeueError;
15+
note left: make sure that Image has been created
16+
else (yes)
17+
endif
18+
:Get Image details;
19+
20+
if (Is ImageImportTimeout set?) then (yes)
21+
if (Has the Image a non-Active Status, and has the import elapsed time been exceeded?) then (yes)
22+
#LightBlue:Image Import Timeout;
23+
stop;
24+
else (no)
25+
endif
26+
else (no)
27+
endif
28+
switch (Image Status?)
29+
case ( Active )
30+
#LightBlue:Set OpenStackNodeImageRelease status to ready;
31+
case ( Deactivated or \n Killed or \n Unknown )
32+
#LightBlue:Set OpenStackNodeImageRelease status to not ready;
33+
case ( Queued or \n Saving or \n Deleted or \n PendingDelete or \n Importing )
34+
#LightBlue:Set OpenStackNodeImageRelease status to not ready;
35+
#Pink:Return RequeueError;
36+
note left: wait for image to become active
37+
endswitch
38+
repeat while (Reconcile returned RequeueError?) is (yes)
39+
if (Reconcile returned error) then (yes)
40+
#Pink:Error reconciling OpenStackNodeImageRelease;
41+
else (no)
42+
endif
43+
stop;
44+
45+
@enduml
81.8 KB
Loading
File renamed without changes.
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
2+
# OpenStackClusterStackRelease controller
3+
4+
The OpenStackClusterStackRelease controller’s main responsibilities are:
5+
6+
- Download release assets into the CSPO container
7+
- Create OpenStackNodeImageRelease resources based on the required NodeImages defined in the downloaded release asset `node-images.yaml`
8+
- Set an OwnerReference on the existing OpenStackNodeImageRelease resources that could be utilized by the ClusterStack release (multiple versions of one ClusterStack could share an image)
9+
- Update the OpenStackClusterStackRelease status to `ready` once all related OpenStackNodeImageReleases are also `ready`
10+
11+
![OSCSR controller](./images/openstackclusterstackrelease-controller.png "OSCSR controller")
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
# OpenStackNodeImageRelease controller
2+
3+
The OpenStackNodeImageRelease controller’s main responsibilities are:
4+
- Load the OpenStack Cloud configuration from the Secret referenced in `spec.IdentityRef`
5+
- Create an Image as defined by `spec.Image` if it does not already exist in the specified OpenStack project
6+
- Instruct the OpenStack Glance service to import an Image from the provided URL
7+
- Set the OpenStackNodeImageRelease status to `ready` once the image achieves an Active status
8+
9+
![OSNIR controller](./images/openstacknodeimagerelease-controller.png "OSNIR controller")

0 commit comments

Comments
 (0)