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
This example can specify the following arguments to create user-defined kuberntes cluster
19
+
20
+
* alicloud_access_key: The Alicloud Access Key ID
21
+
* alicloud_secret_key: The Alicloud Access Secret Key
22
+
* region: The ID of region in which launching resources
23
+
* k8s_name_prefix: The name prefix of kubernetes cluster
24
+
* worker_number: The number of worker nodes in each kubernetes cluster
25
+
* k8s_pod_cidr: The kubernetes pod cidr block. It cannot be equals to vpc's or vswitch's and cannot be in them. If vpc's cidr block is `172.16.XX.XX/XX`,
26
+
it had better to `192.168.XX.XX/XX` or `10.XX.XX.XX/XX`
27
+
* k8s_service_cidr: The kubernetes service cidr block. Its setting rule is same as `k8s_pod_cidr`
28
+
* Other kubernetes cluster arguments
29
+
30
+
**Note:** In order to avoid some needless error, you had better to set `new_nat_gateway` to `true`.
31
+
Otherwise, you must you must ensure you specified vswitches can access internet before running the example.
32
+
33
+
Planning phase
34
+
35
+
terraform plan
36
+
37
+
Apply phase
38
+
39
+
terraform apply
40
+
41
+
42
+
Destroy
43
+
44
+
terraform destroy
45
+
46
+
47
+
Conditional creation
48
+
--------------------
49
+
This example can support the following creating kubernetes cluster scenario by setting different arguments.
50
+
51
+
### 1. Create a new vpc, vswitches and nat gateway for the cluster.
52
+
53
+
You can specify the following user-defined arguments:
54
+
55
+
* vpc_name: A new vpc name
56
+
* vpc_cidr: A new vpc cidr block
57
+
* vswitch_name_prefix: The name prefix of several vswitches
58
+
* vswitch_cidrs: List of cidr blocks for several new vswitches
59
+
60
+
### 2. Using existing vpc and vswitches for the cluster.
61
+
62
+
You can specify the following user-defined arguments:
63
+
64
+
* vpc_id: A existing vpc ID
65
+
* vswitch_ids: List of IDs for several existing vswitches
66
+
67
+
### 3. Using existing vpc, vswitches and nat gateway for the cluster.
68
+
69
+
You can specify the following user-defined arguments:
70
+
71
+
* vpc_id: A existing vpc ID
72
+
* vswitch_ids: List of IDs for several existing vswitches
73
+
* new_nat_gateway: Set it to false. But you must ensure you specified vswitches can access internet.
74
+
In other words, you must set snat entry for each vswitch before running the example.
75
+
76
+
77
+
Terraform version
78
+
-----------------
79
+
Terraform version 0.11.0 or newer and Provider version 1.57.2 or newer are required for this example to work.
80
+
81
+
Authors
82
+
-------
83
+
Created and maintained by Meng Xiaobing(@menglingwei, [email protected])
84
+
85
+
License
86
+
-------
87
+
Mozilla Public License 2.0. See LICENSE for full details.
0 commit comments