Skip to content

Commit a5fc9af

Browse files
authored
Merge pull request #157 from jweite-amazon/v0.4.7-Docs
Revised doc files for V0.4.7
2 parents cb89566 + 9fa5207 commit a5fc9af

File tree

3 files changed

+88
-27
lines changed

3 files changed

+88
-27
lines changed

docs/book/src/clustercloudstack/configuration.md

Lines changed: 61 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,10 @@
11
# Required configuration
22

33
The cluster configuration file can be generated by using [`clusterctl generate cluster`][clusterctl-generate-cluster] command.
4-
This command actually uses [the template file][template-file] and replace the values surrounded by `${}` with environment variables. You have to set all required environment variables in advance. The following sections explain some more details about what should be configured.
4+
This command actually uses [a template file][template-file] and replaces the values surrounded by `${}` with environment variables.
5+
You have to set all required environment variables in advance. The following sections explain some more details about what should be configured.
56

6-
Note: You can use [the template file][template-file] by manually replacing values.
7+
Note: You can also use [template files][template-file] by manually replacing values in copies of the template file.
78

89
```bash
910
clusterctl generate cluster capi-quickstart \
@@ -13,25 +14,52 @@ clusterctl generate cluster capi-quickstart \
1314
> capi-quickstart.yaml
1415
```
1516

17+
Note: additional template files are provided, offering capabilities beyond the default template file. These can be
18+
utilized via the *clusterctl --flavor* parameter. Additional environment variables are often required by these templates.
19+
See clusterctl documentation for further details about *flavors*.
20+
1621
In order to fetch the configuration parameters via the terminal, please install [cmk][cmk-download] and [jq][jq-download]
1722

1823
## Cluster Level Configurations
1924

2025
These configurations are passed while defining the `CloudStackCluster` and apply to the entire cluster.
2126

22-
### Zone
27+
### Failure Domains
28+
29+
The *Cluster API Provider* offers high-availability clusters deployed across multiple *Failure Domains*, each of which is
30+
a diverse set of infrastructure that doesn't share required dependencies (such as power source, networking provider)
31+
with other failure domains. In the face of a dependency failure, only cluster members deployed on the failed failure
32+
domain will themselves fail. The remaining cluster members will continue operation, and the cluster manager will likely
33+
restore capacity by allocating replacement cluster members in the surviving failure domains.
34+
35+
*CloudStack* implements this concept with *Zones*. The *Cluster API Provider CloudStack* enables end-users to specify
36+
the CloudStack Zone for each Failure Domain, as well as the particular network of this Zone to use.
37+
38+
The templates provided with *ClusterAPI Provider CloudStack* only define a single failure domain, mapped to a specific
39+
CloudStack Zone and a specific network on that CloudStack Zone. The below parameters allow the end user to define these.
40+
No additional parameters are required to use these templates.
41+
42+
*ClusterAPI Provider CloudStack* additionally supports optional attributes beyond these, allowing each Failure Domain
43+
to use a distinct Domain/Account or CloudStack management endpoint. Note that these additional attributes are not
44+
utilized in the provided templates.
45+
46+
Advanced users can define cluster templates manually that declare additional Failure Domains, and can utilize the
47+
additional failure domain attributes supported by *ClusterAPI Provider CloudStack*. See the [failure domain API definition][failure-domain-api]
48+
for more details.
49+
50+
#### Zone
2351

24-
The Zone must be exposed as an environment variable `CLOUDSTACK_ZONE_NAME` and is a mandatory parameter.
52+
The Zone must be declared via an environment variable `CLOUDSTACK_ZONE_NAME` and is a mandatory parameter.
2553
As of now, only advanced zones without security groups is supported.
2654

2755
The list of zones can be fetched using the cmk cli as follows :
2856
```
2957
cmk list zones listall=true | jq '.zone[] | {name, id}'
3058
```
3159

32-
### Network
60+
#### Network
3361

34-
The network must be exposed as an environment variable `CLOUDSTACK_NETWORK_NAME` and is a mandatory parameter.
62+
The network must be declared as an environment variable `CLOUDSTACK_NETWORK_NAME` and is a mandatory parameter.
3563
As of now, only isolated and shared networks are supported.
3664
If the specified network does not exist, a new isolated network will be created.
3765

