You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
A [Cluster Stack](https://github.com/SovereignCloudStack/cluster-stacks) is full template of a Kubernetes cluster. A Cluster Stack can be configured on every provider that supports Cluster API.
4
4
5
-
The Cluster Stack Operator facilitates using Cluster Stacks by automating all steps that users would have to do manually given they have a Cluster API management cluster.
5
+
The Cluster Stack Operator facilitates using Cluster Stacks by automating all steps that users would have to do manually given they have a Cluster API management cluster.
6
6
7
7
The csctl helps to generate all files and build node images based on provided scripts in a format that the Cluster Stack Operator can use.
8
8
@@ -18,7 +18,7 @@ You should must have the following content inside your directory:
18
18
- node-image directory (optional): the directory containing config and associated scripts to build node images
19
19
20
20
21
-
## Configuring csctl
21
+
## Configuring csctl
22
22
The configuration of csctl has to be specified in the `csctl.yaml`. It needs to follow this structure:
23
23
24
24
```yaml
@@ -32,22 +32,8 @@ config:
32
32
config:
33
33
```
34
34
35
-
The apiVersion specifies the version of this configuration. Currently, there is only the version `csctl.clusterstack.x-k8s.io/v1alpha1`.
35
+
The apiVersion specifies the version of this configuration. Currently, there is only the version `csctl.clusterstack.x-k8s.io/v1alpha1`.
36
36
37
-
Furthermore, the Kubernetes version in the format "v<major>.<minor>.<patch>" (e.g. 1.27.5) has to be specified as well as the name that should be given to the Cluster Stack.
37
+
Furthermore, the Kubernetes version in the format 'v<major>.<minor>.<patch>' (e.g. 1.27.5) has to be specified as well as the name that should be given to the Cluster Stack.
38
38
39
39
Depending on your plugin, there might be a provider-specific configuration.
40
-
41
-
42
-
## Templating the versions
43
-
44
-
There are three different versions in a Cluster Stack that can be templated by `csctl`:
45
-
46
-
```markdown
47
-
- << .ClusterAddonVersion >>
48
-
- << .ClusterClassVersion >>
49
-
- << .NodeImageVersion >>
50
-
```
51
-
If you want to specify one of these versions in your Helm chart or other configuration files, then use the one of the above mentioned templated versions.
52
-
53
-
To reference your node images, you will also need << .NodeImageRegistry >>.
Copy file name to clipboardexpand all lines: docs/how_to_use_csctl.md
+8-6
Original file line number
Diff line number
Diff line change
@@ -1,15 +1,17 @@
1
+
> Obsolete, content moved to overview.md and quickstart.md for use in docs.scs.community
2
+
1
3
# Using csctl
2
4
3
5
4
-
## What does csctl do?
6
+
## What does csctl do?
5
7
6
8
As a user, you can create clusters based on Cluster Stacks with the help of the Cluster Stack Operator. The operator needs certain files, e.g. to apply the required Helm charts, and to get the necessary information about the versions in the cluster stack.
7
9
8
10
In order to not generate these files manually, this CLI tool takes a certain pre-defined directory structure, in which users can configure all necessary Helm charts and build scripts for node images, and generates the assets that the Cluster Stack Operator can process.
9
11
10
12
Therefore, this tool can be used to configure Cluster Stacks and to test them with the Cluster Stack Operator. It can also be used to release stable releases of Cluster Stacks that can be published for a broader community.
11
13
12
-
## Different modes of csctl
14
+
## Different modes of csctl
13
15
14
16
The csctl has multiple modes that can be used for different use cases.
The most important subcommand is `create`. This command takes a path to the directory where you configured your Cluster Stack and generates the necessary files in the output directory via the `--output` flag:
You can specify your node image registry with the flag `--node-image-registry`. The plugin of your provider will update the node images in the respective container registry.
69
+
You can specify your node image registry with the flag `--node-image-registry`. The plugin of your provider will update the node images in the respective container registry.
68
70
69
71
You can use the `--mode` flag to specify the mode you want to use.
The [Cluster Stack Operator](https://github.com/SovereignCloudStack/cluster-stack-operator) facilitates the usage of [Cluster Stacks](https://github.com/SovereignCloudStack/cluster-stacks) by automating all steps that can be automated. It takes Cluster Stacks release assets that consist mainly of two Helm charts, one to deploy in the management cluster, the other one to deploy in the workload clusters, as well as provider-specific node image (build) information.
6
+
7
+
Users can take existing releases of Cluster Stacks and the operator and will be able to create clusters easily.
8
+
9
+
This project facilitates building node image artifacts and release assets that can be used with the Cluster Stack Operator.
10
+
11
+
## What does csctl do?
12
+
13
+
As a user, you can create clusters based on Cluster Stacks with the help of the Cluster Stack Operator. The operator needs certain files, e.g. to apply the required Helm charts, and to get the necessary information about the versions in the cluster stack.
14
+
15
+
In order to not generate these files manually, this CLI tool takes a certain pre-defined directory structure, in which users can configure all necessary Helm charts and build scripts for node images, and generates the assets that the Cluster Stack Operator can process.
16
+
17
+
Therefore, this tool can be used to configure Cluster Stacks and to test them with the Cluster Stack Operator. It can also be used to release stable releases of Cluster Stacks that can be published for a broader community.
18
+
19
+
## Features of csctl
20
+
1. Testing and quick iterations
21
+
csctl is created with a single focus of building Cluster Stacks and testing them with Cluster Stack Operator quickly. This tool helps in doing quick iterations and facilitates testing Cluster Stacks.
22
+
23
+
2. Versioning
24
+
When configuring Cluster Stacks, it is necessary to put versions in the configuration, e.g. to version a Helm chart or node images. This process is facilitated by the csctl through its own templating and mechanism to generate the right version, based on the content hash (for testing) or on a previous version (stable or beta channel). Users only have to use the right templating and the csctl will do all the versioning automatically.
25
+
26
+
3. Plugin mechanism for providers
27
+
The plugin mechanism of csctl allows providers to implement all provider-specific steps that are needed for this provider. This can contain a fully automated building and uploading process for node images, which can be referenced in the Cluster Stack (using the templating logic for versioning).
28
+
29
+
4. Automated testing of Cluster Stacks
30
+
The csctl enables automated testing of Cluster Stacks if integrated in a CI process that first builds all necessary files as well as node images (if needed) and then uses them to create a workload cluster based on the Cluster Stack.
Go to https://github.com/SovereignCloudStack/csctl/releases/latest and then click on the binary. The name of the binary looks similar to this `csctl_0.0.3_linux_amd64.tar.gz` for Linux amd64 architecture.
6
+
7
+
This will download the binary in your `~/Downloads` directory. Use the following commands to move it to your PATH.
8
+
```bash
9
+
tar xvzf ~/Downloads/csctl_<version>_linux_amd64.tar.gz
10
+
chmod u+x ~/Downloads/csctl
11
+
sudo mv ~/Downloads/csctl /usr/local/bin/csctl
12
+
```
13
+
14
+
Alternative way of installing the binary is to use `[gh](https://github.com/cli/cli)` command line tool.
15
+
Use the following command to download the latest binary from GitHub.
For darwin based systems, the steps are similar, you'll have to choose darwin based binaries instead of linux one mentioned above. You'll also need to update your destination directory.
23
+
24
+
## Creating Cluster Stacks
25
+
26
+
The most important subcommand is `create`. This command takes a path to the directory where you configured your Cluster Stack and generates the necessary files in the output directory via the `--output` flag:
You can specify your node image registry with the flag `--node-image-registry`. The plugin of your provider will update the node images in the respective container registry.
33
+
34
+
You can use the `--mode` flag to specify the mode you want to use.
You have to be authenticated to your cloud provider and container registry to which you want to upload the node images.
43
+
44
+
## Different modes of csctl
45
+
46
+
The csctl has multiple modes that can be used for different use cases.
47
+
48
+
### Hash mode
49
+
50
+
This mode is the most used one, as it allows quick iterations and testing of a cluster stack. It takes the hash of the content of the cluster stack and generates a semver version on this. You can combine it with the `custom` channel of Cluster Stack Operator and test your Cluster Stacks easily!
51
+
52
+
### Stable mode
53
+
54
+
This mode checks for existing releases of cluster stacks and versions your cluster stack accordingly. If you have an existing release of "v1", then it would use "v2" for the new one. It also checks whether the node images and cluster addons have changed or not and will only update the versions if something actually changed.
55
+
56
+
### Beta mode
57
+
58
+
Similar to stable mode, but for a beta release channel. It versions according to "v0-beta.1", etc.
59
+
60
+
### Custom mode
61
+
62
+
The custom mode can be used to define your own version. You can input any semver version and your cluster stack will be versioned accordingly.
0 commit comments