@@ -14,68 +14,53 @@ These types of the module resource are supported:
14
14
- [ SLS Project] ( https://www.terraform.io/docs/providers/alicloud/r/log_project.html )
15
15
- [ Managed Kubernetes] ( https://www.terraform.io/docs/providers/alicloud/r/cs_managed_kubernetes.html )
16
16
17
- Usage
18
- -----
19
- This example can specify the following arguments to create user-defined kuberntes cluster
20
-
21
- * alicloud_access_key: The Alicloud Access Key ID
22
- * alicloud_secret_key: The Alicloud Access Secret Key
23
- * region: The ID of region in which launching resources
24
- * k8s_name_prefix: The name prefix of kubernetes cluster
25
- * worker_number: The number of worker nodes in each kubernetes cluster
26
- * k8s_pod_cidr: The kubernetes pod cidr block. It cannot be equals to vpc's or vswitch's and cannot be in them.
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
17
Usage
31
18
-----
32
19
33
20
This module used to create a managed kubernetes and it can meet several scenarios by specifying different parameters.
34
21
35
- 1 . Create a new vpc, several new vswitches and a new nat gateway for the cluster.
36
- ``` hcl
37
- // Create a scaling group using autoscaling module at first.
38
- module "managed-k8s" {
39
- source = "terraform-alicloud-modules/managed-kubernetes/alicloud"
40
- profile = "Your-profile-name"
41
-
42
- k8s_name_prefix = "my-managed-k8s-with-new-vpc"
43
- new_vpc = true
44
- vpc_cidr = "192.168.0.0/16"
45
- vswitch_cidrs = [
46
- "192.168.1.0/24",
47
- "192.168.2.0/24",
48
- "192.168.3.0/24",
49
- "192.168.4.0/24",
50
- ]
51
- }
52
- ```
22
+ ** NOTE:** This module using AccessKey and SecretKey are from ` profile ` and ` shared_credentials_file ` .
23
+ If you have not set them yet, please install [ aliyun-cli] ( https://github.com/aliyun/aliyun-cli#installation ) and configure it.
53
24
54
- In this scenario, the module will create a new vpc with `vpc_cidr`, several vswitches with `vswitch_cidrs`, a new nat gateway,
55
- a new EIP with `new_eip_bandwidth` and several snat entries for vswitches.
25
+ ### 1 Create a new vpc, several new vswitches and a new nat gateway for the cluster.
26
+ ``` hcl
27
+ // Create a scaling group using autoscaling module at first.
28
+ module "managed-k8s" {
29
+ source = "terraform-alicloud-modules/managed-kubernetes/alicloud"
30
+ profile = "Your-profile-name"
56
31
57
- 1. Using existing vpc and vswitches by specifying `vswitch_ids`. Setting `new_nat_gateway=true` to add a new nat gateway in the vswitches' vpc.
58
- ```hcl
59
- // Create a scaling group using autoscaling module at first.
60
- module "managed-k8s" {
61
- source = "terraform-alicloud-modules/managed-kubernetes/alicloud"
62
- profile = "Your-profile-name"
63
-
64
- k8s_name_prefix = "my-managed-k8s-with-new-vpc"
65
- new_vpc = false
66
- vswitch_ids = [
67
- "vsw-12345678",
68
- "vsw-09876537"
69
- ]
70
- new_nat_gateway = true
71
- }
72
- ```
73
-
74
- In this scenario, if setting `new_nat_gateway=false`, you should ensure the specified vswitches can access internet.
75
- In other words, the specified vpc has a nat gateway and there are several snat entries to bind the vswitches and a EIP.
32
+ k8s_name_prefix = "my-managed-k8s-with-new-vpc"
33
+ new_vpc = true
34
+ vpc_cidr = "192.168.0.0/16"
35
+ vswitch_cidrs = [
36
+ "192.168.1.0/24",
37
+ "192.168.2.0/24",
38
+ "192.168.3.0/24",
39
+ "192.168.4.0/24",
40
+ ]
41
+ }
42
+ ```
43
+ In this scenario, the module will create a new vpc with ` vpc_cidr ` , several vswitches with ` vswitch_cidrs ` , a new nat gateway,
44
+ a new EIP with ` new_eip_bandwidth ` and several snat entries for vswitches.
76
45
77
- **NOTE:** This module using AccessKey and SecretKey are from `profile` and `shared_credentials_file`.
78
- If you have not set them yet, please install [aliyun-cli](https://github.com/aliyun/aliyun-cli#installation) and configure it.
46
+ ### 2 Using existing vpc and vswitches by specifying ` vswitch_ids ` . Setting ` new_nat_gateway=true ` to add a new nat gateway in the vswitches' vpc.
47
+ ``` hcl
48
+ // Create a scaling group using autoscaling module at first.
49
+ module "managed-k8s" {
50
+ source = "terraform-alicloud-modules/managed-kubernetes/alicloud"
51
+ profile = "Your-profile-name"
52
+
53
+ k8s_name_prefix = "my-managed-k8s-with-new-vpc"
54
+ new_vpc = false
55
+ vswitch_ids = [
56
+ "vsw-12345678",
57
+ "vsw-09876537"
58
+ ]
59
+ new_nat_gateway = true
60
+ }
61
+ ```
62
+ In this scenario, if setting ` new_nat_gateway=false ` , you should ensure the specified vswitches can access internet.
63
+ In other words, the specified vpc has a nat gateway and there are several snat entries to bind the vswitches and a EIP.
79
64
80
65
## Conditional creation
81
66
0 commit comments