Skip to content

Commit 4107e1f

Browse files
committed
Updated it to allow an EBS volume to be created along with a FSxN one.
1 parent 70f188b commit 4107e1f

File tree

11 files changed

+33
-24
lines changed

11 files changed

+33
-24
lines changed

EKS/FSxN-as-PVC-for-EKS/README.md

Lines changed: 7 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
* [Installation Overview](#Installation-Overview)
66
* [Detailed Instructions](#Detailed-instructions)
77
* [Clone the "NetApp/FSx-ONTAP-samples-scripts" repo from GitHub](#Clone-the-NetAppFSx-ONTAP-samples-scripts-repo-from-GitHub)
8-
* [Make any desired changes to the variables.tf file](#Make-any-desired-changes-to-the-variablestf-file)
8+
* [Make any desired changes to the configuration variables](#Make-any-desired-changes-to-the-configuration-variables)
99
* [Initialize the Terraform environment](#Initialize-the-Terraform-environment)
1010
* [Deploy the resources](#Deploy-the-resources)
1111
* [SSH to the jump server to complete the setup](#SSH-to-the-jump-server-to-complete-the-setup)
@@ -78,21 +78,19 @@ terraform files are located:
7878
git clone https://github.com/NetApp/FSx-ONTAP-samples-scripts.git
7979
cd FSx-ONTAP-samples-scripts/EKS/FSxN-as-PVC-for-EKS/terraform
8080
```
81-
### Make any desired changes to the variables.tf file.
82-
Variables that can be changed include:
81+
### Make any desired changes to the configuration variables
82+
To configure the deployment first copy the `terraform.tfvars.template` file to `terraform.tfvars`. Then, modify it to suit your needs. Here are the variables you can set:
8383
- aws_region - The AWS region where you want to deploy the resources.
8484
- aws_secrets_region - The region where the fsx password secret will be created.
8585
- fsx_name - The name you want applied to the FSx for NetApp ONTAP File System. Must not already exist.
86-
- secret_name_prefix - The base name of the AWS SecretsManager secrets that will be created that will hold the FSxN adminstrator, and SVM, passwords.
86+
- secret_name_prefix - The base name of the AWS SecretsManager secrets that will be created that will hold the FSxN administrator, and SVM, passwords.
8787
A random string will be appended to this name to ensure uniqueness.
88-
- fsx_storage_capacity - The storage capacity of the FSx for NetApp ONTAP File System.
89-
Read the "description" of the variable to see the valid range.
90-
- fsx_throughput_capacity - The throughput capacity of the FSx for NetApp ONTAP File System.
91-
Read the "description" of the variable to see valid values.
88+
- fsx_storage_capacity - The storage capacity of the FSx for NetApp ONTAP File System. Read the "description" of the variable in the `variables.tf` file to see the valid range.
89+
- fsx_throughput_capacity - The throughput capacity of the FSx for NetApp ONTAP File System. Read the "description" of the variable in the `varaibles.tf` file to see valid values.
9290
- key_pair_name - The name of the EC2 key pair to use to access the jump server.
9391
- secure_ips - The IP address ranges to allow SSH access to the jump server. The default is wide open.
9492

95-
:warning: **NOTE:** You must change the key_pair_name variable, otherwise the deployment will not complete succesfully.
93+
:warning: **NOTE:** You must change the key_pair_name variable, otherwise the deployment will not complete successfully.
9694
### Initialize the Terraform environment
9795
Run the following command to initialize the terraform environment.
9896
```bash

EKS/FSxN-as-PVC-for-EKS/terraform/ec2.tf

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,8 @@ resource "aws_instance" "eks_jump_server" {
2626
user_data = <<EOF
2727
#!/bin/bash
2828
#
29+
ARCH=amd64
30+
#
2931
# Get the system up to date:
3032
apt update
3133
apt upgrade -y
@@ -41,12 +43,18 @@ unzip -q awscliv2.zip
4143
rm -rf awscliv2.zip aws
4244
#
4345
# Install kubectl:
44-
curl -sLO "https://dl.k8s.io/release/$(curl -L -s https://dl.k8s.io/release/stable.txt)/bin/linux/amd64/kubectl"
46+
curl -sLO "https://dl.k8s.io/release/$(curl -L -s https://dl.k8s.io/release/stable.txt)/bin/linux/$ARCH/kubectl"
4547
install -o root -g root -m 0755 kubectl /usr/local/bin/kubectl
4648
#
4749
# Install helm:
4850
snap install helm --classic
4951
#
52+
# Install eksctl:
53+
PLATFORM=$(uname -s)_$ARCH
54+
curl -sLO "https://github.com/eksctl-io/eksctl/releases/latest/download/eksctl_$PLATFORM.tar.gz"
55+
tar -xzf eksctl_$PLATFORM.tar.gz -C /tmp && rm eksctl_$PLATFORM.tar.gz
56+
sudo mv /tmp/eksctl /usr/local/bin
57+
#
5058
# Install the eks samples repo into the ubuntu home directory:
5159
cd /home/ubuntu
5260
git clone https://github.com/NetApp/FSx-ONTAP-samples-scripts.git

EKS/FSxN-as-PVC-for-EKS/terraform/eks-cluster.tf

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,12 @@ resource "random_id" "id" {
4343
# Get access to the aws provider identity data to get account ID.
4444
data "aws_caller_identity" "current" {}
4545
#
46+
# Add pod-identity add-on to the EKS cluster.
47+
resource "aws_eks_addon" "pod_identity_agent" {
48+
cluster_name = module.eks.cluster_name
49+
addon_name = "eks-pod-identity-agent"
50+
}
51+
#
4652
# Add Trident to the EKS cluster with a role that will allow it to read secrets
4753
# add manage the fsxn file system.
4854
resource "aws_eks_addon" "fsxn_csi_addon" {

EKS/FSxN-as-PVC-for-EKS/terraform/scripts/iscsi.sh

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,5 +4,8 @@ rpm -q iscsi-initiator-utils
44
sudo sed -i 's/^\(node.session.scan\).*/\1 = manual/' /etc/iscsi/iscsid.conf
55
cat /etc/iscsi/initiatorname.iscsi
66
sudo mpathconf --enable --with_multipathd y --find_multipaths n
7+
#
8+
# Blacklist any EBS volume since they don't support them!
9+
sed -i -e '/^blacklist {/,/^}/{/^}/i\ device {\n vendor "NVME"\n product "Amazon Elastic Block Store"\n }\n' -e '}' /etc/multipath.conf
710
sudo systemctl enable --now iscsid multipathd
811
sudo systemctl enable --now iscsi

EKS/FSxN-as-PVC-for-EKS/terraform/variables.tf

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,11 @@
11
variable "aws_region" {
22
description = "The AWS region where you want the resources deployed."
33
type = string
4-
default = "us-west-2"
54
}
65

76
variable "aws_secrets_region" {
87
description = "The AWS region where you want the FSxN and SVM secrets stored within AWS Secrets Manager."
98
type = string
10-
default = "us-west-2"
119
}
1210

1311
variable "fsx_name" {
@@ -62,13 +60,13 @@ variable "secure_ips" {
6260

6361
variable "trident_version" {
6462
description = "The version of Astra Trident to 'add-on' to the EKS cluster."
65-
default = "v24.2.0-eksbuild.1"
63+
default = "v24.10.0-eksbuild.1"
6664
type = string
6765
}
6866

6967
variable "kubernetes_version" {
7068
description = "kubernetes version"
71-
default = 1.29
69+
default = 1.31
7270
type = string
7371
}
7472

EKS/Trident-Protect/README.md renamed to EKS/Migrate-Backup-EKS-Applications/README.md

Lines changed: 6 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# Trident Protect Migrate PVC Storage Class
1+
# Migrate and Backup EKS Applications with Trident Protect
22

33
This is a sample for setting up your Kubernetes application to be backed up by Trident Protect with an option to migrate it from one storage class to another.
44

@@ -178,14 +178,6 @@ Now run the following command to create the Trident Vault:
178178
kubectl apply -f trident-vault.yaml
179179
```
180180

181-
SECURITY NOTE:
182-
183-
If you want to avoid storing AWS credentials explicitly in Kubernetes secrets, a more secure approach would be to use IAM roles for service accounts (IRSA):
184-
- Create an IAM policy with minimal S3 access permissions for the specific bucket.
185-
- Create an IAM role and attach the policy to it.
186-
- Configure your EKS cluster to use IAM roles for service accounts (IRSA).
187-
- Create a Kubernetes service account in the trident-protect namespace and associate it with the IAM role
188-
189181
### Create a Trident Application
190182
You create a Trident application with the specification of your application in order to back it up. You do that by creating a file named `trident-application.yaml` with the following contents:
191183

@@ -342,5 +334,9 @@ kubectl get backuprestore -n <DESTINATION NAMESPACE> <APP RESTORE NAME> -o jsonp
342334

343335
## Final Notes
344336
This is a simple example of how to use Trident Protect to backup and restore your application.
345-
There are a lot of other features and options available with Trident Protect that are not covered here.
337+
There are a lot of other features and options available with Trident Protect that are not covered here for example:
338+
- Creating snapshots of your application.
339+
- Scheduling backups.
340+
- Replicating backups to another FSxN file system with SnapMirror.
341+
346342
For more information please refer to the official [Trident Protect documentation](https://docs.netapp.com/us-en/trident/trident-protect/trident-protect-installation.html).
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.

0 commit comments

Comments
 (0)