Skip to content

Dev 4.2.11 #313

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 8 commits into from
May 21, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -371,12 +371,12 @@ proxy_url = VALUE
| <a name="input_application_insights_name"></a> [application\_insights\_name](#input\_application\_insights\_name) | The Application Insights name. | `string` | `""` | no |
| <a name="input_apt_repo_server"></a> [apt\_repo\_server](#input\_apt\_repo\_server) | The URL of the apt private repository. | `string` | `""` | no |
| <a name="input_assign_public_ip"></a> [assign\_public\_ip](#input\_assign\_public\_ip) | Determines whether to assign public IP to all instances deployed by TF module. Includes backends, clients and protocol gateways. | `string` | `"auto"` | no |
| <a name="input_client_arch"></a> [client\_arch](#input\_client\_arch) | Use arch for ami id, value can be arm64/x86\_64, the default value is x86\_64. | `string` | `"x86_64"` | no |
| <a name="input_client_arch"></a> [client\_arch](#input\_client\_arch) | Use arch for ami id, value can be arm64/x86\_64. | `string` | `null` | no |
| <a name="input_client_frontend_cores"></a> [client\_frontend\_cores](#input\_client\_frontend\_cores) | The client NICs number. | `number` | `1` | no |
| <a name="input_client_identity_name"></a> [client\_identity\_name](#input\_client\_identity\_name) | The user assigned identity name for the client instances (if empty - new one is created). | `string` | `""` | no |
| <a name="input_client_instance_type"></a> [client\_instance\_type](#input\_client\_instance\_type) | The client virtual machine type (sku) to deploy. | `string` | `""` | no |
| <a name="input_client_placement_group_id"></a> [client\_placement\_group\_id](#input\_client\_placement\_group\_id) | The client instances placement group id. Backend placement group can be reused. If not specified placement group will be created automatically | `string` | `""` | no |
| <a name="input_client_source_image_id"></a> [client\_source\_image\_id](#input\_client\_source\_image\_id) | Use weka custom image, ubuntu 20.04 with kernel 5.4 and ofed 5.8-1.1.2.1 / ubuntu arm 20.04 with kernel 5.4 and ofed 5.9-0.5.6.0 | <pre>object({<br> x86_64 = string<br> arm64 = string<br> })</pre> | <pre>{<br> "arm64": "/communityGalleries/WekaIO-d7d3f308-d5a1-4c45-8e8a-818aed57375a/images/arm20.04/versions/latest",<br> "x86_64": "/communityGalleries/WekaIO-d7d3f308-d5a1-4c45-8e8a-818aed57375a/images/ubuntu20.04/versions/latest"<br>}</pre> | no |
| <a name="input_client_source_image_id"></a> [client\_source\_image\_id](#input\_client\_source\_image\_id) | Use weka custom image, ubuntu 20.04 with kernel 5.4 and ofed 5.8-1.1.2.1 / ubuntu arm 20.04 with kernel 5.4 and ofed 5.9-0.5.6.0 | `string` | `""` | no |
| <a name="input_clients_custom_data"></a> [clients\_custom\_data](#input\_clients\_custom\_data) | Custom data to pass to the client instances | `string` | `""` | no |
| <a name="input_clients_number"></a> [clients\_number](#input\_clients\_number) | The number of client virtual machines to deploy. | `number` | `0` | no |
| <a name="input_clients_use_dpdk"></a> [clients\_use\_dpdk](#input\_clients\_use\_dpdk) | Mount weka clients in DPDK mode | `bool` | `true` | no |
Expand All @@ -399,7 +399,7 @@ proxy_url = VALUE
| <a name="input_function_app_storage_account_prefix"></a> [function\_app\_storage\_account\_prefix](#input\_function\_app\_storage\_account\_prefix) | Weka storage account name prefix | `string` | `"weka"` | no |
| <a name="input_function_app_subnet_delegation_cidr"></a> [function\_app\_subnet\_delegation\_cidr](#input\_function\_app\_subnet\_delegation\_cidr) | Subnet delegation enables you to designate a specific subnet for an Azure PaaS service. | `string` | `"10.0.1.0/25"` | no |
| <a name="input_function_app_subnet_delegation_id"></a> [function\_app\_subnet\_delegation\_id](#input\_function\_app\_subnet\_delegation\_id) | Required to specify if subnet\_name were used to specify pre-defined subnets for weka. Function subnet delegation requires an additional subnet, and in the case of pre-defined networking this one also should be pre-defined | `string` | `""` | no |
| <a name="input_function_app_version"></a> [function\_app\_version](#input\_function\_app\_version) | Function app code version (hash) | `string` | `"5efbf69b612a1294ac2dc23d81e9a29c"` | no |
| <a name="input_function_app_version"></a> [function\_app\_version](#input\_function\_app\_version) | Function app code version (hash) | `string` | `"2380b026b2b6b84b67c8e553122766ae"` | no |
| <a name="input_get_weka_io_token"></a> [get\_weka\_io\_token](#input\_get\_weka\_io\_token) | The token to download the Weka release from get.weka.io. | `string` | `""` | no |
| <a name="input_hotspare"></a> [hotspare](#input\_hotspare) | Number of hotspares to set on weka cluster. Refer to https://docs.weka.io/overview/ssd-capacity-management#hot-spare | `number` | `1` | no |
| <a name="input_install_cluster_dpdk"></a> [install\_cluster\_dpdk](#input\_install\_cluster\_dpdk) | Install weka cluster with DPDK | `bool` | `true` | no |
Expand Down Expand Up @@ -462,7 +462,7 @@ proxy_url = VALUE
| <a name="input_vnets_to_peer_to_deployment_vnet"></a> [vnets\_to\_peer\_to\_deployment\_vnet](#input\_vnets\_to\_peer\_to\_deployment\_vnet) | List of vent-name:resource-group-name to peer | <pre>list(object({<br> vnet = string<br> rg = string<br> }))</pre> | `[]` | no |
| <a name="input_weka_home_url"></a> [weka\_home\_url](#input\_weka\_home\_url) | Weka Home url | `string` | `""` | no |
| <a name="input_weka_tar_storage_account_id"></a> [weka\_tar\_storage\_account\_id](#input\_weka\_tar\_storage\_account\_id) | ### private blob | `string` | `""` | no |
| <a name="input_weka_version"></a> [weka\_version](#input\_weka\_version) | The Weka version to deploy. | `string` | `"4.2.10"` | no |
| <a name="input_weka_version"></a> [weka\_version](#input\_weka\_version) | The Weka version to deploy. | `string` | `"4.2.11"` | no |
| <a name="input_zone"></a> [zone](#input\_zone) | The zone in which the resources should be created. | `string` | `"1"` | no |

## Outputs
Expand Down
17 changes: 7 additions & 10 deletions ci/deployment/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -10,14 +10,11 @@ provider "azurerm" {
}

module "weka_deployment" {
source = "../.."
prefix = var.prefix
rg_name = var.rg_name
get_weka_io_token = var.get_weka_io_token
subscription_id = var.subscription_id
cluster_name = var.cluster_name
set_obs_integration = true
cluster_size = var.cluster_size
tiering_ssd_percent = 20
allow_ssh_ranges = ["0.0.0.0/0"]
source = "../.."
prefix = var.prefix
rg_name = var.rg_name
get_weka_io_token = var.get_weka_io_token
subscription_id = var.subscription_id
cluster_name = var.cluster_name
cluster_size = var.cluster_size
}
13 changes: 3 additions & 10 deletions clients.tf
Original file line number Diff line number Diff line change
@@ -1,11 +1,3 @@
locals {
default_client_instance_type = {
x86_64 = "Standard_D8_v5"
arm64 = "Standard_E2ps_v5"
}
}


module "clients" {
count = var.clients_number > 0 ? 1 : 0
source = "./modules/clients"
Expand All @@ -18,16 +10,17 @@ module "clients" {
vnet_name = local.vnet_name
vm_identity_name = var.client_identity_name
frontend_container_cores_num = var.clients_use_dpdk ? var.client_frontend_cores : 1
instance_type = var.client_instance_type != "" ? var.client_instance_type : local.default_client_instance_type[var.client_arch]
instance_type = var.client_instance_type
backend_lb_ip = var.create_lb ? azurerm_lb.backend_lb[0].private_ip_address : ""
ssh_public_key = var.ssh_public_key == null ? tls_private_key.ssh_key[0].public_key_openssh : var.ssh_public_key
ppg_id = var.client_placement_group_id == "" ? local.placement_group_id : var.client_placement_group_id
assign_public_ip = local.assign_public_ip
vnet_rg_name = local.vnet_rg_name
source_image_id = var.client_source_image_id[var.client_arch]
source_image_id = var.client_source_image_id
sg_id = local.sg_id
tags_map = var.tags_map
custom_data = var.clients_custom_data
vmss_name = "${var.prefix}-${var.cluster_name}-vmss"
depends_on = [azurerm_proximity_placement_group.ppg, module.network]
arch = var.client_arch
}
2 changes: 1 addition & 1 deletion examples/existing_private_network/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ module "weka_deployment" {
vnet_name = "vnet-name"
vnet_rg_name = "vnet-rg-name"
sg_id = "/subscriptions/../resourceGroups/../providers/Microsoft.Network/networkSecurityGroups/.."
install_weka_url = "https://wekatars.blob.core.windows.net/tars/weka-4.2.10.tar?<SAS_TOKEN>"
install_weka_url = "https://wekatars.blob.core.windows.net/tars/weka-4.2.11.tar?<SAS_TOKEN>"
assign_public_ip = false
cluster_size = 6
tiering_enable_obs_integration = true
Expand Down
2 changes: 1 addition & 1 deletion examples/existing_private_network_with_peering/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ module "weka_deployment" {
rg_name = "weka-rg"
assign_public_ip = false
apt_repo_server = "http://11.0.0.4/ubuntu/mirror/archive.ubuntu.com/ubuntu/"
install_weka_url = "https://wekatars.blob.core.windows.net/tars/weka-4.2.10.tar?<SAS_TOKEN>"
install_weka_url = "https://wekatars.blob.core.windows.net/tars/weka-4.2.11.tar?<SAS_TOKEN>"
vnet_rg_name = "weka-rg"
vnet_name = "weka-vnet"
subnet_name = "weka-subnet"
Expand Down
2 changes: 1 addition & 1 deletion functions.tf
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ locals {
deployment_storage_account_id = var.deployment_storage_account_name == "" ? azurerm_storage_account.deployment_sa[0].id : data.azurerm_storage_account.deployment_blob[0].id
deployment_storage_account_name = var.deployment_storage_account_name == "" ? azurerm_storage_account.deployment_sa[0].name : var.deployment_storage_account_name
deployment_container_name = var.deployment_container_name == "" ? azurerm_storage_container.deployment[0].name : var.deployment_container_name
obs_storage_account_name = var.tiering_obs_name == "" ? "${local.alphanumeric_prefix_name}${local.alphanumeric_cluster_name}obs" : var.tiering_obs_name
obs_storage_account_name = var.tiering_obs_name == "" ? "${substr("${local.alphanumeric_prefix_name}${local.alphanumeric_cluster_name}", 0, 21)}obs" : var.tiering_obs_name
obs_container_name = var.tiering_obs_container_name == "" ? "${var.prefix}-${var.cluster_name}-obs" : var.tiering_obs_container_name
function_app_name = "${local.alphanumeric_prefix_name}-${local.alphanumeric_cluster_name}-function-app"
install_weka_url = var.install_weka_url != "" ? var.install_weka_url : "https://[email protected]/dist/v1/install/${var.weka_version}/${var.weka_version}"
Expand Down
3 changes: 2 additions & 1 deletion modules/clients/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@ No modules.
| Name | Description | Type | Default | Required |
|------|-------------|------|---------|:--------:|
| <a name="input_apt_repo_server"></a> [apt\_repo\_server](#input\_apt\_repo\_server) | The URL of the apt private repository. | `string` | `""` | no |
| <a name="input_arch"></a> [arch](#input\_arch) | n/a | `string` | `null` | no |
| <a name="input_assign_public_ip"></a> [assign\_public\_ip](#input\_assign\_public\_ip) | Determines whether to assign public ip. | `bool` | `true` | no |
| <a name="input_backend_lb_ip"></a> [backend\_lb\_ip](#input\_backend\_lb\_ip) | The backend load balancer ip address. | `string` | `""` | no |
| <a name="input_clients_name"></a> [clients\_name](#input\_clients\_name) | The clients name. | `string` | n/a | yes |
Expand All @@ -51,7 +52,7 @@ No modules.
| <a name="input_ppg_id"></a> [ppg\_id](#input\_ppg\_id) | Placement proximity group id. | `string` | `null` | no |
| <a name="input_rg_name"></a> [rg\_name](#input\_rg\_name) | A predefined resource group in the Azure subscription. | `string` | n/a | yes |
| <a name="input_sg_id"></a> [sg\_id](#input\_sg\_id) | Security group id | `string` | n/a | yes |
| <a name="input_source_image_id"></a> [source\_image\_id](#input\_source\_image\_id) | Use weka custom image, ubuntu 20.04 with kernel 5.4 and ofed 5.8-1.1.2.1 | `string` | n/a | yes |
| <a name="input_source_image_id"></a> [source\_image\_id](#input\_source\_image\_id) | Use weka custom image, ubuntu 20.04 with kernel 5.4 and ofed 5.8-1.1.2.1 | `string` | `""` | no |
| <a name="input_ssh_public_key"></a> [ssh\_public\_key](#input\_ssh\_public\_key) | Ssh public key to pass to vms. | `string` | n/a | yes |
| <a name="input_subnet_name"></a> [subnet\_name](#input\_subnet\_name) | The subnet names. | `string` | n/a | yes |
| <a name="input_tags_map"></a> [tags\_map](#input\_tags\_map) | A map of tags to assign the same metadata to all resources in the environment. Format: key:value. | `map(string)` | `{}` | no |
Expand Down
2 changes: 2 additions & 0 deletions modules/clients/iam.tf
Original file line number Diff line number Diff line change
Expand Up @@ -32,4 +32,6 @@ resource "azurerm_role_assignment" "reader" {
scope = data.azurerm_resource_group.rg.id
role_definition_name = azurerm_role_definition.nics_reader[0].name
principal_id = azurerm_user_assigned_identity.this[0].principal_id

depends_on = [azurerm_role_definition.nics_reader]
}
18 changes: 16 additions & 2 deletions modules/clients/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,20 @@ locals {
vms_custom_data = base64encode(join("\n", local.custom_data_parts))

client_identity_id = var.vm_identity_name == "" ? azurerm_user_assigned_identity.this[0].id : data.azurerm_user_assigned_identity.this[0].id

arm_instances = ["Standard_D4ps_v5", "Standard_D8ps_v5", "Standard_D16ps_v5", "Standard_D32ps_v5", "Standard_D48ps_v5", "Standard_D64ps_v5", "Standard_D8plds_v5", "Standard_D32plds_v5", "Standard_D64plds_v5"]
default_arch = contains(local.arm_instances, var.instance_type) ? "arm64" : "x86_64"
arch = var.arch == null ? local.default_arch : var.arch
default_client_instance_type = {
x86_64 = "Standard_D8_v5"
arm64 = "Standard_E2ps_v5"
}
instance_type = var.instance_type != "" ? var.instance_type : local.default_client_instance_type[local.arch]
default_source_image_id = {
x86_64 = "/communityGalleries/WekaIO-d7d3f308-d5a1-4c45-8e8a-818aed57375a/images/ubuntu20.04/versions/latest"
arm64 = "/communityGalleries/WekaIO-d7d3f308-d5a1-4c45-8e8a-818aed57375a/images/arm20.04/versions/latest"
}
source_image_id = var.source_image_id != "" ? var.source_image_id : local.default_source_image_id[local.arch]
}

resource "azurerm_public_ip" "public_ip" {
Expand Down Expand Up @@ -114,8 +128,8 @@ resource "azurerm_linux_virtual_machine" "this" {
admin_username = var.vm_username
tags = merge({ "weka_cluster_client" : var.clients_name }, var.tags_map)
custom_data = local.vms_custom_data
source_image_id = var.source_image_id
size = var.instance_type
source_image_id = local.source_image_id
size = local.instance_type
network_interface_ids = concat([
local.first_nic_ids[count.index]
], slice(azurerm_network_interface.private_nics[*].id, (local.nics_num - 1) * count.index, (local.nics_num - 1) * (count.index + 1)))
Expand Down
16 changes: 11 additions & 5 deletions modules/clients/variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -10,11 +10,6 @@ variable "frontend_container_cores_num" {
description = "Number of nics to set on each client vm"
}

variable "source_image_id" {
type = string
description = "Use weka custom image, ubuntu 20.04 with kernel 5.4 and ofed 5.8-1.1.2.1"
}

variable "rg_name" {
type = string
description = "A predefined resource group in the Azure subscription."
Expand Down Expand Up @@ -113,3 +108,14 @@ variable "vm_identity_name" {
description = "The name of the user assigned identity for the client VMs."
default = ""
}

variable "arch" {
type = string
default = null
}

variable "source_image_id" {
type = string
description = "Use weka custom image, ubuntu 20.04 with kernel 5.4 and ofed 5.8-1.1.2.1"
default = ""
}
20 changes: 7 additions & 13 deletions variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -129,7 +129,7 @@ variable "logic_app_identity_name" {
variable "weka_version" {
type = string
description = "The Weka version to deploy."
default = "4.2.10"
default = "4.2.11"
}

variable "get_weka_io_token" {
Expand Down Expand Up @@ -495,24 +495,18 @@ variable "client_instance_type" {
}

variable "client_source_image_id" {
type = object({
x86_64 = string
arm64 = string
})
default = {
x86_64 = "/communityGalleries/WekaIO-d7d3f308-d5a1-4c45-8e8a-818aed57375a/images/ubuntu20.04/versions/latest"
arm64 = "/communityGalleries/WekaIO-d7d3f308-d5a1-4c45-8e8a-818aed57375a/images/arm20.04/versions/latest"
}
type = string
description = "Use weka custom image, ubuntu 20.04 with kernel 5.4 and ofed 5.8-1.1.2.1 / ubuntu arm 20.04 with kernel 5.4 and ofed 5.9-0.5.6.0"
default = ""
}

variable "client_arch" {
type = string
default = "x86_64"
description = "Use arch for ami id, value can be arm64/x86_64, the default value is x86_64."
default = null
description = "Use arch for ami id, value can be arm64/x86_64."
validation {
condition = var.client_arch == "arm64" || var.client_arch == "x86_64"
error_message = "Allowed client_arch values: [\"arm64\", \"x86_64\"]."
condition = var.client_arch == "arm64" || var.client_arch == "x86_64" || var.client_arch == null
error_message = "Allowed client_arch values: [\"arm64\", \"x86_64\", null]."
}
}

Expand Down