Skip to content

Commit 23050ed

Browse files
authored
Merge pull request #8 from FlexibleEngineCloud/osa_extendparam
Osa extendparam
2 parents a114153 + 974e72b commit 23050ed

File tree

9 files changed

+88
-46
lines changed

9 files changed

+88
-46
lines changed

README.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,6 @@ module "cce2_cluster" {
1717
1818
cluster_name = "cluster-test"
1919
cluster_desc = " Cluster for testing purpose"
20-
availability_zone = "eu-west-0a"
2120
2221
cluster_flavor = "cce.s1.small"
2322
vpc_id = "<VPC_ID>"
@@ -264,6 +263,8 @@ inputs = {
264263

265264
## Inputs
266265

266+
## Inputs
267+
267268
| Name | Description | Type | Default | Required |
268269
|------|-------------|------|---------|:--------:|
269270
| availability\_zone | Availability Zone used to deploy | `string` | `"eu-west-0a"` | no |
@@ -272,6 +273,7 @@ inputs = {
272273
| cluster\_flavor | Flavor of the CCE2 Cluster | `string` | n/a | yes |
273274
| cluster\_name | Name of the cluster | `string` | n/a | yes |
274275
| cluster\_version | Version of the cluster | `string` | n/a | yes |
276+
| extend\_param | Extended Parameters | `map(string)` | `{}` | no |
275277
| key\_pair | Name of the SSH key pair | `string` | n/a | yes |
276278
| network\_id | ID of the Network | `string` | n/a | yes |
277279
| node\_os | Operating System of the CCE Worker Node | `string` | n/a | yes |

examples/ha-cluster/README.md

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
# CCE Cluster in HA mode with Multi AZs MAsters
2+
3+
4+
# Usage
5+
6+
Fill the parameters in the main.tf and provider.tf files, and run the Terraform commands:
7+
8+
```bash
9+
$ terraform init
10+
$ terraform plan
11+
$ terraform apply
12+
```

examples/ha-cluster/main.tf

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
module "cce2_cluster" {
2+
source = "FlexibleEngineCloud/cce/flexibleengine"
3+
version = "2.3.1"
4+
5+
cluster_name = "cluster-test"
6+
cluster_desc = " Cluster for testing purpose"
7+
8+
cluster_flavor = "cce.s2.small"
9+
vpc_id = "<VPC_ID>"
10+
network_id = "<NETWORK_ID>" //Caution here, you have to use NETWORK_ID even if argument is "subnet_id". Will be fixed soon
11+
cluster_version = "v1.15.6-r1"
12+
extend_param = {
13+
clusterAZ = "multi_az"
14+
}
15+
16+
17+
node_os = "CentOS 7.5" // Can be "EulerOS 2.5" or "CentOS 7.5"
18+
key_pair = "<SSH_KEY_NAME>"
19+
20+
nodes_list = [
21+
{
22+
node_index = "node0"
23+
node_name = "cce-node1"
24+
node_flavor = "s3.large.2"
25+
availability_zone = "eu-west-0a"
26+
root_volume_type = "SATA"
27+
root_volume_size = 40
28+
data_volume_type = "SATA"
29+
data_volume_size = 100
30+
node_labels = {}
31+
vm_tags = {}
32+
postinstall_script = null
33+
preinstall_script = null
34+
taints = []
35+
}
36+
]
37+
}

examples/ha-cluster/provider.tf

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
provider "flexibleengine" {
2+
auth_url = "https://iam.eu-west-0.prod-cloud-ocb.orange-business.com/v3"
3+
region = "eu-west-0"
4+
}

examples/ha-cluster/versions.tf

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
terraform {
2+
required_providers {
3+
flexibleengine = {
4+
source = "FlexibleEngineCloud/flexibleengine"
5+
}
6+
}
7+
required_version = ">= 0.13"
8+
}

examples/postinstall-script/README.md

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
# CCE Cluster with Post Install Script provide to a Node
2+
3+
# Usage
4+
5+
Fill the parameters in the main.tf and provider.tf files, and run the Terraform commands:
6+
7+
```bash
8+
$ terraform init
9+
$ terraform plan
10+
$ terraform apply
11+
```

examples/postinstall-script/main.tf

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
module "cce2_cluster" {
22
source = "FlexibleEngineCloud/cce/flexibleengine"
3-
version = "2.2.0"
3+
version = "2.3.1"
44

55
cluster_name = "cluster-test"
66
cluster_desc = " Cluster for testing purpose"
@@ -16,17 +16,19 @@ module "cce2_cluster" {
1616

1717
nodes_list = [
1818
{
19-
node_name = "new-node1"
19+
node_index = "node0"
20+
node_name = "cce-node1"
2021
node_flavor = "s3.large.2"
2122
availability_zone = "eu-west-0a"
2223
root_volume_type = "SATA"
2324
root_volume_size = 40
2425
data_volume_type = "SATA"
2526
data_volume_size = 100
26-
node_labels = null # this paramters si to be set empty for an existing node
27-
vm_tags = null # this parameters can added to an existing node
27+
node_labels = {}
28+
vm_tags = {}
2829
postinstall_script = data.template_file.test.rendered
2930
preinstall_script = null
31+
taints = []
3032
}
3133
]
3234
}

main.tf

Lines changed: 1 addition & 41 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ resource "flexibleengine_cce_cluster_v3" "cce_cluster" {
88
container_network_type = "overlay_l2"
99
eip = var.cluster_eip
1010
description = var.cluster_desc
11+
extend_param = var.extend_param
1112
}
1213

1314
locals {
@@ -62,47 +63,6 @@ resource "flexibleengine_cce_node_v3" "cce_cluster_node" {
6263
}
6364
}
6465

65-
# resource "flexibleengine_cce_node_v3" "cce_cluster_node" {
66-
# count = length(var.nodes_list)
67-
# cluster_id = flexibleengine_cce_cluster_v3.cce_cluster.id
68-
# name = var.nodes_list[count.index]["node_name"]
69-
# flavor_id = var.nodes_list[count.index]["node_flavor"]
70-
# os = var.node_os
71-
# availability_zone = var.nodes_list[count.index]["availability_zone"]
72-
# key_pair = var.key_pair
73-
# postinstall = var.nodes_list[count.index]["postinstall_script"]
74-
# preinstall = var.nodes_list[count.index]["preinstall_script"]
75-
76-
# labels = var.nodes_list[count.index]["node_labels"]
77-
# tags = var.nodes_list[count.index]["vm_tags"]
78-
79-
# root_volume {
80-
# size = var.nodes_list[count.index]["root_volume_size"]
81-
# volumetype = var.nodes_list[count.index]["root_volume_type"]
82-
# }
83-
84-
# data_volumes {
85-
# size = var.nodes_list[count.index]["data_volume_size"]
86-
# volumetype = var.nodes_list[count.index]["data_volume_type"]
87-
# }
88-
89-
# dynamic "taints" {
90-
# for_each = var.nodes_list[count.index]["taints"]
91-
# content {
92-
# key = taints.value.key
93-
# value = taints.value.value
94-
# effect = taints.value.effect
95-
# }
96-
# }
97-
98-
# lifecycle {
99-
# create_before_destroy = true
100-
# ignore_changes = [annotations, labels]
101-
# }
102-
# }
103-
104-
105-
10666
resource "flexibleengine_cce_node_pool_v3" "cce_node_pool" {
10767
for_each = local.node_pool_list_map
10868

variables.tf

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,12 @@ variable "key_pair" {
5858
type = string
5959
}
6060

61+
variable "extend_param" {
62+
description = "Extended Parameters"
63+
type = map(string)
64+
default = {}
65+
}
66+
6167
variable "nodes_list" {
6268
description = "Nodes list of the CCE2 Cluster"
6369
default = []

0 commit comments

Comments
 (0)