Skip to content

Commit cc1e0f5

Browse files
authored
Merge pull request #330 from sassoftware/staging
8.0.0 - July 20, 2023
2 parents 60f6d5d + 2782eab commit cc1e0f5

File tree

13 files changed

+185
-21
lines changed

13 files changed

+185
-21
lines changed

docs/CONFIG-VARS.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -315,7 +315,7 @@ When `storage_type=ha` (high availability), [Microsoft Azure NetApp Files](https
315315
| :--- | ---: | ---: | ---: | ---: |
316316
| netapp_service_level | The target performance level of the file system. Valid values include Premium, Standard, or Ultra. | string | "Premium" | |
317317
| netapp_size_in_tb | Provisioned size of the pool in TB. Value must be between 4 and 500 | number | 4 | |
318-
| netapp_protocols | The target volume protocol expressed as a list. Supported single value include CIFS, NFSv3, or NFSv4.1. If argument is not defined, it defaults to NFSv3. Changing this forces a new resource to be created and data will be lost. | list of strings | ["NFSv3"] | |
318+
| netapp_protocols | The target volume protocol expressed as a list. Supported single value include CIFS, NFSv3, or NFSv4.1. If argument is not defined, it defaults to NFSv4.1. Changing this forces a new resource to be created and data will be lost. | list of strings | ["NFSv4.1"] | |
319319
| netapp_volume_path |A unique file path for the volume. Used when creating mount targets. Changing this forces a new resource to be created. | string | "export" | |
320320
| netapp_network_features |Indicates which network feature to use, accepted values are `Basic` or `Standard`, it defaults to `Basic` if not defined. | string | "Basic" | This is a feature in public preview. For more information about it and how to register, please refer to [Configure network features for an Azure NetApp Files volume](https://docs.microsoft.com/en-us/azure/azure-netapp-files/configure-network-features)|
321321

docs/Troubleshooting.md

Lines changed: 32 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,21 @@
11
# Troubleshooting
22

3+
- [Troubleshooting](#troubleshooting)
4+
- [Kubernetes Version is not supported in Azure region](#kubernetes-version-is-not-supported-in-azure-region)
5+
- [Failure to delete AKS Node Pool](#failure-to-delete-aks-node-pool)
6+
- [Import Azure Resource into Terraform state](#import-azure-resource-into-terraform-state)
7+
- [Not able to access AKS with kubectl](#not-able-to-access-aks-with-kubectl)
8+
- [Azure NetApp Files creation fails](#azure-netapp-files-creation-fails)
9+
- [Azure NetApp NFSv3 volume file lock issue](#azure-netapp-nfsv3-volume-file-lock-issue)
10+
311
## Kubernetes Version is not supported in Azure region
412
```bash
513
Error: creating Managed Kubernetes Cluster "viya-tst-aks" (Resource Group "viya-tst-rg"): containerservice.ManagedClustersClient#CreateOrUpdate: Failure sending request: StatusCode=0 -- Original Error: Code="AgentPoolK8sVersionNotSupported" Message="Version 1.18.14 is not supported in this region. Please use [az aks get-versions] command to get the supported version list in this region. For more information, please check https://aka.ms/supported-version-list"
614

715
on modules/azure_aks/main.tf line 2, in resource "azurerm_kubernetes_cluster" "aks":
816
2: resource "azurerm_kubernetes_cluster" "aks" {
917
```
10-
**Resolution:**
18+
### Resolution:
1119
Run this Azure CLI command to get the supported Kubernetes versions in your Azure region and use value for `kubernetes_version` variable in input tfvars.
1220
```bash
1321
az aks get-versions --location <YOUR_AZURE_LOCATION> --output table
@@ -29,7 +37,7 @@ Error: waiting for the deletion of Node Pool "stateful" (Managed Kubernetes Clus
2937
Error: A resource with the ID "/subscriptions/REDACTED/resourcegroups/viya-tst-rg/providers/Microsoft.ContainerService/managedClusters/viya-tst-aks/agentPools/stateless" already exists - to be managed via Terraform this resource needs to be imported into the State. Please see the resource documentation for "azurerm_kubernetes_cluster_node_pool" for more information.
3038
```
3139
32-
**Resolution:**
40+
### Resolution:
3341
3442
```bash
3543
terraform import -var-file=sample-input.tfvars module.aks.azurerm_kubernetes_cluster.aks '/subscription/REDACTED/../../'
@@ -44,7 +52,7 @@ Error: authorization.RoleAssignmentsClient#Create: Failure responding to request
4452
18: resource "azurerm_role_assignment" "acr" {
4553
```
4654
47-
**Resolution:**
55+
### Resolution:
4856
Check values of environment variables - `ARM_* and TF_*`
4957
5058
## Azure NetApp Files creation fails
@@ -57,5 +65,25 @@ Error: Error creating NetApp Account "sse-vdsdp-ha1-netappaccount" (Resource Gro
5765
29: resource "azurerm_netapp_account" "anf" {
5866
```
5967
60-
**Resolution:**
68+
### Resolution:
6169
Check your Azure Subscription has been granted access to Azure NetApp Files service: [Azure Netapp Quickstart](https://docs.microsoft.com/en-us/azure/azure-netapp-files/azure-netapp-files-quickstart-set-up-account-create-volumes?tabs=azure-portal#before-you-begin)
70+
71+
72+
## Azure NetApp NFSv3 volume file lock issue
73+
In event of SAS Viya Platform deployment shutdown on an AKS cluster with Azure NetApp NFSv3 volume, the file locks persist and `sas-consul-server` cannot access raft.db until the file locks are broken.
74+
75+
### Resolution:
76+
There are two options to avoid this issue:
77+
78+
1. Break the file locks from Azure Portal. For details see [Troubleshoot file locks on an Azure NetApp Files volume](https://learn.microsoft.com/en-us/azure/azure-netapp-files/troubleshoot-file-locks).
79+
80+
2. Use Azure NetApp NFS volume version 4.1. Update to the latest version of `sassoftware/viya4-iac-azure` to use NFSv4.1 by default. If you are using sassoftware/viya4-iac-azure's release v7.2.0 or before, then add the variable `netapp_protocols` to your terraform.tfvars to switch to NFSv4.1.
81+
82+
**Note:** Changing this on existing cluster will result in data loss.
83+
84+
Example:
85+
```bash
86+
# Storage HA
87+
storage_type = "ha"
88+
netapp_protocols = ["NFSv4.1"]
89+
```

files/cloud-init/jump/cloud-config

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -43,12 +43,15 @@ runcmd:
4343
# mount the nfs
4444
#
4545
- while [ `df -h | grep "${rwx_filestore_endpoint}:${rwx_filestore_path}" | wc -l` -eq 0 ]; do sleep 5 && mount -a ; done
46-
#
47-
# Change permissions and owner
48-
#
49-
- mkdir -p ${jump_rwx_filestore_path}/pvs
50-
- $(chmod -fR 777 ${jump_rwx_filestore_path} ; echo)
51-
- $(chown -R nobody:nogroup ${jump_rwx_filestore_path} ; echo)
46+
- if ! [ -d "${jump_rwx_filestore_path}/pvs" ]
47+
- then
48+
#
49+
# Change permissions and owner
50+
#
51+
- mkdir -p ${jump_rwx_filestore_path}/pvs
52+
- $(chmod -fR 777 ${jump_rwx_filestore_path} ; echo)
53+
- $(chown -R nobody:nogroup ${jump_rwx_filestore_path} ; echo)
54+
- fi
5255
- fi
5356
#
5457
# Update user for Docker, user=${vm_admin}

files/cloud-init/nfs/cloud-config

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -58,10 +58,13 @@ runcmd:
5858
#
5959
- if [ "${aks_cidr_block}" != "${misc_cidr_block}" ]
6060
- then
61-
- echo "/export ${aks_cidr_block}(rw,no_root_squash,async,insecure,fsid=0,crossmnt,no_subtree_check)" >> /etc/exports
62-
- echo "/export ${misc_cidr_block}(rw,no_root_squash,async,insecure,fsid=0,crossmnt,no_subtree_check)" >> /etc/exports
61+
- echo "/ ${aks_cidr_block}(ro,fsid=0)" >> /etc/exports
62+
- echo "/ ${misc_cidr_block}(ro,fsid=0)" >> /etc/exports
63+
- echo "/export ${aks_cidr_block}(rw,no_root_squash,async,insecure,crossmnt,no_subtree_check)" >> /etc/exports
64+
- echo "/export ${misc_cidr_block}(rw,no_root_squash,async,insecure,crossmnt,no_subtree_check)" >> /etc/exports
6365
- else
64-
- echo "/export ${aks_cidr_block}(rw,no_root_squash,async,insecure,fsid=0,crossmnt,no_subtree_check)" >> /etc/exports
66+
- echo "/ ${aks_cidr_block}(ro,fsid=0)" >> /etc/exports
67+
- echo "/export ${aks_cidr_block}(rw,no_root_squash,async,insecure,crossmnt,no_subtree_check)" >> /etc/exports
6568
- fi
6669
#
6770
# Restart nfs-server service

main.tf

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -252,6 +252,19 @@ module "netapp" {
252252
depends_on = [module.vnet]
253253
}
254254

255+
module "message_broker" {
256+
source = "./modules/azurerm_message_broker"
257+
count = var.create_azure_message_broker ? 1 : 0
258+
259+
resource_group_name = local.aks_rg.name
260+
location = var.location
261+
prefix = var.prefix
262+
message_broker_sku = var.message_broker_sku
263+
message_broker_name = var.message_broker_name
264+
message_broker_capacity = var.message_broker_capacity
265+
tags = var.tags
266+
}
267+
255268
data "external" "git_hash" {
256269
program = ["files/tools/iac_git_info.sh"]
257270
}
Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
# Copyright © 2020-2023, SAS Institute Inc., Cary, NC, USA. All Rights Reserved.
2+
# SPDX-License-Identifier: Apache-2.0
3+
4+
# Azure Service Bus
5+
# - https://learn.microsoft.com/en-us/azure/service-bus-messaging/service-bus-messaging-overview
6+
# - https://registry.terraform.io/providers/hashicorp/azurerm/latest/docs/resources/servicebus_namespace
7+
# - https://registry.terraform.io/providers/hashicorp/azurerm/latest/docs/resources/servicebus_namespace_authorization_rule
8+
9+
resource "azurerm_servicebus_namespace" "message_broker" {
10+
name = "${var.prefix}-message-broker"
11+
location = var.location
12+
resource_group_name = var.resource_group_name
13+
sku = var.message_broker_sku
14+
capacity = var.message_broker_capacity
15+
16+
tags = var.tags
17+
}
18+
19+
resource "azurerm_servicebus_namespace_authorization_rule" "message_broker_config" {
20+
name = var.message_broker_name
21+
namespace_id = azurerm_servicebus_namespace.message_broker.id
22+
23+
listen = true
24+
send = true
25+
manage = true
26+
}
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
# Copyright © 2020-2023, SAS Institute Inc., Cary, NC, USA. All Rights Reserved.
2+
# SPDX-License-Identifier: Apache-2.0
3+
4+
output "message_broker_hostname" {
5+
value = regex("//(.*):", azurerm_servicebus_namespace.message_broker.endpoint)
6+
}
7+
8+
output "message_broker_primary_key" {
9+
value = azurerm_servicebus_namespace_authorization_rule.message_broker_config.primary_key
10+
}
Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
# Copyright © 2020-2023, SAS Institute Inc., Cary, NC, USA. All Rights Reserved.
2+
# SPDX-License-Identifier: Apache-2.0
3+
4+
variable "prefix" {
5+
description = "A prefix used in the name for all the Azure resources created by this script."
6+
type = string
7+
}
8+
9+
variable "resource_group_name" {
10+
description = "The name of the resource group in which to create the PostgreSQL Server. Changing this forces a new resource to be created."
11+
type = string
12+
}
13+
14+
variable "location" {
15+
description = "Specifies the supported Azure location where the resource exists. Changing this forces a new resource to be created."
16+
type = string
17+
}
18+
19+
variable "message_broker_sku" {
20+
description = "Defines which tier to use. Options are Basic, Standard or Premium. SAS Viya Platform recommends using 'Premium'."
21+
type = string
22+
default = "Premium"
23+
}
24+
25+
variable "message_broker_name" {
26+
description = "Specifies the name of the message broker, also specified for the ServiceBus Namespace Authorization Rule resource. Changing this forces a new resource to be created."
27+
type = string
28+
default = "Arke"
29+
}
30+
31+
variable "message_broker_capacity" {
32+
description = "Specifies the capacity. When sku is Premium, capacity can be 1, 2, 4, 8 or 16. When sku is Basic or Standard, capacity can be 0 only."
33+
type = number
34+
default = 1
35+
}
36+
37+
variable "tags" {
38+
description = "Map of common tags to be placed on the Resources"
39+
type = map(any)
40+
}

modules/azurerm_netapp/variables.tf

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -55,9 +55,9 @@ variable "volume_path" {
5555
}
5656

5757
variable "protocols" {
58-
description = "The target volume protocol expressed as a list. Supported single value include CIFS, NFSv3, or NFSv4.1. If argument is not defined it will default to NFSv3. Changing this forces a new resource to be created and data will be lost."
58+
description = "The target volume protocol expressed as a list. Supported single value include CIFS, NFSv3, or NFSv4.1. If argument is not defined it will default to NFSv4.1. Changing this forces a new resource to be created and data will be lost."
5959
type = list(string)
60-
default = ["NFSv3"]
60+
default = ["NFSv4.1"]
6161
}
6262

6363
variable "allowed_clients" {

outputs.tf

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -144,3 +144,17 @@ output "cluster_node_pool_mode" {
144144
output "cluster_api_mode" {
145145
value = var.cluster_api_mode
146146
}
147+
148+
## Message Broker - Azure Service Bus
149+
output "message_broker_hostname" {
150+
value = var.create_azure_message_broker ? element(flatten(module.message_broker[*].message_broker_hostname), 0) : null
151+
}
152+
153+
output "message_broker_primary_key" {
154+
value = var.create_azure_message_broker ? element(coalescelist(module.message_broker[*].message_broker_primary_key, [""]), 0) : null
155+
sensitive = true
156+
}
157+
158+
output "message_broker_name" {
159+
value = var.create_azure_message_broker ? var.message_broker_name : null
160+
}

0 commit comments

Comments
 (0)