From 10c8064ed6577378b33ecd40ecd450e5d4652095 Mon Sep 17 00:00:00 2001 From: Guillaume Le Blanc Date: Mon, 22 Nov 2021 11:56:21 +0100 Subject: [PATCH 1/3] Add cluster_type variable --- README.md | 1 + main.tf | 2 +- variables.tf | 5 +++++ 3 files changed, 7 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 7a14c14..701f635 100644 --- a/README.md +++ b/README.md @@ -272,6 +272,7 @@ inputs = { | cluster\_eip | EIP of the cluster | `string` | `null` | no | | cluster\_flavor | Flavor of the CCE2 Cluster | `string` | n/a | yes | | cluster\_name | Name of the cluster | `string` | n/a | yes | +| cluster\_type | Cluster Type, possible values are VirtualMachine and BareMetal | `string` | VirtualMachine | no | | cluster\_version | Version of the cluster | `string` | n/a | yes | | extend\_param | Extended Parameters | `map(string)` | `{}` | no | | key\_pair | Name of the SSH key pair | `string` | n/a | yes | diff --git a/main.tf b/main.tf index 9eb8f8e..f9be385 100644 --- a/main.tf +++ b/main.tf @@ -1,6 +1,6 @@ resource "flexibleengine_cce_cluster_v3" "cce_cluster" { name = var.cluster_name - cluster_type = "VirtualMachine" + cluster_type = var.cluster_type cluster_version = var.cluster_version flavor_id = var.cluster_flavor vpc_id = var.vpc_id diff --git a/variables.tf b/variables.tf index 1866711..62c9281 100644 --- a/variables.tf +++ b/variables.tf @@ -13,6 +13,11 @@ variable "cluster_desc" { type = string } +variable "cluster_type" { + description = "Cluster Type, possible values are VirtualMachine and BareMetal" + type = string + default = "VirtualMachine" +} variable "cluster_eip" { description = "EIP of the cluster" type = string From 600aaece63d6fa34342b4ab0f8d6d3c49bec28ef Mon Sep 17 00:00:00 2001 From: Guillaume Le Blanc Date: Mon, 22 Nov 2021 13:46:52 +0100 Subject: [PATCH 2/3] Add node_pool type --- README.md | 2 +- main.tf | 2 +- variables.tf | 1 + 3 files changed, 3 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 701f635..25b1cdf 100644 --- a/README.md +++ b/README.md @@ -278,7 +278,7 @@ inputs = { | key\_pair | Name of the SSH key pair | `string` | n/a | yes | | network\_id | ID of the Network | `string` | n/a | yes | | node\_os | Operating System of the CCE Worker Node | `string` | n/a | yes | -| node\_pool\_list | Nodes poool list of the CCE2 Cluster |
list(object({
node_pool_index = string
node_pool_name = string
node_flavor = string
availability_zone = string
initial_node_count = number
scall_enable = bool
min_node_count = number
max_node_count = number
scale_down_cooldown_time = number
priority = number
root_volume_size = number
root_volume_type = string
data_volume_size = number
data_volume_type = string
node_labels = map(string)
taints = list(object({
key = string
value = string
effect = string
}))
postinstall_script = string
preinstall_script = string
}))
| `[]` | no | +| node\_pool\_list | Nodes poool list of the CCE2 Cluster |
list(object({
node_pool_index = string
node_pool_name = string
node_flavor = string
availability_zone = string
initial_node_count = number
scall_enable = bool
min_node_count = number
max_node_count = number
scale_down_cooldown_time = number
priority = number
root_volume_size = number
root_volume_type = string
type = string
data_volume_size = number
data_volume_type = string
node_labels = map(string)
taints = list(object({
key = string
value = string
effect = string
}))
postinstall_script = string
preinstall_script = string
}))
| `[]` | no | | nodes\_list | Nodes list of the CCE2 Cluster |
list(object({
node_index = string
node_name = string
node_flavor = string
availability_zone = string
root_volume_size = number
root_volume_type = string
data_volume_size = number
data_volume_type = string
node_labels = map(string)
vm_tags = map(string)
taints = list(object({
key = string
value = string
effect = string
}))
postinstall_script = string
preinstall_script = string
}))
| `[]` | no | | vpc\_id | ID of the VPC | `string` | n/a | yes | diff --git a/main.tf b/main.tf index f9be385..55e21d6 100644 --- a/main.tf +++ b/main.tf @@ -81,7 +81,7 @@ resource "flexibleengine_cce_node_pool_v3" "cce_node_pool" { scale_down_cooldown_time = each.value.scale_down_cooldown_time priority = each.value.priority - type = "vm" + type = each.value.type postinstall = each.value.postinstall_script preinstall = each.value.preinstall_script diff --git a/variables.tf b/variables.tf index 62c9281..dee7083 100644 --- a/variables.tf +++ b/variables.tf @@ -109,6 +109,7 @@ variable "node_pool_list" { priority = number root_volume_size = number root_volume_type = string + type = string data_volume_size = number data_volume_type = string node_labels = map(string) From 5711d76af9223b7f9624bb9b01f246294ea5be13 Mon Sep 17 00:00:00 2001 From: Guillaume Le Blanc Date: Wed, 24 Nov 2021 11:52:13 +0100 Subject: [PATCH 3/3] Fix terraform fmt --- variables.tf | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/variables.tf b/variables.tf index dee7083..8afb84c 100644 --- a/variables.tf +++ b/variables.tf @@ -14,10 +14,11 @@ variable "cluster_desc" { } variable "cluster_type" { - description = "Cluster Type, possible values are VirtualMachine and BareMetal" - type = string - default = "VirtualMachine" + description = "Cluster Type, possible values are VirtualMachine and BareMetal" + type = string + default = "VirtualMachine" } + variable "cluster_eip" { description = "EIP of the cluster" type = string