Skip to content

Commit d78b39a

Browse files
authored
feat: use block storage for crunchy and rabbit in Azure (PSKD-1025) (#601)
Signed-off-by: John Boone <[email protected]>
1 parent 6503f3b commit d78b39a

File tree

9 files changed

+165
-80
lines changed

9 files changed

+165
-80
lines changed

docs/CONFIG-VARS.md

Lines changed: 44 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -74,6 +74,7 @@ Supported configuration variables are listed in the table below. All variables
7474
| V4_CFG_CLOUD_SERVICE_ACCOUNT_AUTH | Full path to service account credentials file | string | | false | See [Ansible Cloud Authentication](user/AnsibleCloudAuthentication.md) for more information. | viya |
7575

7676
## Jump Server
77+
7778
Viya4-deployment uses the jump server to interact with the RWX filestore, which must be pre-mounted to `JUMP_SVR_RWX_FILESTORE_PATH` when `V4_CFG_MANAGE_STORAGE` is set to `true`.
7879

7980
| Name | Description | Type | Default | Required | Notes | Tasks |
@@ -83,13 +84,27 @@ Viya4-deployment uses the jump server to interact with the RWX filestore, which
8384
| JUMP_SVR_PRIVATE_KEY | Path to the SSH user's private key to access the jump server host | string | | true | | baseline, viya |
8485
| JUMP_SVR_RWX_FILESTORE_PATH | Path on the jump server to the NFS mount | string | /viya-share | false | | viya |
8586

86-
## Storage for AWS
87+
## Storage
88+
89+
### Storage for AWS
90+
8791
When `V4_CFG_MANAGE_STORAGE` is set to `true`, viya4-deployment uses the [EBS CSI driver](#ebs-csi-driver) to create two elastic block storage based storage classes with the default names of `io2-vol-mq` and `io2-vol-pg`. The volume type for both storage classes defaults to `io2`. For EKS clusters, RabbitMQ makes PVC requests to create block storage persistent volumes using the `io2-vol-mq` storage class while Crunchy Postgres makes PVC requests to create block storage persistent volumes using the `io2-vol-pg` storage class. Viya4-deployment also creates the `sas` storage class using the nfs-subdir-external-provisioner Helm chart. If a jump server is used, viya4-deployment uses that server to create the folders for the `astores`, `bin`, `data` and `homes` RWX Filestore NFS paths that are outlined below in the [RWX Filestore](#rwx-filestore) section.
8892

93+
### Storage for Azure
94+
95+
By default, viya4-deployment uses the [Azure managed disks CSI driver](#azure-managed-disk-csi-driver) to create two elastic block storage based storage classes with the default names of `managed-csi-premium-v2-mq` and `managed-csi-premium-v2-pg`. The disk SKU for both storage classes defaults to `PremiumV2_LRS`. For AKS clusters, RabbitMQ makes PVC requests to create block storage persistent volumes using the `managed-csi-premium-v2-mq` storage class while Crunchy Postgres makes PVC requests to create block storage persistent volumes using the `managed-csi-premium-v2-pg` storage class. To use a different StorageClass for RabbitMQ, set the `V4_CFG_RABBITMQ_STORAGECLASS` property to the name of the StorageClass to use. To use a different StorageClass for Crunchy Postgres, set the `V4_CFG_CRUNCHY_STORAGECLASS` property to the name of the StorageClass to use.
8996

90-
## Storage for Azure and Google Cloud
97+
**NOTE**: The Azure managed disk CSI Driver can only be included at AKS cluster creation time. It is included in all AKS clusters by default, and any AKS clusters created with viya4-iac-azure will have the driver installed. If you did not use the viya4-iac-azure project to create your AKS cluster, ensure that you have enabled the Azure disk CSI driver prior to using this project or disable the creation of the StorageClasses.
98+
99+
viya4-deployment also creates the `sas` storage class using the nfs-subdir-external-provisioner Helm chart. If a jump server is used, viya4-deployment uses that server to create the folders for the `astores`, `bin`, `data` and `homes` RWX Filestore NFS paths that are outlined below in the [RWX Filestore](#rwx-filestore) section.
100+
101+
### Storage for Google Cloud
91102
When `V4_CFG_MANAGE_STORAGE` is set to `true`, viya4-deployment creates the `sas` and `pg-storage` storage classes using the nfs-subdir-external-provisioner Helm chart. If a jump server is used, viya4-deployment uses that server to create the folders for the `astores`, `bin`, `data` and `homes` RWX Filestore NFS paths that are outlined below in the [RWX Filestore](#rwx-filestore) section.
92103

104+
### NFS Storage
105+
106+
When `V4_CFG_MANAGE_STORAGE` is set to `true`, viya4-deployment creates NFS-based storage classes using the nfs-subdir-external-provisioner Helm chart.
107+
93108
When `V4_CFG_MANAGE_STORAGE` is set to `false`, viya4-deployment does not create the `sas` or `pg-storage` storage classes for you. In addition, viya4-deployment does not create or manage the RWX Filestore NFS paths. Before you run the SAS Viya deployment, you must set the values for `V4_CFG_RWX_FILESTORE_DATA_PATH` and `V4_CFG_RWX_FILESTORE_HOMES_PATH` to specify existing NFS folder locations. The viya4-deployment user can create the required NFS folders from the jump server before starting the deployment. Recommended attribute settings for each folder are as follows:
94109
- **filemode**: `0777`
95110
- **group**: the equivalent of `nogroup` for your operating system
@@ -100,7 +115,7 @@ When `V4_CFG_MANAGE_STORAGE` is set to `false`, viya4-deployment does not create
100115
| V4_CFG_MANAGE_STORAGE | Whether viya4-deployment should manage the StorageClass | bool | true | false | Set to false if you want to manage the StorageClass yourself. | all |
101116
| V4_CFG_STORAGECLASS | StorageClass name | string | "sas" | false | When V4_CFG_MANAGE_STORAGE is false, set to the name of your preexisting StorageClass that supports ReadWriteMany. | baseline, viya |
102117

103-
### RWX Filestore
118+
#### RWX Filestore
104119

105120
| Name | Description | Type | Default | Required | Notes | Tasks |
106121
| :--- | ---: | ---: | ---: | ---: | ---: | ---: |
@@ -109,15 +124,15 @@ When `V4_CFG_MANAGE_STORAGE` is set to `false`, viya4-deployment does not create
109124
| V4_CFG_RWX_FILESTORE_DATA_PATH | NFS path to data directory | string | <V4_CFG_RWX_FILESTORE_PATH>/\<NAMESPACE>/data | false | | viya |
110125
| V4_CFG_RWX_FILESTORE_HOMES_PATH | NFS path to homes directory | string | <V4_CFG_RWX_FILESTORE_PATH>/\<NAMESPACE>/homes | false | | viya |
111126

112-
### Azure
127+
#### Azure
113128

114-
When V4_CFG_MANAGE_STORAGE is set to `true`, the `sas` and `pg-storage` storage classes are created (Azure NetApp or NFS).
129+
When V4_CFG_MANAGE_STORAGE is set to `true`, the `sas` storage class is created (Azure NetApp or NFS).
115130

116-
### AWS
131+
#### AWS
117132

118-
When V4_CFG_MANAGE_STORAGE is set to `true`, the efs-provisioner is deployed, the `sas` and `pg-storage` storage classes are created (EFS or NFS).
133+
When V4_CFG_MANAGE_STORAGE is set to `true`, the efs-provisioner is deployed, and the `sas` storage class is created (EFS or NFS).
119134

120-
### Google Cloud
135+
#### Google Cloud
121136

122137
When V4_CFG_MANAGE_STORAGE is set to `true`, the `sas` and `pg-storage` storage classes are created (Google Filestore or NFS).
123138

@@ -161,7 +176,6 @@ When V4_CFG_MANAGE_STORAGE is set to `true`, the `sas` and `pg-storage` storage
161176
| :--- | ---: | ---: | ---: | ---: | ---: | ---: |
162177
| V4_CFG_AWS_LB_SUBNETS | The AWS subnets and by association the AWS availability zones to deploy the load balancing service to. This variable sets an ingress-nginx annotation which interacts with the [Cloud Controller Manager](https://kubernetes.io/docs/tasks/administer-cluster/developing-cloud-controller-manager/) to set the subnets used by the AWS load balancer. Specifying a subnet value or values for this variable takes precedence over the Subnet Discovery method described in [AWS docs](https://docs.aws.amazon.com/eks/latest/userguide/network-load-balancing.html) that relies on the tags applied to AWS subnets documented in scenario 2 of this [table.](https://github.com/sassoftware/viya4-iac-aws/blob/main/docs/user/BYOnetwork.md#supported-scenarios-and-requirements-for-using-existing-network-resources) This variable can be set with [BYO network scenarios 0-3](https://github.com/sassoftware/viya4-iac-aws/blob/main/docs/user/BYOnetwork.md#supported-scenarios-and-requirements-for-using-existing-network-resources). | string | | false | The value is either a comma separated list of subnet IDs, or a comma separated list of subnet names. Does not affect the subnets used for load balancers enabled with `V4_CFG_CAS_ENABLE_LOADBALANCER`, `V4_CFG_CONNECT_ENABLE_LOADBALANCER`, or `V4_CFG_CONSUL_ENABLE_LOADBALANCER`. | baseline |
163178

164-
165179
## TLS
166180

167181
The SAS Viya platform supports two certificate generators: cert-manager and openssl.
@@ -347,7 +361,6 @@ Cluster-autoscaler is currently only used for AWS EKS clusters. Google GKE and A
347361

348362
If you used [viya4-iac-aws:5.6.0](https://github.com/sassoftware/viya4-iac-aws/releases) or newer to create your infrastructure, a cluster autoscaler account should have been created for you with a policy that is compatible with both our default versions for the `CLUSTER_AUTOSCALER_CHART_VERSION` variable. If you choose an alternative version ensure that your autoscaler account has a policy that matches the recommendation from the [kubernetes/autoscaler documentation](https://github.com/kubernetes/autoscaler/blob/master/cluster-autoscaler/cloudprovider/aws/README.md#iam-policy). This note is only applicable for EKS clusters.
349363

350-
351364
### EBS CSI Driver
352365

353366
The EBS CSI driver is only used for kubernetes v1.23 or later AWS EKS clusters.
@@ -370,6 +383,27 @@ The EBS CSI driver is only used for kubernetes v1.23 or later AWS EKS clusters.
370383
|EBS_CSI_CRUNCHY_STORAGE_CLASS_THROUGHPUT | Maximum volume throughput in MiB/s for the `EBS_CSI_CRUNCHY_STORAGE_CLASS_NAME` storage class | string| 400 | false | The maximum value for io2, io1 and gp3 volume types is 1000.| baseline |
371384
|EBS_CSI_CRUNCHY_STORAGE_CLASS_RECLAIM_POLICY | The ReclaimPolicy for the `EBS_CSI_CRUNCHY_STORAGE_CLASS_NAME` storage class. | string | Delete | false | Supported values: [`Delete`, `Retain`] **Note**: If set to `Retain`, manual deletion of the Crunchy Persistent Volumes is required after deleting the PostgresCluster.| baseline |
372385

386+
### Azure managed disk CSI Driver
387+
388+
The Azure managed disk CSI Driver can only be included at AKS cluster creation time. It is included in all AKS clusters by default, and any AKS clusters created with viya4-iac-azure will have the driver installed. If you did not use the viya4-iac-azure project to create your AKS cluster, ensure that you have enabled the Azure disk CSI driver prior to using this project or disable the creation of the StorageClasses.
389+
390+
By default, two block storage StorageClasses are created using the driver, one for RabbitMQ and one for Crunchy Postgres. The defaults for these StorageClasses are listed below.
391+
392+
**Note**: The StorageClasses created by viya4-deployment are intended for the Premium SSD v2 or Ultra Disk types. If you would like to use the Premium SSD v1 type or lower, disable creation of the StorageClasses in this project and use one of the default StorageClasses provided by the CSI driver.
393+
394+
| Name | Description | Type | Default | Required | Notes | Tasks |
395+
| :--- | ---: | ---: | ---: | ---: | ---: | ---: |
396+
|CREATE_AZURE_RABBITMQ_STORAGE_CLASS| Whether to create an Azure files StorageClass for RabbitMQ | bool | true | false | | baseline |
397+
|AZURE_RABBITMQ_STORAGE_CLASS_NAME| The StorageClass name for RabbitMQ | string | managed-csi-premium-v2-mq | false | | baseline |
398+
|AZURE_RABBITMQ_STORAGE_CLASS_SKU_NAME| The disk type SKU name to use for RabbitMQ persistent volumes | string | PremiumV2_LRS | false | Supported values: [`PremiumV2_LRS`, `UltraSSD_LRS`] | baseline |
399+
|AZURE_RABBITMQ_STORAGE_CLASS_DISKIOPS | Disk total IOPS parameter for the `AZURE_RABBITMQ_STORAGE_CLASS_NAME` storage class|string|3000|false | Refer to the [Azure documentation](https://learn.microsoft.com/en-us/azure/virtual-machines/disks-types) for IOPS limits considerations | baseline |
400+
|AZURE_RABBITMQ_STORAGE_CLASS_THROUGHPUT| Maximum volume throughput in MiB/s for the `AZURE_RABBITMQ_STORAGE_CLASS_NAME` storage class| string| 400 | false | Refer to the [Azure documentation](https://learn.microsoft.com/en-us/azure/virtual-machines/disks-types) for throughput limits considerations | baseline |
401+
|CREATE_AZURE_CRUNCHY_STORAGE_CLASS| Whether to create an Azure files StorageClass for Crunchy Postgres | bool | true | false | | baseline |
402+
|AZURE_CRUNCHY_STORAGE_CLASS_NAME| The StorageClass name for Crunchy Postgres | string| managed-csi-premium-v2-pg | false | | baseline |
403+
|AZURE_CRUNCHY_STORAGE_CLASS_SKU_NAME| The disk type SKU name to use for Crunchy Postgres persistent volumes | string | PremiumV2_LRS | false | Supported values: [`PremiumV2_LRS`, `UltraSSD_LRS`] | baseline |
404+
|AZURE_CRUNCHY_STORAGE_CLASS_DISKIOPS | Disk total IOPS parameter for the `AZURE_CRUNCHY_STORAGE_CLASS_NAME` storage class | string | 5000 | false | Refer to the [Azure documentation](https://learn.microsoft.com/en-us/azure/virtual-machines/disks-types) for IOPS limits considerations | baseline |
405+
|AZURE_CRUNCHY_STORAGE_CLASS_THROUGHPUT | Maximum volume throughput in MiB/s for the `AZURE_CRUNCHY_STORAGE_CLASS_NAME` storage class | string| 400 | false | Refer to the [Azure documentation](https://learn.microsoft.com/en-us/azure/virtual-machines/disks-types) for throughput limits considerations | baseline |
406+
|AZURE_CRUNCHY_STORAGE_CLASS_RECLAIM_POLICY | The ReclaimPolicy for the `AZURE_CRUNCHY_STORAGE_CLASS_NAME` storage class | string | Delete | false | Supported values: [`Delete`, `Retain`] **Note**: If set to `Retain`, manual deletion of the Crunchy Persistent Volumes is required after deleting the PostgresCluster. | baseline |
373407

374408
### Ingress-nginx
375409

roles/baseline/defaults/main.yml

Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -259,3 +259,45 @@ private_ingress:
259259

260260
## NIST Features
261261
V4_CFG_NIST_FEATURES_ENABLED: false
262+
263+
## Azure StorageClass config
264+
CREATE_AZURE_RABBITMQ_STORAGE_CLASS: true
265+
AZURE_RABBITMQ_STORAGE_CLASS_NAME: managed-csi-premium-v2-mq
266+
AZURE_RABBITMQ_STORAGE_CLASS_SKU_NAME: PremiumV2_LRS
267+
AZURE_RABBITMQ_STORAGE_CLASS_DISKIOPS: 3000
268+
AZURE_RABBITMQ_STORAGE_CLASS_THROUGHPUT: 400
269+
AZURE_RABBITMQ_STORAGE_CLASS:
270+
allowVolumeExpansion: true
271+
apiVersion: storage.k8s.io/v1
272+
kind: StorageClass
273+
metadata:
274+
name: "{{ AZURE_RABBITMQ_STORAGE_CLASS_NAME }}"
275+
parameters:
276+
skuname: "{{ AZURE_RABBITMQ_STORAGE_CLASS_SKU_NAME }}"
277+
fstype: ext4
278+
DiskIOPSReadWrite: "{{ AZURE_RABBITMQ_STORAGE_CLASS_DISKIOPS | int }}"
279+
DiskMBpsReadWrite: "{{ AZURE_RABBITMQ_STORAGE_CLASS_THROUGHPUT | int }}"
280+
provisioner: disk.csi.azure.com
281+
reclaimPolicy: Delete
282+
volumeBindingMode: WaitForFirstConsumer
283+
284+
CREATE_AZURE_CRUNCHY_STORAGE_CLASS: true
285+
AZURE_CRUNCHY_STORAGE_CLASS_NAME: managed-csi-premium-v2-pg
286+
AZURE_CRUNCHY_STORAGE_CLASS_SKU_NAME: PremiumV2_LRS
287+
AZURE_CRUNCHY_STORAGE_CLASS_DISKIOPS: 5000
288+
AZURE_CRUNCHY_STORAGE_CLASS_THROUGHPUT: 400
289+
AZURE_CRUNCHY_STORAGE_CLASS_RECLAIM_POLICY: Delete
290+
AZURE_CRUNCHY_STORAGE_CLASS:
291+
allowVolumeExpansion: true
292+
apiVersion: storage.k8s.io/v1
293+
kind: StorageClass
294+
metadata:
295+
name: "{{ AZURE_CRUNCHY_STORAGE_CLASS_NAME }}"
296+
parameters:
297+
skuname: "{{ AZURE_CRUNCHY_STORAGE_CLASS_SKU_NAME }}"
298+
fstype: ext4
299+
DiskIOPSReadWrite: "{{ AZURE_CRUNCHY_STORAGE_CLASS_DISKIOPS | int }}"
300+
DiskMBpsReadWrite: "{{ AZURE_CRUNCHY_STORAGE_CLASS_THROUGHPUT | int }}"
301+
provisioner: disk.csi.azure.com
302+
reclaimPolicy: "{{ AZURE_CRUNCHY_STORAGE_CLASS_RECLAIM_POLICY }}"
303+
volumeBindingMode: WaitForFirstConsumer

roles/baseline/tasks/main.yaml

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -71,6 +71,14 @@
7171
tags:
7272
- baseline
7373

74+
- name: Include StorageClasses
75+
include_tasks:
76+
file: storage-classes.yaml
77+
when:
78+
- PROVIDER == "azure"
79+
tags:
80+
- baseline
81+
7482
- name: Include cert manager
7583
include_tasks:
7684
file: cert-manager.yaml

roles/baseline/tasks/nfs-subdir-external-provisioner.yaml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -66,6 +66,7 @@
6666
- name: Deploy nfs-subdir-external-provisioner-pg-storage
6767
when:
6868
- PROVIDER != "aws"
69+
- PROVIDER != "azure"
6970
kubernetes.core.helm:
7071
name: "{{ PG_NFS_CLIENT_NAME }}"
7172
namespace: "{{ PG_NFS_CLIENT_NAMESPACE }}"
@@ -93,6 +94,7 @@
9394
- name: Remove nfs-subdir-external-provisioner-pg-storage
9495
when:
9596
- PROVIDER != "aws"
97+
- PROVIDER != "azure"
9698
kubernetes.core.helm:
9799
name: "{{ PG_NFS_CLIENT_NAME }}"
98100
namespace: "{{ NFS_CLIENT_NAMESPACE }}"
Lines changed: 55 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,55 @@
1+
- name: Create Azure storage class for RabbitMQ
2+
kubernetes.core.k8s:
3+
api_version: v1
4+
definition: "{{ AZURE_RABBITMQ_STORAGE_CLASS }}"
5+
wait: true
6+
wait_timeout: 600
7+
state: present
8+
kubeconfig: "{{ KUBECONFIG }}"
9+
when:
10+
- PROVIDER == "azure"
11+
- CREATE_AZURE_RABBITMQ_STORAGE_CLASS
12+
tags:
13+
- install
14+
15+
- name: Create Azure storage class for Postgres
16+
kubernetes.core.k8s:
17+
api_version: v1
18+
definition: "{{ AZURE_CRUNCHY_STORAGE_CLASS }}"
19+
wait: true
20+
wait_timeout: 600
21+
state: present
22+
kubeconfig: "{{ KUBECONFIG }}"
23+
when:
24+
- PROVIDER == "azure"
25+
- CREATE_AZURE_CRUNCHY_STORAGE_CLASS
26+
tags:
27+
- install
28+
29+
- name: Remove Azure storage class for RabbitMQ
30+
kubernetes.core.k8s:
31+
api_version: v1
32+
definition: "{{ AZURE_RABBITMQ_STORAGE_CLASS }}"
33+
wait: true
34+
wait_timeout: 600
35+
state: absent
36+
kubeconfig: "{{ KUBECONFIG }}"
37+
when:
38+
- PROVIDER == "azure"
39+
- CREATE_AZURE_RABBITMQ_STORAGE_CLASS
40+
tags:
41+
- uninstall
42+
43+
- name: Remove Azure storage class for Postgres
44+
kubernetes.core.k8s:
45+
api_version: v1
46+
definition: "{{ AZURE_CRUNCHY_STORAGE_CLASS }}"
47+
wait: true
48+
wait_timeout: 600
49+
state: absent
50+
kubeconfig: "{{ KUBECONFIG }}"
51+
when:
52+
- PROVIDER == "azure"
53+
- CREATE_AZURE_CRUNCHY_STORAGE_CLASS
54+
tags:
55+
- uninstall

roles/vdm/defaults/main.yaml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,8 @@ V4_CFG_RWX_FILESTORE_ASTORES_PATH: "{{ V4_CFG_RWX_FILESTORE_PATH | replace('/$',
3232
V4_CFG_RWX_FILESTORE_BIN_PATH: "{{ V4_CFG_RWX_FILESTORE_PATH | replace('/$', '') }}/{{ NAMESPACE }}/bin"
3333

3434
V4_CFG_STORAGECLASS: sas
35+
V4_CFG_RABBITMQ_STORAGECLASS: "{{ 'io2-vol-mq' if PROVIDER == 'aws' else ('managed-csi-premium-v2-mq' if PROVIDER == 'azure' else V4_CFG_STORAGECLASS) }}"
36+
V4_CFG_CRUNCHY_STORAGECLASS: "{{ 'io2-vol-pg' if PROVIDER == 'aws' else ('managed-csi-premium-v2-pg' if PROVIDER == 'azure' else 'pg-storage') }}"
3537
V4_CFG_MANAGE_STORAGE: true
3638

3739
V4_CFG_DEPLOYMENT_URL_PREFIX: null

0 commit comments

Comments
 (0)