Skip to content

Commit

Permalink
Updated Documentation
Browse files Browse the repository at this point in the history
  • Loading branch information
EC2 Default User committed Dec 22, 2023
1 parent f13e653 commit ca0476e
Show file tree
Hide file tree
Showing 2 changed files with 88 additions and 151 deletions.
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Using AWS Native services to setup a Backup/Restore Disaster Recovery pattern for EKS
# Using AWS Native services to setup a Backup/Restore Disaster Recovery pattern for EKS

## Objective

Expand All @@ -15,7 +15,7 @@ And a non-critical application will have a higher RTO and RPO and will not need

The Objective of this pattern is to provide a reference design for a Disaster Recovery Architecture for a non-critical application with higher RTO and RPO using AWS native services.

This page has details of setting up the EKS cluster on the Disaster Recovery region with configuration to create PersistentVolumeClaim's from latest snapshot's of EBS Volumes
This page has details of setting up the EKS cluster on the primary region with configuration to backup Dataplane Nodes, EBS Volumes and EFS Filesystems.

## Architecture

Expand Down Expand Up @@ -60,6 +60,80 @@ Ensure that you have installed the following tools on your machine:
- [make](https://www.gnu.org/software/make/)
- [Docker](https://docs.docker.com/get-docker/)

Let’s start by setting the account and region environment variables:

```sh
ACCOUNT_ID=$(aws sts get-caller-identity --query 'Account' --output text)
AWS_REGION=$(aws configure get region)
```

Clone the repository:

```sh
git clone https://github.com/aws-samples/cdk-eks-blueprints-patterns.git

```

## Deployment

If you haven't done it before, [bootstrap your cdk account and region](https://docs.aws.amazon.com/cdk/v2/guide/bootstrapping.html).

Set the pattern's parameters in the CDK context by overriding the _cdk.json_ file (Update the values for variables based on your environment):

```sh
cat << EOF > cdk.json
{
"app": "npx ts-node dist/lib/common/default-main.js",
"context": {
"resilience-backup-restore-aws.pattern.name": "resilience_backup_restore_aws",
"resilience-backup-restore-aws.primary.region": "us-west-1",
"resilience-backup-restore-aws.dr.region": "us-east-2",
"resilience-backup-restore-aws.efs.fsname": "efs-test",
"resilience-backup-restore-aws.backup.vaultname": "eks-vault"
}
}
EOF
```

Run the following commands:

```sh
make deps
make build
make pattern resilience-br-backup-aws "deploy --all"
```
When deployment completes, the output will be similar to the following:

```output
✅ eks-blueprint
✨ Deployment time: 1.55s
Outputs:
eks-blueprint.EfsFileSystemId = fs-0eb944ebcc8fc4218
eks-blueprint.ExportsOutputFnGetAttKMSKeyArn3349B39A = arn:aws:kms:us-west-1:XXXXXXXXXXXX:key/mrk-01f5fa48358f41048981abc60e2f7d2e
eks-blueprint.eksblueprintClusterNameF2A3938C = eks-blueprint
eks-blueprint.eksblueprintConfigCommandC5F2ABDA = aws eks update-kubeconfig --name eks-blueprint --region us-west-1 --role-arn arn:aws:iam::XXXXXXXXXXXX:role/eks-blueprint-eksblueprintAccessRoleBA6A9CB7-Fu9TnULIf5O6
eks-blueprint.eksblueprintGetTokenCommandD17B69F1 = aws eks get-token --cluster-name eks-blueprint --region us-west-1 --role-arn arn:aws:iam::XXXXXXXXXXXX:role/eks-blueprint-eksblueprintAccessRoleBA6A9CB7-Fu9TnULIf5O6
```

To see the deployed resources within the cluster, please run:

```sh
aws eks update-kubeconfig --name eks-blueprint --region us-west-1 --role-arn arn:aws:iam::XXXXXXXXXXXX:role/eks-blueprint-eksblueprintAccessRoleBA6A9CB7-Fu9TnULIf5O6 # Command Copied from the Stack output
kubectl get sc
```

A sample output is shown below:

```output
NAME PROVISIONER RECLAIMPOLICY VOLUMEBINDINGMODE ALLOWVOLUMEEXPANSION AGE
aws-ebs-sc ebs.csi.aws.com Delete Immediate false 50m
efs-sc efs.csi.aws.com Delete Immediate false 50m
gp2 (default) kubernetes.io/aws-ebs Delete WaitForFirstConsumer false 100m
```

Ensure that the Storage classes aws-ebs-sc and efs-sc are configured during bootstrap by ArgoCD.

## Disaster Recovery Procedure

Expand Down Expand Up @@ -210,7 +284,17 @@ kubectl apply -f . -R #Recursively apply all the yaml files in the directory.
## Cleanup
To clean up your EKS Blueprints, run the following commands:
To clean up your EKS Blueprints on the Primary Region, run the following commands:
```sh
make pattern resilience-br-backup-aws "destroy eks-blueprint/drstack/backupstack/backupstack";
make pattern resilience-br-backup-aws "destroy eks-blueprint/drstack/backupstack";
make pattern resilience-br-backup-aws "destroy eks-blueprint/drstack/drstack";
make pattern resilience-br-backup-aws "destroy eks-blueprint/drstack";
make pattern resilience-br-backup-aws "destroy --all"
```
To clean up your EKS Blueprints on the Disaster Recovery Region, run the following commands:
```sh
make pattern resilience-br-restore-aws "destroy eks-blueprint/drstack/backupstack/backupstack";
Expand All @@ -219,3 +303,4 @@ make pattern resilience-br-restore-aws "destroy eks-blueprint/drstack/drstack";
make pattern resilience-br-restore-aws "destroy eks-blueprint/drstack";
make pattern resilience-br-restore-aws "destroy --all"
```

This file was deleted.

0 comments on commit ca0476e

Please sign in to comment.