Skip to content

Commit 45aa6e4

Browse files
📖 Refactor the documentation for compatibility with the docs.scs.community (#111)
* Refactor the documentation for compatibility with the docs.scs.community Signed-off-by: Matej Feder <[email protected]> * Fix minors based on review comments Signed-off-by: Matej Feder <[email protected]> * Apply suggestions from code review Co-authored-by: Roman Hros <[email protected]> Signed-off-by: Matej Feder <[email protected]> --------- Signed-off-by: Matej Feder <[email protected]> Co-authored-by: Roman Hros <[email protected]>
1 parent fc7b61e commit 45aa6e4

File tree

8 files changed

+192
-168
lines changed

8 files changed

+192
-168
lines changed

README.md

Lines changed: 14 additions & 149 deletions
Original file line numberDiff line numberDiff line change
@@ -1,176 +1,41 @@
11
# Cluster Stack Provider OpenStack
22

33
[![GitHub Latest Release](https://img.shields.io/github/v/release/SovereignCloudStack/cluster-stack-provider-openstack?logo=github)](https://github.com/SovereignCloudStack/cluster-stack-provider-openstack/releases)
4-
[![Go Report Card](https://goreportcard.com/badge/github.com/sovereignCloudStack/cluster-stack-provider-openstack)](https://goreportcard.com/report/github.com/sovereignCloudStack/cluster-stack-provider-openstack)
4+
[![Go Report Card](https://goreportcard.com/badge/github.com/SovereignCloudStack/cluster-stack-provider-openstack)](https://goreportcard.com/report/github.com/SovereignCloudStack/cluster-stack-provider-openstack)
55
[![License](https://img.shields.io/badge/License-Apache%202.0-blue.svg)](https://opensource.org/licenses/Apache-2.0)
66

7-
The Cluster Stack Provider OpenStack (CSPO) works with the Cluster Stack Operator (CSO) and Cluster Stacks, enabling the creation of Kubernetes clusters in a Cluster-API-native (CAPI) fashion.
7+
## Overview
88

9-
The primary goal of the CSPO is to facilitate the import of node images in a manner specific to OpenStack. These images are then used to create Kubernetes workload clusters on top of the OpenStack infrastructure.
9+
Refer to the [overview page](./docs/overview.md) in the `docs` directory.
1010

11-
To gain a comprehensive understanding of the entire concept, we recommend familiarizing yourself with the fundamental [concepts](https://github.com/SovereignCloudStack/cluster-stack-operator/blob/main/docs/concept.md) and [architecture](https://github.com/SovereignCloudStack/cluster-stack-operator/blob/main/docs/architecture/overview.md) outlined in [CSO](https://github.com/SovereignCloudStack/cluster-stack-operator/blob/main/README.md) and [Cluster Stacks](https://github.com/SovereignCloudStack/cluster-stacks/blob/main/README.md).
11+
## Quickstart
1212

13-
# Quickstart Guide
13+
Refer to the [quickstart page](./docs/quickstart.md) in the `docs` directory.
1414

15-
This section guides you through all the necessary steps to create a workload Kubernetes cluster on top of the OpenStack infrastructure. The guide describes a path that utilizes the [clusterctl] CLI tool to manage the lifecycle of a CAPI management cluster and employs [kind] to create a local non-production management cluster.
15+
## Developer Guide
1616

17-
Note that it is a common practice to create a temporary, local [bootstrap cluster](https://cluster-api.sigs.k8s.io/reference/glossary#bootstrap-cluster) which is then used to provision a target [management cluster](https://cluster-api.sigs.k8s.io/reference/glossary#management-cluster) on the selected infrastructure.
17+
Refer to the [developer guide page](./docs/develop.md) to find more information about how to develop this operator.
1818

19-
## Prerequisites
19+
## Documentation
2020

21-
- Install [Docker] and [kind]
22-
- Install [kubectl]
23-
- Install [clusterctl]
24-
- Install [go] # installation of the Go package `envsubst` is required to enable the expansion of variables specified in CSPO and CSO manifests.
21+
Explore the documentation stored in the [docs](./docs) directory or view the rendered version online at <https://docs.scs.community/docs/category/operating-scs>.
2522

26-
## Initialize the management cluster
27-
28-
Create the kind cluster:
29-
30-
```bash
31-
kind create cluster
32-
```
33-
34-
Transform the Kubernetes cluster into a management cluster by using `clusterctl init` and bootstrap it with CAPI and Cluster API Provider OpenStack ([CAPO]) components:
35-
36-
```bash
37-
# Enable Cluster Class CAPI experimental feature
38-
export CLUSTER_TOPOLOGY=true
39-
40-
# Install CAPI and CAPO components
41-
clusterctl init --infrastructure openstack
42-
```
43-
44-
### Create a secret for OpenStack access
45-
46-
To enable communication between the CSPO and the Cluster API Provider for OpenStack (CAPO) with the OpenStack API, it is necessary to generate a secret containing the access data (clouds.yaml).
47-
Ensure that this secret is located in the identical namespace as the other Custom Resources.
48-
49-
> [!NOTE]
50-
> The default value of `cloudName` is configured as `openstack`. This setting can be overridden by including the `cloudName` key in the secret. Also, be aware that the name of the secret is expected to be `openstack` unless it is not set differently in OpenStackClusterStackReleaseTemplate in `identityRef.name` field.
51-
52-
```bash
53-
kubectl create secret generic openstack --from-file=clouds.yaml=path/to/clouds.yaml
54-
55-
# Patch the created secrets so they are automatically moved to the target cluster later.
56-
57-
kubectl patch secret openstack -p '{"metadata":{"labels":{"clusterctl.cluster.x-k8s.io/move":""}}}'
58-
```
59-
60-
### CSO and CSPO variables preparation
61-
62-
The CSO and CSPO must be directed to the Cluster Stacks repository housing releases for the OpenStack provider.
63-
Modify and export the following environment variables if you wish to redirect CSO and CSPO to an alternative Git repository
64-
65-
Be aware that GitHub enforces limitations on the number of API requests per unit of time. To overcome this,
66-
it is recommended to configure a personal access token for authenticated calls. This will significantly increase the rate limit for GitHub API requests.
67-
68-
```bash
69-
export GIT_PROVIDER_B64=Z2l0aHVi # github
70-
export GIT_ORG_NAME_B64=U292ZXJlaWduQ2xvdWRTdGFjaw== # SovereignCloudStack
71-
export GIT_REPOSITORY_NAME_B64=Y2x1c3Rlci1zdGFja3M= # cluster-stacks
72-
export GIT_ACCESS_TOKEN_B64=<my-github-access-token>
73-
```
74-
75-
### CSO and CSPO deployment
76-
77-
Install the [envsubst] Go package. It is required to enable the expansion of variables specified in CSPO and CSO manifests.
78-
79-
```bash
80-
GOBIN=/tmp go install github.com/drone/envsubst/v2/cmd/envsubst@latest
81-
```
82-
83-
Get the latest CSO release version and apply CSO manifests to the management cluster.
84-
85-
```bash
86-
# Get the latest CSO release version
87-
CSO_VERSION=$(curl https://api.github.com/repos/SovereignCloudStack/cluster-stack-operator/releases/latest -s | jq .name -r)
88-
# Apply CSO manifests
89-
curl -sSL https://github.com/sovereignCloudStack/cluster-stack-operator/releases/download/${CSO_VERSION}/cso-infrastructure-components.yaml | /tmp/envsubst | kubectl apply -f -
90-
```
91-
92-
Get the latest CSPO release version and apply CSPO manifests to the management cluster.
93-
94-
```bash
95-
# Get the latest CSPO release version
96-
CSPO_VERSION=$(curl https://api.github.com/repos/SovereignCloudStack/cluster-stack-provider-openstack/releases/latest -s | jq .name -r)
97-
# Apply CSPO manifests
98-
curl -sSL https://github.com/SovereignCloudStack/cluster-stack-provider-openstack/releases/download/${CSPO_VERSION}/cspo-infrastructure-components.yaml | /tmp/envsubst | kubectl apply -f -
99-
```
100-
101-
## Create the workload cluster
102-
103-
To transfer the credentials stored in the mentioned secret [above](#create-a-secret-for-openstack-access) to the operator,
104-
create an `OpenStackClusterStackReleaseTemplate` object and specify this secret in the `identityRef` field.
105-
The `clouds.yaml` file may contain one or more clouds, so users must specify the desired connection to a specific cloud using the `cloudName` field.
106-
Refer to the [examples/cspotemplate.yaml](./examples/cspotemplate.yaml) file for more details.
107-
108-
Next, apply this template to the management cluster:
109-
110-
```bash
111-
kubectl apply -f <path-to-openstack-clusterstack-release-template>
112-
```
113-
114-
Proceed to apply the `ClusterStack` to the management cluster. For more details, refer to [examples/clusterstack.yaml](./examples/clusterstack.yaml):
115-
116-
```bash
117-
kubectl apply -f <path-to-openstack-clusterstack>
118-
```
119-
120-
Please be patient and wait for the operator to execute the necessary tasks.
121-
If your `ClusterStack` object encounters no errors and `openstacknodeimagereleases` is ready, you can deploy a workload cluster.
122-
This can be done by applying the cluster-template.
123-
Refer to the example of this template in [examples/cluster.yaml](./examples/cluster.yaml):
124-
125-
```bash
126-
kubectl apply -f <path-to-cluster-template>
127-
```
128-
129-
Utilize a convenient CLI `clusterctl` to investigate the health of the cluster:
130-
131-
```bash
132-
clusterctl describe cluster <cluster-name>
133-
```
134-
135-
Once the cluster is provisioned and in good health, you can retrieve its kubeconfig and establish communication with the newly created workload cluster:
136-
137-
```bash
138-
# Get the workload cluster kubeconfig
139-
clusterctl get kubeconfig <cluster-name> > kubeconfig.yaml
140-
# Communicate with the workload cluster
141-
kubectl --kubeconfig kubeconfig.yaml get nodes
142-
```
143-
144-
# Compatibility with Cluster Stack Operator
23+
## Compatibility with Cluster Stack Operator
14524

14625
| | CSO `v0.1.0-alpha.2` | CSO `v0.1.0-alpha.3` |
14726
| ----------------------- | -------------------- | -------------------- |
14827
| CSPO `v0.1.0-alpha.rc1` || |
14928
| CSPO `v0.1.0-alpha.1` |||
15029
| CSPO `v0.1.0-alpha.2` |||
15130

152-
# Development guide
153-
154-
Refer to the [doc page](./docs/develop.md) to find more information about how to develop this operator.
155-
156-
# Controllers
31+
## Controllers
15732

15833
CSPO consists of two controllers. They should ensure that the desired node images are present in the targeted OpenStack project.
159-
Refer to the documentation for the CSPO controllers:
160-
- [OpenStackClusterStackRelease controller](./docs/openstackclusterstackrelease-controller.md)
161-
- [OpenStackNodeImageRelease controller](./docs/openstacknodeimagerelease-controller.md)
34+
Refer to the documentation for the CSPO [controllers](./docs/controllers.md) in the `docs` directory.
16235

163-
# API Reference
36+
## API Reference
16437

16538
CSPO currently exposes the following APIs:
39+
16640
- the CSPO Custom Resource Definitions (CRDs): [documentation](https://doc.crds.dev/github.com/SovereignCloudStack/cluster-stack-provider-openstack)
16741
- Golang APIs: tbd
168-
169-
<!-- links -->
170-
[Docker]: https://www.docker.com/
171-
[kind]: https://kind.sigs.k8s.io/
172-
[kubectl]: https://kubernetes.io/docs/tasks/tools/install-kubectl/
173-
[clusterctl]: https://cluster-api.sigs.k8s.io/user/quick-start.html#install-clusterctl
174-
[CAPO]: https://github.com/kubernetes-sigs/cluster-api-provider-openstack
175-
[go]: https://go.dev/doc/install
176-
[envsubst]: https://github.com/drone/envsubst

docs/openstackclusterstackrelease-controller.md renamed to docs/controllers.md

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11

2-
# OpenStackClusterStackRelease controller
2+
# Controllers
3+
4+
## OpenStackClusterStackRelease controller
35

46
The OpenStackClusterStackRelease controller’s main responsibilities are:
57

@@ -9,3 +11,14 @@ The OpenStackClusterStackRelease controller’s main responsibilities are:
911
- Update the OpenStackClusterStackRelease status to `ready` once all related OpenStackNodeImageReleases are also `ready`
1012

1113
![OSCSR controller](./images/openstackclusterstackrelease-controller.png "OSCSR controller")
14+
15+
## OpenStackNodeImageRelease controller
16+
17+
The OpenStackNodeImageRelease controller’s main responsibilities are:
18+
19+
- Load the OpenStack Cloud configuration from the Secret referenced in `spec.IdentityRef`
20+
- Create an Image as defined by `spec.Image` if it does not already exist in the specified OpenStack project
21+
- Instruct the OpenStack Glance service to import an Image from the provided URL
22+
- Set the OpenStackNodeImageRelease status to `ready` once the image achieves an Active status
23+
24+
![OSNIR controller](./images/openstacknodeimagerelease-controller.png "OSNIR controller")

docs/develop.md

Lines changed: 15 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
1-
# Develop Cluster Stack Provider OpenStack
1+
# Developer Guide
22

3-
Developing our operator is quite straightforward. First, you need to install some basic prerequisites:
3+
Developing Cluster Stack Provider OpenStack operator is quite straightforward. First, you need to install some basic prerequisites:
44

55
- Docker
66
- Go
@@ -51,34 +51,41 @@ make delete-bootstrap-cluster
5151

5252
If you have any trouble finding the right command, then you can use `make help` to get a list of all available make targets.
5353

54-
## Toggle between local_mode and remote mode
55-
We can retrieve cluster-stacks in two modes. One way is to let the controller fetch it from GitHub which is remote mode and other is we mount the cluster-stacks inside the container at `/tmp/downloads/cluster-stacks` directory.
54+
## Toggle between local_mode and remote mode
55+
56+
We can retrieve cluster-stacks in two modes. One way is to let the controller fetch it from GitHub which is remote mode and other is we mount the cluster-stacks inside the container at `/tmp/downloads/cluster-stacks` directory.
5657

5758
> [!NOTE]
58-
> Using remote mode is the default behavior.
59+
> Using remote mode is the default behavior.
5960
6061
Switching between both modes is relatively simple if you're using Tilt. There is a file at the root of the repo `tilt-settings.yaml.example`
6162
Make a copy of that file with the name of `tilt-settings.yaml`
63+
6264
```bash
6365
cp tilt-settings.yaml.example tilt-settings.yaml
6466
```
67+
6568
Now, open the file and set the `local_mode` to `true` to use cluster-stacks in local_mode. It should look the following content wise.
69+
6670
```yaml
6771
local_mode: true
6872
```
6973
7074
> [!NOTE]
71-
> In this mode you need to have cluster-stacks present locally.
75+
> In this mode you need to have cluster-stacks present locally.
76+
77+
Downloading cluster-stacks can be achieved by many ways but below is a simple way to download it quickly.
7278
73-
Downloading cluster-stacks can be achieved by many ways but below is a simple way to download it quickly.
7479
```bash
7580
mkdir -p .release/openstack-scs-1-27-v1/
7681
cd .release/openstack-scs-1-27-v1
7782
gh release download --repo sovereigncloudstack/cluster-stacks openstack-scs-1-27-v1
7883
```
84+
7985
Change the repo and tag as per the requirement. You can also download it directly from browser and move it to `.release` directory.
8086

8187
Please make sure the directory structure remains the same otherwise you'll not be able to start the tilt setup. Here's an example of structuring `openstack-scs-1-27-v1` cluster-stack.
88+
8289
```bash
8390
$ tree .release/openstack-scs-1-27-v1/
8491
.release/openstack-scs-1-27-v1/
@@ -90,4 +97,4 @@ $ tree .release/openstack-scs-1-27-v1/
9097
> [!IMPORTANT]
9198
There's an alternative way to get clusterstacks using [csmctl](https://github.com/sovereigncloudstack/csmctl). You can follow the README of csmctl for specific instructions and a good quickstart.
9299

93-
You can use `csmctl create` subcommand to create clusterstack locally. You'll need a csmctl.yaml file in the cluster-stack configuration directory. Please read more about creating configuration file for csmctl in the csmctl docs.
100+
You can use `csmctl create` subcommand to create clusterstack locally. You'll need a csmctl.yaml file in the cluster-stack configuration directory. Please read more about creating configuration file for csmctl in the csmctl docs.

docs/images/openstackclusterstackrelease-controller.plantuml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,8 @@ start;
55

66
repeat
77
:OpenStackClusterStackRelease controller enqueues a Reconcile call;
8-
:Create GitHub client;
98
if (Release assets have been download into the CSPO container) then (no)
9+
:Create GitHub client;
1010
#LightBlue:Download Release assets;
1111
#Pink:Return RequeueError;
1212
note left: make sure that Release can be accessed
-17 Bytes
Loading

docs/openstacknodeimagerelease-controller.md

Lines changed: 0 additions & 9 deletions
This file was deleted.

docs/overview.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
# Overview
2+
3+
The Cluster Stack Provider OpenStack (CSPO) works with the Cluster Stack Operator (CSO) and Cluster Stacks, enabling the creation of Kubernetes clusters in a Cluster-API-native (CAPI) fashion.
4+
5+
The primary goal of the CSPO is to facilitate the import of node images in a manner specific to OpenStack. These images are then used to create Kubernetes workload clusters on top of the OpenStack infrastructure.
6+
7+
To gain a comprehensive understanding of the entire concept, we recommend familiarizing yourself with the fundamental [concepts](https://github.com/SovereignCloudStack/cluster-stack-operator/blob/main/docs/concept.md) and [architecture](https://github.com/SovereignCloudStack/cluster-stack-operator/blob/main/docs/architecture/overview.md) outlined in [CSO](https://github.com/SovereignCloudStack/cluster-stack-operator/blob/main/README.md) and [Cluster Stacks](https://github.com/SovereignCloudStack/cluster-stacks/blob/main/README.md).

0 commit comments

Comments
 (0)