@@ -40,17 +68,41 @@ The list of networks for the specific zone can be fetched using the cmk cli as f
4068
cmk list networks listall=true zoneid=<zoneid> | jq '.network[] | {name, id, type}'
4169
```
4270

71+
#### CloudStack Endpoint Credentials Secret (*optional for provided templates when used with provided getting-started process*)
72+
73+
A reference to a Kubernetes Secret containing a YAML object containing credentials for accessing a particular CloudStack
74+
management endpoint. The YAML object is of the form:
75+
76+
```
77+
api-url: <cloudstackApiUrl>
78+
api-key: <cloudstackApiKey>
79+
secret-key: <cloudstackSecretKey>
80+
verify-ssl: true|false
81+
```
82+
83+
Optional environment Variables `CLOUDSTACK_FD1_SECRET_NAME` and `CLOUDSTACK_FD1_SECRET_NAMESPACE` allow the end-user
84+
to override the template's default settings, utilizing a differently named secret.
85+
86+
#### CloudStack Failure Domain Name (*optional for provided templates*)
87+
88+
When using multiple Failure Domains each requires a distinct name. The provided templates *do not* configure multiple
89+
Failure Domains, and only utilize a default name. This name can be changed by defining environment variable
90+
`CLOUDSTACK_FD1_NAME`. Doing so has no effect on the operation of clusters defined with the templates. This
91+
option is included mainly to convey the need and mechanism for naming failure domains when multiple failure
92+
domains are defined via custom-authored templates.
4393

44-
### Endpoint
94+
### Cluster Endpoint
4595

46-
The endpoint of the workload cluster. It can either be an IP or an FQDN which is resolvable from the management cluster
96+
The endpoint of the workload cluster that will be provisioned. It can either be an IP or an FQDN, resolvable
97+
from the management cluster.
4798

4899
If on an isolated network, and the endpoint is an IP, it must be an IP in the Public IP range.
49100
The necessary Firewall and LoadBalancing rules will be automatically created on Apache CloudStack for the specified IP.
50101

51102
If on a shared network, and the endpoint is an IP, it must belong to the shared network range and not allocated to any other resource on CloudStack.
52103

53104
The Endpoint is exposed in two parts, as the `CLUSTER_ENDPOINT_IP` and `CLUSTER_ENDPOINT_PORT` environment variables.
105+
`CLUSTER_ENDPOINT_PORT` is optional, and defaults to *6443*.
54106

55107
The list of Public IPs for the specific zone can be fetched using the cmk cli as follows :
56108
```
@@ -224,3 +276,4 @@ TODO / Add feature
224276
[jq-download]: https://stedolan.github.io/jq/
225277
[prebuilt-images]: http://packages.shapeblue.com/cluster-api-provider-cloudstack/images/
226278
[template-file]: https://github.com/kubernetes-sigs/cluster-api-provider-cloudstack/blob/main/templates/cluster-template.yaml
279+
[failure-domain-api]: https://github.com/kubernetes-sigs/cluster-api-provider-cloudstack/blob/main/api/v1beta2/cloudstackfailuredomain_types.go

docs/book/src/development/common.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@
3131
# Referring to a prerequisite capi-compatible image you've loaded into Apache CloudStack
3232
export CLOUDSTACK_TEMPLATE_NAME=kube-v1.20.10/ubuntu-2004
3333
34-
# The SSH KeyPair to log into the VM (Optional)
34+
# The SSH KeyPair to log into the VM (Optional: use flavor *managed-ssh*)
3535
export CLOUDSTACK_SSH_KEY_NAME=CAPCKeyPair6
3636
```
3737

docs/book/src/getting-started.md

Lines changed: 26 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -9,32 +9,40 @@
99
Optional if you do not have an existing Kubernetes cluster
1010
- [kind][kind-install]
1111
- [Docker][docker-install]
12-
13-
2. Set up Apache CloudStack credentials
14-
- Create a file named `cloud-config` in the repo's root directory, substituting in your own environment's values
15-
```
16-
[Global]
17-
api-url = <cloudstackApiUrl>
18-
api-key = <cloudstackApiKey>
19-
secret-key = <cloudstackSecretKey>
20-
```
21-
22-
- Run the following command to save the above Apache CloudStack connection info into an environment variable, to be used by clusterctl, where it gets passed to CAPC:
23-
```
24-
export CLOUDSTACK_B64ENCODED_SECRET=$(base64 -w0 -i cloud-config)
25-
```
26-
27-
3. Register the capi-compatible templates in your Apache CloudStack installation.
12+
13+
2. Register the capi-compatible templates in your Apache CloudStack installation.
2814
- Prebuilt images can be found [here][prebuilt-images]
2915
- To build a compatible image see [CloudStack CAPI Images][cloudstack-capi-images]
3016

31-
4. Create a management cluster. This can either be :
32-
- An existing Kubernetes cluster : For production use-cases a "real" Kubernetes cluster should be used with appropriate backup and DR policies and procedures in place. The Kubernetes cluster must be at least v1.19.1.
17+
3. Create a management cluster. This can either be :
18+
- An existing Kubernetes cluster: For production use-cases a "real" Kubernetes cluster should be used with appropriate backup and DR policies and procedures in place. The Kubernetes cluster must be at least v1.19.1.
3319

3420
- A local cluster created with `kind`, for non production use
3521
```
3622
kind create cluster
3723
```
24+
4. Set up Apache CloudStack credentials as a secret in the management cluster
25+
- Create a file named `cloud-config.yaml` in the repo's root directory, substituting in your own environment's values
26+
```
27+
apiVersion: v1
28+
kind: Secret
29+
metadata:
30+
name: cloudstack-credentials
31+
namespace: default
32+
type: Opaque
33+
stringData:
34+
api-key: <cloudstackApiKey>
35+
secret-key: <cloudstackSecretKey>
36+
api-url: <cloudstackApiUrl>
37+
verify-ssl: "false"
38+
39+
```
40+
- Apply this secret to the management cluster:
41+
- With the management cluster's KUBECONFIG in effect:
42+
```
43+
kubectl apply -f cloud-config.yaml
44+
```
45+
- Delete cloud-config.yaml when done, for security
3846
3947
4048
### Initialize the management cluster

0 commit comments

Comments
 (0)