|
| 1 | +# Using the csctl plugin for OpenStack |
| 2 | + |
| 3 | +## What does the csctl plugin for OpenStack do? |
| 4 | + |
| 5 | +As a user, you can create clusters based on Cluster Stacks with the help of the Cluster Stack Operators (CSO and CSPO). The operators need certain files, such as those required to apply the necessary Helm charts and to obtain information about the versions in the cluster stack. |
| 6 | + |
| 7 | +To avoid generating these files manually, you can use [CSCTL](https://github.com/SovereignCloudStack/csctl). In the case of provider-specific Cluster Stacks, the `CSCTL` tool invokes the provider-specific CSCTL plugin. Therefore, the CSCTL plugin for OpenStack is essential if the user intends to build, upload node images to an S3 bucket, and then import them into Glance. |
| 8 | + |
| 9 | +## Different methods of csctl plugin for OpenStack |
| 10 | + |
| 11 | +The csctl plugin for OpenStack offers two methods that can be used for different use cases. |
| 12 | + |
| 13 | +### Get method |
| 14 | + |
| 15 | +This method can be used when the creator of cluster-stacks has already built and stored image(s) in some S3 storage. Then, they need to insert the URL to those image(s) in the `config.yaml`. The plugin, based on the configuration file, then generates `node-images.yaml` in the release directory. |
| 16 | + |
| 17 | +### Build method |
| 18 | + |
| 19 | +The use case for this method is the opposite of the `Get` method. It means that the cluster-stack creator intends to use an image that has not yet been built. The plugin then builds image(s) based on Packer scripts in the `node-images` folder and pushes these image(s) to an S3 bucket. In this mode, you need to provide the path to your S3 storage credentials using the `--node-image-registry` flag, see [registry.yaml](./example/cluster-stacks/openstack/ferrol/node-images/registry.yaml). The URL does not need to be set in `config.yaml`, plugin can creates for you based on this pattern: |
| 20 | + |
| 21 | +```bash |
| 22 | +https://<endpoint>/<bucket-name>/<image-dir-name> |
| 23 | +``` |
| 24 | + |
| 25 | +Be aware of that in this method you need to specify `imageDir` in `config.yaml` file. |
| 26 | + |
| 27 | +> [!NOTE] |
| 28 | +> URL creation does not work for OpenStack Swift. |
| 29 | +
|
| 30 | +## Installing csctl plugin for OpenStack |
| 31 | + |
| 32 | +You can click on the respective release of the csctl plugin for OpenStack on GitHub and download the binary. |
| 33 | + |
| 34 | +Assuming, you have downloaded the `<release-name>` binary in your Downloads directory, you will need the following commands to rename the binary and to give it executable permissions. |
| 35 | + |
| 36 | +```bash |
| 37 | +sudo chmod u+x ~/Downloads/<release-name> |
| 38 | +sudo mv ~/Downloads/<release-name> /usr/local/bin/csctl-openstack # or use any bin directory from your PATH |
| 39 | +``` |
| 40 | + |
| 41 | +If you're using `gh` CLI then you can also use the following to download it. |
| 42 | + |
| 43 | +```bash |
| 44 | +gh release download -p <release-name> -R SovereignCloudStack/csctl-plugin-openstack |
| 45 | +``` |
| 46 | + |
| 47 | +## Creating node-images file in release directory of cluster-stacks |
| 48 | + |
| 49 | +The most important subcommand is `create-node-images`. This command takes a path to the directory where you configured your Cluster Stack and generates the `node-images.yaml` file in the output directory. |
| 50 | + |
| 51 | +```bash |
| 52 | +csctl-openstack create-node-images cluster-stack-directory cluster-stack-release-directory |
| 53 | +``` |
| 54 | + |
| 55 | +If you choose `build` method you need to provide the path to your node image registry credentials like this: |
| 56 | + |
| 57 | +```bash |
| 58 | +create-node-images cluster-stack-directory cluster-stack-release-directory node-image-registry-path |
| 59 | +``` |
| 60 | + |
| 61 | +Then the plugin push created node image(s) to the appropriate S3 bucket. |
0 commit comments