@@ -4,8 +4,6 @@ The cluster configuration file can be generated by using [`clusterctl generate c
4
4
This command actually uses [ a template file] [ template-file ] and replaces the values surrounded by ` ${} ` with environment variables.
5
5
You have to set all required environment variables in advance. The following sections explain some more details about what should be configured.
6
6
7
- Note: You can also use [ template files] [ template-file ] by manually replacing values in copies of the template file.
8
-
9
7
``` bash
10
8
clusterctl generate cluster capi-quickstart \
11
9
--kubernetes-version v1.21.3 \
@@ -14,9 +12,25 @@ clusterctl generate cluster capi-quickstart \
14
12
> capi-quickstart.yaml
15
13
```
16
14
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* .
15
+ You can also use [ template files] [ template-file ] by manually replacing values in copies of the template file.
16
+
17
+
18
+ > ** Note**
19
+ >
20
+ > Additional template files are provided, offering capabilities beyond the default template file. These can be
21
+ > utilized via the * clusterctl --flavor* parameter. Additional environment variables are often required by these templates.
22
+ > The following flavors are supported as of now:
23
+ > - * managed-ssh*
24
+ > - * ssh-material*
25
+ > - * with-disk-offering*
26
+ > - * with-existing-vpc-network*
27
+ > - * with-kube-vip*
28
+ >
29
+ > To check the available variables for a flavor, execute the following command:
30
+ > ``` bash
31
+ > clusterctl generate cluster capi-quickstart --flavor < flavor> --list-variables
32
+ > ` ` `
33
+ > See clusterctl documentation for further details about * flavors* .
20
34
21
35
In order to fetch the configuration parameters via the terminal, please install [cmk][cmk-download] and [jq][jq-download]
22
36
@@ -60,15 +74,75 @@ cmk list zones listall=true | jq '.zone[] | {name, id}'
60
74
#### Network
61
75
62
76
The network must be declared as an environment variable `CLOUDSTACK_NETWORK_NAME` and is a mandatory parameter.
63
- As of now, only isolated and shared networks are supported.
77
+ As of now, only isolated and shared networks are supported. The isolated network can also be part of a VPC.
78
+
79
+ If the specified network does not exist, a new isolated network will be created. The newly created network will have a default egress firewall policy that allows all TCP, UDP and ICMP traffic from the cluster to the outside world. If the network is part of a VPC, the VPC will also be created if it does not exist.
64
80
65
- If the specified network does not exist, a new isolated network will be created. The newly created network will have a default egress firewall policy that allows all TCP, UDP and ICMP traffic from the cluster to the outside world .
81
+ If the offerings are not specified, the default offerings will be used .
66
82
67
83
The list of networks for the specific zone can be fetched using the cmk cli as follows :
68
84
```
69
85
cmk list networks listall=true zoneid=<zoneid> | jq ' .network[] | {name, id, type}'
70
86
```
71
87
88
+ The list of VPCs for the specific zone can be fetched using the cmk cli as follows :
89
+ ```
90
+ cmk list vpcs listall=true zoneid=<zoneid> | jq ' .vpc[] | {name, id}'
91
+ ```
92
+
93
+ The user can configure the network offering and VPC offering for the isolated network as follows:
94
+
95
+ ```yaml
96
+ apiVersion: infrastructure.cluster.x-k8s.io/v1beta3
97
+ kind: CloudStackCluster
98
+ metadata:
99
+ name: capc-cluster
100
+ namespace: default
101
+ spec:
102
+ controlPlaneEndpoint:
103
+ host: 10.0.58.19
104
+ port: 6443
105
+ failureDomains:
106
+ - acsEndpoint:
107
+ name: secret1
108
+ namespace: default
109
+ name: fd1
110
+ zone:
111
+ name: cloudstack-zone
112
+ network:
113
+ name: cloudstack-network
114
+ offering: custom-network-offering
115
+ gateway: 10.0.0.1
116
+ netmask: 255.255.255.0
117
+ vpc:
118
+ name: cloudstack-vpc
119
+ offering: custom-vpc-offering
120
+ cidr: 10.0.0.0/16
121
+ ```
122
+
123
+ If the network already exists, offering, gateway and netmask will be ignored.
124
+ Similarly, if the VPC already exists, offering and cidr will be ignored.
125
+
126
+ ##### VPC
127
+
128
+ If you want to use an existing network inside a VPC, you can specify the flavor as `with-existing-vpc-network` while
129
+ generating the cluster configuration file and set the `CLOUDSTACK_VPC_NAME` environment variable to the name of the VPC.
130
+ After setting the environment variables, execute the following command to generate the cluster configuration file:
131
+
132
+ ```bash
133
+ clusterctl generate cluster capc-cluster --flavor with-existing-vpc-network > capc-cluster-spec.yaml
134
+ ```
135
+
136
+ ##### Shared or Routed Networks
137
+
138
+ For shared or routed networks, the user will need to use [kube-vip][kube-vip] to configure the VIP on the nodes as part of the
139
+ KubeadmControlPlane spec. You can specify the flavor as `with-kube-vip` while generating the cluster configuration file.
140
+ After setting the environment variables, execute the following command to generate the cluster configuration file:
141
+
142
+ ```bash
143
+ clusterctl generate cluster capc-cluster --flavor with-kube-vip > capc-cluster-spec.yaml
144
+ ```
145
+
72
146
#### CloudStack Endpoint Credentials Secret (*optional for provided templates when used with provided getting-started process*)
73
147
74
148
A reference to a Kubernetes Secret containing a YAML object containing credentials for accessing a particular CloudStack
@@ -159,6 +233,7 @@ The project name can be specified by adding the `CloudStackCluster.spec.project`
159
233
The list of projects can be fetched using the cmk cli as follows :
160
234
```
161
235
cmk list projects listall=true | jq ' .project[] | {name, id}'
236
+ ```
162
237
163
238
## Cluster Level Configurations
164
239
@@ -292,4 +367,5 @@ TODO / Add feature
292
367
[jq-download]: https://stedolan.github.io/jq/
293
368
[prebuilt-images]: http://packages.shapeblue.com/cluster-api-provider-cloudstack/images/
294
369
[template-file]: https://github.com/kubernetes-sigs/cluster-api-provider-cloudstack/blob/main/templates/cluster-template.yaml
295
- [failure-domain-api]: https://github.com/kubernetes-sigs/cluster-api-provider-cloudstack/blob/main/api/v1beta2/cloudstackfailuredomain_types.go
370
+ [failure-domain-api]: https://github.com/kubernetes-sigs/cluster-api-provider-cloudstack/blob/main/api/v1beta2/cloudstackfailuredomain_types.go
371
+ [kube-vip]: https://kube-vip.io/
0 commit comments