|
1 | 1 | # Cluster Stack Provider OpenStack |
2 | 2 |
|
3 | 3 | [](https://github.com/SovereignCloudStack/cluster-stack-provider-openstack/releases) |
4 | | -[](https://goreportcard.com/report/github.com/sovereignCloudStack/cluster-stack-provider-openstack) |
| 4 | +[](https://goreportcard.com/report/github.com/SovereignCloudStack/cluster-stack-provider-openstack) |
5 | 5 | [](https://opensource.org/licenses/Apache-2.0) |
6 | 6 |
|
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 |
8 | 8 |
|
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. |
10 | 10 |
|
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 |
12 | 12 |
|
13 | | -# Quickstart Guide |
| 13 | +Refer to the [quickstart page](./docs/quickstart.md) in the `docs` directory. |
14 | 14 |
|
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 |
16 | 16 |
|
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. |
18 | 18 |
|
19 | | -## Prerequisites |
| 19 | +## Documentation |
20 | 20 |
|
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>. |
25 | 22 |
|
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 |
145 | 24 |
|
146 | 25 | | | CSO `v0.1.0-alpha.2` | CSO `v0.1.0-alpha.3` | |
147 | 26 | | ----------------------- | -------------------- | -------------------- | |
148 | 27 | | CSPO `v0.1.0-alpha.rc1` | ✓ | | |
149 | 28 | | CSPO `v0.1.0-alpha.1` | ✓ | ✓ | |
150 | 29 | | CSPO `v0.1.0-alpha.2` | ✓ | ✓ | |
151 | 30 |
|
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 |
157 | 32 |
|
158 | 33 | 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. |
162 | 35 |
|
163 | | -# API Reference |
| 36 | +## API Reference |
164 | 37 |
|
165 | 38 | CSPO currently exposes the following APIs: |
| 39 | + |
166 | 40 | - the CSPO Custom Resource Definitions (CRDs): [documentation](https://doc.crds.dev/github.com/SovereignCloudStack/cluster-stack-provider-openstack) |
167 | 41 | - 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 |
0 commit comments