Deployment on GCP using Terraform
The Terraform package includes a main.tf
file you create according to your deployment needs.
Applying the created main.tf
file performs the following:
Creates VPC networks and subnets on the GCP project.
Deploys GCP instances.
Installs the WEKA software.
Configures the WEKA cluster.
Additional GCP objects.
Prerequisites
Before installing the WEKA software on GCP, the following prerequisites must be met:
Install the gcloud CLI: It is pre-installed if you use the Cloud Shell.
Install Terraform: It is pre-installed if you use the Cloud Shell. Ensure the Terraform version meets the minimum required version specified in the Requirements section of the GCP-WEKA deployment Terraform package.
Initialize the Terraform module using
terraform init
from the local directory. This command initializes a new or existing Terraform working directory by creating initial files, loading any remote state, downloading modules, and more.The Compute Engine and Workflows API services must be enabled to allow the following services:
The user running the Terraform module requires the following roles to run the
terraform apply
:
Create a main.tf file
Review the Terraform-GCP-WEKA example and use it as a reference for creating the
main.tf
according to your deployment specifics on GCP.Tailor the
main.tf
file to create SMB-W or NFS protocol clusters by adding the relevant code snippet. Adjust parameters like the number of gateways, instance types, domain name, and share naming:
SMB-W
NFS
Add WEKA POSIX clients (optional): If needed, add WEKA POSIX clients to support your workload by incorporating the specified variables into the
main.tf
file:
Apply the main.tf file
Once you complete the main.tf
settings, apply it: Run terraform apply
.
Additional configuration post-Terraform apply
After applying the main.tf
, the Terraform module updates the configuration as follows:
Service account creation: Format of the service account name:
<prefix>-deployment@<project name>.iam.gserviceaccount.com
Assigned roles:
Additional roles can be assigned to the created service account (if working with relevant resources):
To create a worker pool:
To create a new bucket (for Terraform state and WEKA OBS):
To use an existing bucket (for Terraform state and WEKA OBS):
Upgrade the WEKA version
Upgrading the WEKA version on the cloud is similar to the standard WEKA upgrade process. However, in a cloud configured with auto-scaling, the new instances created by the scale-up must be configured with the new WEKA version.
Before you begin
Ensure the cluster does not undergo a scale-up or scale-down process before and during the WEKA version upgrade.
Procedure
Perform the upgrade process. See Upgrade WEKA versions.
Update the
weka_version
parameter in themain.tf
file.Run
terraform apply
.
Removal or rollback of the WEKA cluster
If a rollback is required or the WEKA cluster is no longer required on GCP, first terminate the WEKA cluster and then use the terraform destroy
action.
The termination of the WEKA cluster can also be used if you need to retain the GCP resources (such as VPCs and cloud functions to save time on the next deployment) and then deploy a new WEKA cluster when you are ready.
If you need to preserve your data, first create a snapshot using snap-to-object.
To terminate the WEKA cluster, run the following command (replace the trigger_url
with the actual trigger URL and Cluster_Name
with the actual cluster name):
If you do not know the trigger URL or cluster name, run the terraform output
command to display them.
Once the WEKA cluster is terminated, you can deploy a new WEKA cluster or run the terraform destroy
action.
Last updated