Skip to content

Commit 43a52e3

Browse files
authored
Merge pull request #230 from sassoftware/staging
7.2.0 - January 16, 2025
2 parents 5aa3e66 + cfd8871 commit 43a52e3

22 files changed

+284
-51
lines changed

Dockerfile

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

4-
ARG TERRAFORM_VERSION=1.8.5
5-
ARG GCP_CLI_VERSION=479.0.0
4+
ARG TERRAFORM_VERSION=1.9.6
5+
ARG GCP_CLI_VERSION=496.0.0
66

7-
FROM hashicorp/terraform:$TERRAFORM_VERSION as terraform
7+
FROM hashicorp/terraform:$TERRAFORM_VERSION AS terraform
88
FROM google/cloud-sdk:$GCP_CLI_VERSION-alpine
9-
ARG KUBECTL_VERSION=1.29.7
9+
ARG KUBECTL_VERSION=1.30.6
1010
ARG ENABLE_GKE_GCLOUD_AUTH_PLUGIN=True
1111
ARG INSTALL_COMPONENTS=""
1212

@@ -18,14 +18,14 @@ COPY . .
1818
RUN apk update \
1919
&& apk upgrade --no-cache \
2020
&& apk add --no-cache jq \
21-
&& curl -sLO https://storage.googleapis.com/kubernetes-release/release/v$KUBECTL_VERSION/bin/linux/amd64/kubectl \
21+
&& curl -sLO https://dl.k8s.io/release/v$KUBECTL_VERSION/bin/linux/amd64/kubectl \
2222
&& chmod 755 ./kubectl /viya4-iac-gcp/docker-entrypoint.sh \
2323
&& mv ./kubectl /usr/local/bin/kubectl \
24-
&& chmod g=u -R /etc/passwd /etc/group /viya4-iac-gcp \
2524
&& git config --system --add safe.directory /viya4-iac-gcp \
2625
&& terraform init \
2726
&& gcloud components install gke-gcloud-auth-plugin alpha beta cloud-sql-proxy $INSTALL_COMPONENTS \
28-
&& rm -rf /google-cloud-sdk/.install/.backup
27+
&& rm -rf /google-cloud-sdk/.install/.backup \
28+
&& chmod g=u -R /etc/passwd /etc/group /viya4-iac-gcp
2929

3030
ENV TF_VAR_iac_tooling=docker
3131
ENV USE_GKE_GCLOUD_AUTH_PLUGIN=$ENABLE_GKE_GCLOUD_AUTH_PLUGIN

README.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ This project contains Terraform scripts to provision Google Cloud infrastructure
88
>- Managed Google Kubernetes Engine (GKE) cluster
99
>- System and User GKE Node pools with required Labels and Taints
1010
>- Infrastructure to deploy SAS Viya platform CAS in SMP or MPP mode
11-
>- Shared Storage options for SAS Viya platform - Google Filestore (ha) or NFS Server (standard)
11+
>- Shared Storage options for SAS Viya platform - Google Filestore (ha), Google NetApp Volumes (ha) or NFS Server (standard)
1212
>- Google Cloud SQL for PostgreSQL instance, optional
1313
1414
[<img src="./docs/images/viya4-iac-gcp-diag.png" alt="Architecture Diagram" width="750"/>](./docs/images/viya4-iac-gcp-diag.png?raw=true)
@@ -31,10 +31,10 @@ Operational knowledge of
3131

