Skip to content

Commit 80a98bf

Browse files
authored
Merge pull request #637 from sassoftware/pr-pskd-807
feat!: replace nfs-subdir-external-provisioner with csi-driver-nfs
2 parents a9a4405 + 04a0ba4 commit 80a98bf

File tree

6 files changed

+278
-164
lines changed

6 files changed

+278
-164
lines changed

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ This project contains Ansible code that creates a baseline cluster in an existin
3838

3939
- Prepare Kubernetes cluster
4040
- Deploy [ingress-nginx](https://kubernetes.github.io/ingress-nginx)
41-
- Deploy [nfs-subdir-external-provisioner](https://github.com/kubernetes-sigs/nfs-subdir-external-provisioner) for PVs
41+
- Deploy [csi-driver-nfs](https://github.com/kubernetes-csi/csi-driver-nfs) for PVs
4242
- Deploy [cert-manager](https://github.com/jetstack/cert-manager) for TLS
4343
- Deploy [metrics-server](https://github.com/bitnami/charts/tree/master/bitnami/metrics-server/) (AWS only)
4444
- Deploy [aws-ebs-csi-driver](https://github.com/kubernetes-sigs/aws-ebs-csi-driver) (AWS only)

docs/CONFIG-VARS.md

Lines changed: 16 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -90,22 +90,22 @@ Viya4-deployment uses the jump server to interact with the RWX filestore, which
9090

9191
### Storage for AWS
9292

93-
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.
93+
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 csi-driver-nfs 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.
9494

9595
### Storage for Azure
9696

9797
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.
9898

9999
**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.
100100

101-
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.
101+
viya4-deployment also creates the `sas` storage class using the csi-driver-nfs 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.
102102

103103
### Storage for Google Cloud
104-
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.
104+
When `V4_CFG_MANAGE_STORAGE` is set to `true`, viya4-deployment creates the `sas` and `pg-storage` storage classes using the csi-driver-nfs 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.
105105

106106
### NFS Storage
107107

108-
When `V4_CFG_MANAGE_STORAGE` is set to `true`, viya4-deployment creates NFS-based storage classes using the nfs-subdir-external-provisioner Helm chart.
108+
When `V4_CFG_MANAGE_STORAGE` is set to `true`, viya4-deployment creates NFS-based storage classes using the csi-driver-nfs Helm chart.
109109

110110
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:
111111
- **filemode**: `0777`
@@ -431,24 +431,24 @@ Kubernetes Metrics Server installation is currently only applicable for AWS EKS
431431

432432
### NFS Client
433433

434-
The NFS client is currently supported by the newer nfs-subdir-external-provisioner.
434+
The NFS client is currently supported by the csi-driver-nfs.
435435

436436
| Name | Description | Type | Default | Required | Notes | Tasks |
437437
| :--- | ---: | ---: | ---: | ---: | ---: | ---: |
438-
| NFS_CLIENT_NAMESPACE | nfs-subdir-external-provisioner Helm installation namespace | string | nfs-client | false | | baseline |
439-
| NFS_CLIENT_CHART_URL | nfs-subdir-external-provisioner Helm chart URL | string | Go [here](https://kubernetes-sigs.github.io/nfs-subdir-external-provisioner/) for more information. | false | | baseline |
440-
| NFS_CLIENT_CHART_NAME | nfs-subdir-external-provisioner Helm chart name | string | nfs-subdir-external-provisioner | false | | baseline |
441-
| NFS_CLIENT_CHART_VERSION | nfs-subdir-external-provisioner Helm chart version | string | 4.0.18| false | | baseline |
442-
| NFS_CLIENT_CONFIG | nfs-subdir-external-provisioner Helm values | string | See [this file](../roles/baseline/defaults/main.yml) for more information. | false | | baseline |
438+
| CSI_DRIVER_NFS_NAMESPACE | csi-driver-nfs Helm installation namespace | string | kube-system | false | | baseline |
439+
| CSI_DRIVER_NFS_CHART_URL | csi-driver-nfs Helm chart URL | string | Go [here](https://github.com/kubernetes-csi/csi-driver-nfs/) for more information. | false | | baseline |
440+
| CSI_DRIVER_NFS_CHART_NAME | csi-driver-nfs Helm chart name | string | csi-driver-nfs | false | | baseline |
441+
| CSI_DRIVER_NFS_CHART_VERSION | csi-driver-nfs Helm chart version | string | 4.11.0 | false | | baseline |
442+
| CSI_DRIVER_NFS_CONFIG | csi-driver-nfs Helm values | string | See [this file](../roles/baseline/defaults/main.yml) for more information. | false | | baseline |
443443

444444
### Postgres NFS Client
445445

446-
The Postgres NFS client is currently supported by the nfs-subdir-external-provisioner. It creates the storage class used by 2022.10 and later internal postgres instances.
446+
The Postgres NFS client is currently supported by the csi-driver-nfs. It creates the storage class used by 2022.10 and later internal postgres instances.
447447

448448
| Name | Description | Type | Default | Required | Notes | Tasks |
449449
| :--- | ---: | ---: | ---: | ---: | ---: | ---: |
450-
| PG_NFS_CLIENT_NAMESPACE | nfs-subdir-external-provisioner Helm installation namespace | string | nfs-client | false | | baseline |
451-
| PG_NFS_CLIENT_CHART_URL | nfs-subdir-external-provisioner Helm chart URL | string | Go [here](https://kubernetes-sigs.github.io/nfs-subdir-external-provisioner/) for more information. | false | | baseline |
452-
| PG_NFS_CLIENT_CHART_NAME | nfs-subdir-external-provisioner Helm chart name | string | nfs-subdir-external-provisioner | false | | baseline |
453-
| PG_NFS_CLIENT_CHART_VERSION | nfs-subdir-external-provisioner Helm chart version | string | 4.0.18| false | | baseline |
454-
| PG_NFS_CLIENT_CONFIG | nfs-subdir-external-provisioner Helm values | string | See [this file](../roles/baseline/defaults/main.yml) for more information. | false | | baseline |
450+
| CSI_DRIVER_NFS_PG_NAMESPACE | csi-driver-nfs Helm installation namespace | string | nfs-client | false | | baseline |
451+
| CSI_DRIVER_NFS_PG_CHART_URL | csi-driver-nfs Helm chart URL | string | Go [here](https://github.com/kubernetes-csi/csi-driver-nfs/) for more information. | false | | baseline |
452+
| CSI_DRIVER_NFS_PG_CHART_NAME | csi-driver-nfs Helm chart name | string | csi-driver-nfs | false | | baseline |
453+
| CSI_DRIVER_NFS_PG_CHART_VERSION | csi-driver-nfs Helm chart version | string | 4.11.0 | false | | baseline |
454+
| CSI_DRIVER_NFS_PG_CONFIG | csi-driver-nfs Helm values | string | See [this file](../roles/baseline/defaults/main.yml) for more information. | false | | baseline |

roles/baseline/defaults/main.yml

Lines changed: 54 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# Copyright © 2020-2024, SAS Institute Inc., Cary, NC, USA. All Rights Reserved.
1+
# Copyright © 2020-2025, SAS Institute Inc., Cary, NC, USA. All Rights Reserved.
22
# SPDX-License-Identifier: Apache-2.0
33

44
---
@@ -8,6 +8,7 @@ V4_CFG_INGRESS_TYPE: ingress
88
V4_CFG_INGRESS_MODE: public
99
V4_CFG_MANAGE_STORAGE: true
1010
V4_CFG_AWS_LB_SUBNETS: ""
11+
STORAGE_TYPE_BACKEND: ""
1112

1213
## Cert-manager
1314
CERT_MANAGER_NAME: cert-manager
@@ -111,27 +112,35 @@ INGRESS_NGINX_ANNOTATIONS_RISK_LEVEL:
111112
config:
112113
annotations-risk-level: "Critical"
113114

114-
## Nfs-subdir-external-provisioner
115-
NFS_CLIENT_NAME: nfs-subdir-external-provisioner-sas
116-
NFS_CLIENT_NAMESPACE: nfs-client
117-
NFS_CLIENT_CHART_NAME: nfs-subdir-external-provisioner
118-
NFS_CLIENT_CHART_URL: https://kubernetes-sigs.github.io/nfs-subdir-external-provisioner/
119-
NFS_CLIENT_CHART_VERSION: 4.0.18
120-
NFS_CLIENT_CONFIG:
121-
nfs:
122-
server: "{{ V4_CFG_RWX_FILESTORE_ENDPOINT }}"
123-
path: "{{ V4_CFG_RWX_FILESTORE_PATH | replace('/$', '') }}/pvs"
115+
## Csi-driver-provisioner
116+
CSI_DRIVER_NFS_NAME: csi-driver-nfs-sas
117+
CSI_DRIVER_NFS_NAMESPACE: kube-system
118+
CSI_DRIVER_NFS_CHART_NAME: csi-driver-nfs
119+
CSI_DRIVER_NFS_CHART_URL: https://raw.githubusercontent.com/kubernetes-csi/csi-driver-nfs/master/charts
120+
CSI_DRIVER_NFS_CHART_VERSION: 4.11.0
121+
CSI_DRIVER_NFS_CONFIG:
122+
driver:
123+
mountPermissions: "0777"
124+
storageClass:
125+
create: true
126+
name: sas
127+
annotations:
128+
reclaimPolicy: Delete
129+
volumeBindingMode: Immediate
130+
parameters:
131+
server: "{{ V4_CFG_RWX_FILESTORE_ENDPOINT }}"
132+
share: "{{ '/ontap' if STORAGE_TYPE_BACKEND == 'ontap' else ('/pvs' if PROVIDER != 'azure' else (V4_CFG_RWX_FILESTORE_PATH | replace('/$', '') ~ '/pvs')) }}"
133+
subDir: ${pvc.metadata.namespace}/${pvc.metadata.name}/${pv.metadata.name}
134+
mountPermissions: "0777"
124135
mountOptions:
136+
- vers=4.1
125137
- noatime
126138
- nodiratime
127139
- rsize=262144
128140
- wsize=262144
129-
storageClass:
130-
archiveOnDelete: "false"
131-
name: sas
132141
# EFS best practice NFS mount options for the aws provider
133-
NFS_EFS_CLIENT_CONFIG:
134-
nfs:
142+
CSI_DRIVER_NFS_EFS_CONFIG:
143+
storageClass:
135144
mountOptions:
136145
- noresvport
137146
- rsize=1048576
@@ -142,24 +151,41 @@ NFS_EFS_CLIENT_CONFIG:
142151
- _netdev
143152

144153
## pg-storage storage class config
145-
PG_NFS_CLIENT_NAME: nfs-subdir-external-provisioner-pg-storage
146-
PG_NFS_CLIENT_NAMESPACE: nfs-client
147-
PG_NFS_CLIENT_CHART_NAME: nfs-subdir-external-provisioner
148-
PG_NFS_CLIENT_CHART_URL: https://kubernetes-sigs.github.io/nfs-subdir-external-provisioner/
149-
PG_NFS_CLIENT_CHART_VERSION: 4.0.18
150-
PG_NFS_CLIENT_CONFIG:
151-
nfs:
152-
server: "{{ V4_CFG_RWX_FILESTORE_ENDPOINT }}"
153-
path: "{{ V4_CFG_RWX_FILESTORE_PATH | replace('/$', '') }}/pvs"
154+
CSI_DRIVER_NFS_PG_NAME: csi-driver-nfs-pg-storage
155+
CSI_DRIVER_NFS_PG_NAMESPACE: nfs-client
156+
CSI_DRIVER_NFS_PG_CHART_NAME: csi-driver-nfs
157+
CSI_DRIVER_NFS_PG_CHART_URL: https://raw.githubusercontent.com/kubernetes-csi/csi-driver-nfs/master/charts
158+
CSI_DRIVER_NFS_PG_CHART_VERSION: 4.11.0
159+
CSI_DRIVER_NFS_PG_CONFIG:
160+
driver:
161+
mountPermissions: "0777"
162+
storageClass:
163+
reclaimPolicy: Retain
164+
volumeBindingMode: Immediate
165+
create: true
166+
name: pg-storage
167+
annotations:
168+
parameters:
169+
server: "{{ V4_CFG_RWX_FILESTORE_ENDPOINT }}"
170+
share: "{{ '/ontap' if STORAGE_TYPE_BACKEND == 'ontap' else ('/pvs' if PROVIDER != 'azure' else (V4_CFG_RWX_FILESTORE_PATH | replace('/$', '') ~ '/pvs')) }}"
171+
subDir: ${pvc.metadata.namespace}/${pvc.metadata.name}/${pv.metadata.name}
172+
mountPermissions: "0777"
154173
mountOptions:
155174
- noatime
156175
- nodiratime
157176
- rsize=262144
158177
- wsize=262144
178+
# EFS best practice NFS mount options for the aws provider
179+
CSI_DRIVER_NFS_PG_EFS_CONFIG:
159180
storageClass:
160-
archiveOnDelete: "false"
161-
reclaimPolicy: Retain
162-
name: pg-storage
181+
mountOptions:
182+
- noresvport
183+
- rsize=1048576
184+
- wsize=1048576
185+
- soft
186+
- timeo=600
187+
- retrans=2
188+
- _netdev
163189

164190
## Contour - Ingress
165191
CONTOUR_NAME: contour

roles/baseline/tasks/main.yaml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
1-
# Copyright © 2020-2024, SAS Institute Inc., Cary, NC, USA. All Rights Reserved.
1+
# Copyright © 2020-2025, SAS Institute Inc., Cary, NC, USA. All Rights Reserved.
22
# SPDX-License-Identifier: Apache-2.0
33

44

55
---
6-
- name: Include nfs-subdir-external-provisioner
6+
- name: Include nfs.csi.k8s.io
77
include_tasks:
8-
file: nfs-subdir-external-provisioner.yaml
8+
file: nfs-csi-provisioner.yaml
99
when:
1010
- V4_CFG_RWX_FILESTORE_ENDPOINT is defined
1111
- V4_CFG_RWX_FILESTORE_PATH is defined

0 commit comments

Comments
 (0)