3232
- Terraform or Docker
3333
- #### Terraform
34-
- [Terraform](https://www.terraform.io/downloads.html) - v1.8.5
35-
- [kubectl](https://kubernetes.io/docs/tasks/tools/install-kubectl) - v1.29.7
36-
- [jq](https://stedolan.github.io/jq/) - v1.6
37-
- [gcloud CLI](https://cloud.google.com/sdk/gcloud) - (optional - useful as an alternative to the Google Cloud Platform Portal) - v479.0.0
34+
- [Terraform](https://www.terraform.io/downloads.html) - v1.9.6
35+
- [kubectl](https://kubernetes.io/docs/tasks/tools/install-kubectl) - v1.30.6
36+
- [jq](https://stedolan.github.io/jq/) - v1.7
37+
- [gcloud CLI](https://cloud.google.com/sdk/gcloud) - (optional - useful as an alternative to the Google Cloud Platform Portal) - v496.0.0
3838
- [gke-gcloud-auth-plugin](https://cloud.google.com/kubernetes-engine/docs/how-to/cluster-access-for-kubectl#install_plugin) - (optional - only for provider based Kubernetes configuration files) - >= v1.26
3939
- #### Docker
4040
- [Docker](https://docs.docker.com/get-docker/)

config/sample-input-tf-enterprise.tfvars

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ create_static_kubeconfig = true
3838
# tags = {} # e.g., { "key1" = "value1", "key2" = "value2" }
3939

4040
# GKE config
41-
kubernetes_version = "1.29"
41+
kubernetes_version = "1.30"
4242
default_nodepool_min_nodes = 1
4343
default_nodepool_vm_type = "n2-highmem-8"
4444

docs/CONFIG-VARS.md

Lines changed: 23 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,8 @@ Supported configuration variables are listed in the table below. All variables
1717
- [Additional Nodepools](#additional-nodepools)
1818
- [Storage](#storage)
1919
- [For `storage_type=standard` only (NFS server VM)](#for-storage_typestandard-only-nfs-server-vm)
20-
- [For `storage_type=ha` only (Google Filestore)](#for-storage_typeha-only-google-filestore)
20+
- [For `storage_type=ha` with Google Filestore](#for-storage_typeha-with-google-filestore)
21+
- [For `storage_type=ha` with Google NetApp Volumes](#for-storage_typeha-with-google-netapp-volumes)
2122
- [Google Artifact Registry (GAR) and Google Container Registry (GCR)](#google-artifact-registry-gar-and-google-container-registry-gcr)
2223
- [Postgres Servers](#postgres-servers)
2324
- [Monitoring](#monitoring)
@@ -65,10 +66,11 @@ You can use `default_public_access_cidrs` to set a default range for all created
6566
| gke_subnet_cidr | Address space for the subnet for the GKE resources | string | "192.168.0.0/23" | This variable is ignored when `vpc_name` is set (aka bring your own vnet) |
6667
| gke_pod_subnet_cidr | Secondary address space in the GKE subnet for Kubernetes Pods | string | "10.0.0.0/17" | This variable is ignored when `subnet_names` is set (aka bring your own subnets) |
6768
| gke_service_subnet_cidr | Secondary address space in the GKE subnet for Kubernetes Services | string | "10.1.0.0/22" | This variable is ignored when `subnet_names` is set (aka bring your own subnets) |
68-
| gke_control_plane_subnet_cidr | Address space for the hosted master subnet | string | "10.2.0.0/28" | When providing your own subnets (by setting `subnet_names` make sure your subnets do not overlap this range |
69+
| gke_control_plane_subnet_cidr | Address space for the hosted primary subnet | string | "10.2.0.0/28" | When providing your own subnets (by setting `subnet_names` make sure your subnets do not overlap this range |
6970
| misc_subnet_cidr | Address space for the the auxiliary resources (Jump VM and optionally NFS VM) subnet | string | "192.168.2.0/24" | This variable is ignored when `subnet_names` is set (aka bring your own subnet) |
7071
| filestore_subnet_cidr | Address space for Google Filestore subnet | string | "192.168.3.0/29" | Needs to be at least a /29 range. Only used when `storage_type="ha"` |
7172
| database_subnet_cidr | Address space for Google Cloud SQL Postgres subnet | string | "192.168.4.0/23" | Only used with external postgres |
73+
| netapp_subnet_cidr | Address space for Google Cloud NetApp Volumes subnet | string | "192.168.5.0/24" | Needs to be at least a /24 range. Only used when `storage_type="ha"` and `storage_type_backend="netapp"` |
7274

7375
### Use Existing
7476

@@ -212,6 +214,7 @@ stateful = {
212214
| Name | Description | Type | Default | Notes |
213215
| :--- | ---: | ---: | ---: | ---: |
214216
| storage_type | Type of Storage. Valid Values: "standard", "ha" | string | "standard" | "standard" creates NFS server VM, "ha" Google Filestore instance |
217+
| storage_type_backend | The storage backend for the chosen `storage_type`. | string | If `storage_type=standard` the default is "nfs";<br>If `storage_type=ha` the default is "filestore" | Valid Values: "nfs" if `storage_type=standard`; "filestore" or "netapp" if `storage_type=ha` |
215218

216219
### For `storage_type=standard` only (NFS server VM)
217220

@@ -221,13 +224,27 @@ stateful = {
221224
| nfs_vm_admin | OS Admin User for the NFS server VM | string | "nfsuser" | The NFS server VM is only created when storage_type="standard" |
222225
| nfs_raid_disk_size | Size in Gb for each disk of the RAID5 cluster on the NFS server VM | number | 1000 | The NFS server VM is only created when storage_type="standard" |
223226

224-
### For `storage_type=ha` only (Google Filestore)
227+
### For `storage_type=ha` with Google Filestore
225228

226229
| Name | Description | Type | Default | Notes |
227230
| :--- | ---: | ---: | ---: | ---: |
228231
| filestore_tier | The service tier for the Google Filestore Instance | string | "BASIC_HDD" | Valid Values: "BASIC_HDD", "BASIC_SSD" (previously called "STANDARD" and "PREMIUM" respectively.) |
229232
| filestore_size_in_gb | Size in GB of Filesystem in the Google Filestore Instance | number | 1024 for BASIC_HDD, 2560 for BASIC_SDD | 2560 GB is the minimum size for the BASIC_SSD tier. The BASIC_HDD tier allows a minimum size of 1024 GB. |
230233

234+
### For `storage_type=ha` with Google NetApp Volumes
235+
236+
When `storage_type=ha` and `storage_type_backend=netapp` are specified, [Google NetApp Volumes](https://cloud.google.com/netapp/volumes/docs/discover/overview) service is created. Before using this storage option,
237+
- Enable the Google Cloud NetApp Volumes API for your project, see how to enable [here](https://cloud.google.com/netapp/volumes/docs/get-started/configure-access/initiate-console-settings#enable_the_api).
238+
- Grant access to NetApp Volumes operations by granting IAM roles to users. The two predefined roles are `roles/netapp.admin` and `roles/netapp.viewer`. You can assign these roles to specific users or service accounts.
239+
- NetApp Volumes is available in several regions. For details about region availability, see [NetApp Volumes locations](https://cloud.google.com/netapp/volumes/docs/locations).
240+
241+
| Name | Description | Type | Default | Notes |
242+
| :--- | ---: | ---: | ---: | ---: |
243+
| netapp_service_level | The service level of the storage pool. | string | "PREMIUM" | Valid Values are: PREMIUM, EXTREME, STANDARD, FLEX. |
244+
| netapp_protocols | The target volume protocol expressed as a list. | list(string) | ["NFSV3"] | Each value may be one of: NFSV3, NFSV4, SMB. Currently, only NFSV3 is supported by SAS Viya Platform. |
245+
| netapp_capacity_gib | Capacity of the storage pool (in GiB). Storage Pool capacity specified must be between 2048 GiB and 10485760 GiB. | string | "2048" | |
246+
| netapp_volume_path | A unique file path for the volume. Used when creating mount targets. Needs to be unique per location.| string | | |
247+
231248
## Google Artifact Registry (GAR) and Google Container Registry (GCR)
232249

233250
| Name | Description | Type | Default | Notes |
@@ -267,8 +284,8 @@ Each server element, like `foo = {}`, can contain none, some, or all of the para
267284
| administrator_password | The Password associated with the administrator_login for the PostgreSQL Server | string | "my$up3rS3cretPassw0rd" | |
268285
| server_version | The version of the PostgreSQL server instance | string | "15" | Refer to the [SAS Viya Platform Administration Guide](https://documentation.sas.com/?cdcId=sasadmincdc&cdcVersion=default&docsetId=itopssr&docsetTarget=p05lfgkwib3zxbn1t6nyihexp12n.htm#p1wq8ouke3c6ixn1la636df9oa1u) for the supported versions of PostgreSQL for the SAS Viya platform. |
269286
| ssl_enforcement_enabled | Enforce SSL on connection to the PostgreSQL database | bool | true | |
270-
| availability_type | The availability type for the master instance. | string | "ZONAL" | This is only used to set up high availability for the PostgreSQL instance. Can be either `ZONAL` or `REGIONAL`. |
271-
| database_flags | Database flags for the master instance. | list(object({})) | | More details can be found [here](https://cloud.google.com/sql/docs/postgres/flags) |
287+
| availability_type | The availability type for the primary instance. | string | "ZONAL" | This is only used to set up high availability for the PostgreSQL instance. Can be either `ZONAL` or `REGIONAL`. |
288+
| database_flags | Database flags for the primary instance. | list(object({})) | | More details can be found [here](https://cloud.google.com/sql/docs/postgres/flags) |
272289

273290
Multiple SAS offerings require a second PostgreSQL instance referred to as SAS Common Data Store, or CDS PostgreSQL. For more information, see [Common Customizations](https://documentation.sas.com/?cdcId=itopscdc&cdcVersion=default&docsetId=dplyml0phy0dkr&docsetTarget=n08u2yg8tdkb4jn18u8zsi6yfv3d.htm#p0wkxxi9s38zbzn19ukjjaxsc0kl). A list of SAS offerings that require CDS PostgreSQL is provided in [SAS Common Data Store Requirements](https://documentation.sas.com/?cdcId=itopscdc&cdcVersion=default&docsetId=itopssr&docsetTarget=p05lfgkwib3zxbn1t6nyihexp12n.htm#n03wzanutmc6gon1val5fykas9aa). To create and configure an external CDS PostgreSQL instance in addition to the external platform PostgreSQL instance named `default`, specify `cds-postgres` as a second PostgreSQL instance, as shown in the example below.
274291

@@ -306,4 +323,4 @@ postgres_servers = {
306323
| gke_monitoring_enabled_components | List of services to monitor: SYSTEM_COMPONENTS, WORKLOADS (WORKLOADS deprecated in 1.24). | list of strings | ["SYSTEM_COMPONENTS"] | |
307324
| enable_managed_prometheus | Enable Google Cloud [Managed Service for Prometheus](https://cloud.google.com/stackdriver/docs/managed-prometheus) for your cluster | boolean | false | |
308325

309-
Note: For additional details about Google Kubernetes Engine (GKE) integration with Cloud Logging and Cloud Monitoring, including Google Cloud [Managed Service for Prometheus](https://cloud.google.com/stackdriver/docs/managed-prometheus), view the ["Overview of Google Cloud's operations suite for GKE" documentation](https://cloud.google.com/stackdriver/docs/solutions/gke)
326+
Note: For additional details about Google Kubernetes Engine (GKE) integration with Cloud Logging and Cloud Monitoring, including Google Cloud [Managed Service for Prometheus](https://cloud.google.com/stackdriver/docs/managed-prometheus), view the ["Overview of Google Cloud's operations suite for GKE" documentation](https://cloud.google.com/stackdriver/docs/solutions/gke)

docs/user/TerraformGCPAuthentication.md

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,9 @@ The Service Account will need the following [IAM roles](https://cloud.google.com
3939
| `roles/container.admin` | Kubernetes Engine Admin | Cluster creation |
4040
| `roles/container.clusterAdmin` | Kubernetes Engine Cluster Admin | Terraform Kubernetes Engine Module |
4141
| `roles/container.developer` | Kubernetes Engine Developer | Cluster creation |
42-
| `roles/file.editor` | Cloud Filestore Editor | Needed for [`storage_type=="HA"`](../CONFIG-VARS.md#storage) |
42+
| `roles/file.editor` | Cloud Filestore Editor | Needed for [`storage_type=="ha" && storage_type_backend = "filestore"`](../CONFIG-VARS.md#storage) |
43+
| `roles/netapp.admin` | NetApp Admin | Needed for [`storage_type=="ha" && storage_type_backend = "netapp"`](../CONFIG-VARS.md#storage) |
44+
| `roles/netapp.viewer` | NetApp Viewer | Needed for [`storage_type=="ha" && storage_type_backend = "netapp"`](../CONFIG-VARS.md#storage) |
4345
| `roles/iam.serviceAccountAdmin` | Service Account Admin | Terraform Kubernetes Engine Module |
4446
| `roles/iam.serviceAccountUser` | Service Account User | Terraform Kubernetes Engine Module |
4547
| `roles/resourcemanager.projectIamAdmin` | Project IAM Admin | Terraform Kubernetes Engine Module |
@@ -59,6 +61,8 @@ gcloud projects add-iam-policy-binding $PROJECT --member serviceAccount:${SA_NAM
5961
gcloud projects add-iam-policy-binding $PROJECT --member serviceAccount:${SA_NAME}@${PROJECT}.iam.gserviceaccount.com --role roles/container.clusterAdmin
6062
gcloud projects add-iam-policy-binding $PROJECT --member serviceAccount:${SA_NAME}@${PROJECT}.iam.gserviceaccount.com --role roles/container.developer
6163
gcloud projects add-iam-policy-binding $PROJECT --member serviceAccount:${SA_NAME}@${PROJECT}.iam.gserviceaccount.com --role roles/file.editor
64+
gcloud projects add-iam-policy-binding $PROJECT --member serviceAccount:${SA_NAME}@${PROJECT}.iam.gserviceaccount.com --role roles/netapp.admin
65+
gcloud projects add-iam-policy-binding $PROJECT --member serviceAccount:${SA_NAME}@${PROJECT}.iam.gserviceaccount.com --role roles/netapp.viewer
6266
gcloud projects add-iam-policy-binding $PROJECT --member serviceAccount:${SA_NAME}@${PROJECT}.iam.gserviceaccount.com --role roles/iam.serviceAccountAdmin
6367
gcloud projects add-iam-policy-binding $PROJECT --member serviceAccount:${SA_NAME}@${PROJECT}.iam.gserviceaccount.com --role roles/iam.serviceAccountUser
6468
gcloud projects add-iam-policy-binding $PROJECT --member serviceAccount:${SA_NAME}@${PROJECT}.iam.gserviceaccount.com --role roles/resourcemanager.projectIamAdmin

examples/sample-input-byo.tfvars

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ postgres_servers = {
3737
}
3838

3939
# GKE config
40-
kubernetes_version = "1.29"
40+
kubernetes_version = "1.30"
4141
default_nodepool_min_nodes = 2
4242
default_nodepool_vm_type = "n2-highmem-8"
4343

examples/sample-input-connect.tfvars

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ postgres_servers = {
2727
}
2828

2929
# GKE config
30-
kubernetes_version = "1.29"
30+
kubernetes_version = "1.30"
3131
default_nodepool_min_nodes = 2
3232
default_nodepool_vm_type = "n2-highmem-8"
3333

examples/sample-input-ha.tfvars

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ postgres_servers = {
2727
}
2828

2929
# GKE config
30-
kubernetes_version = "1.29"
30+
kubernetes_version = "1.30"
3131
default_nodepool_min_nodes = 2
3232
default_nodepool_vm_type = "n2-highmem-8"
3333

@@ -94,5 +94,6 @@ jump_vm_admin = "jumpuser"
9494
# Storage for Viya Compute Services
9595
# Supported storage_type values
9696
# "standard" - Custom managed NFS Server VM and disks
97-
# "ha" - Google Filestore
97+
# "ha" - Google Filestore or Google NetApp Volumes
9898
storage_type = "ha"
99+
storage_type_backend = "filestore" # "filestore" is the default, use "netapp" to create Google NetApp Volumes

examples/sample-input-minimal.tfvars

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ tags = {} # e.g., { "key1" = "value1", "key2" = "value2" }
2727
# }
2828

2929
# GKE config
30-
kubernetes_version = "1.29"
30+
kubernetes_version = "1.30"
3131
default_nodepool_min_nodes = 1
3232
default_nodepool_vm_type = "n2-highmem-8"
3333

examples/sample-input.tfvars

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ postgres_servers = {
2727
}
2828

2929
# GKE config
30-
kubernetes_version = "1.29"
30+
kubernetes_version = "1.30"
3131
default_nodepool_min_nodes = 2
3232
default_nodepool_vm_type = "n2-highmem-8"
3333

0 commit comments

Comments
 (0)