Code Monkey home page Code Monkey logo

arun9theja / terraform-aws-eks-velero Goto Github PK

View Code? Open in Web Editor NEW

This project forked from dnxlabs/terraform-aws-eks-velero

0.0 0.0 0.0 14 KB

Terraform module for deploying Kubernetes Velero inside a pre-existing EKS cluster. Velero (formerly Heptio Ark) is an open source tool to safely backup and restore, perform disaster recovery, and migrate Kubernetes cluster resources and persistent volumes.

Home Page: https://modules.dnx.one

License: Apache License 2.0

HCL 100.00%

terraform-aws-eks-velero's Introduction

terraform-aws-eks-velero

Lint Status LICENSE

Terraform module for deploying Kubernetes Velero inside a pre-existing EKS cluster. Velero (formerly Heptio Ark) is an open source tool to safely backup and restore, perform disaster recovery, and migrate Kubernetes cluster resources and persistent volumes.

Usage

module "velero" {
  source = "git::https://github.com/DNXLabs/terraform-aws-eks-velero.git"

  enabled = true

  cluster_name                     = module.eks_cluster.cluster_id
  cluster_identity_oidc_issuer     = module.eks_cluster.cluster_oidc_issuer_url
  cluster_identity_oidc_issuer_arn = module.eks_cluster.oidc_provider_arn
  aws_region                       = data.aws_region.current.name
  bucket_name                      = ""
}

Step 1: Deploy and customize App on the source cluster

In this example we will be using wordpress, follow the steps below:

  • Add the Bitnami chart repository to Helm:
helm repo add bitnami https://charts.bitnami.com/bitnami
  • Modify your context to reflect the source cluster. Deploy WordPress on the source cluster and make it available at a public load balancer IP address. Replace the PASSWORD placeholder with a password for your WordPress dashboard.
helm install wordpress bitnami/wordpress --set service.type=LoadBalancer --set wordpressPassword=PASSWORD
  • Wait for the deployment to complete and then use the command below to obtain the load balancer IP address:
kubectl get svc --namespace default wordpress --template "{{ range (index .status.loadBalancer.ingress 0) }}{{.}}

Step 2: Backup the deployment on the source cluster

Once Velero is running, create a backup of the WordPress deployment:

velero backup create wpb --selector release=wordpress

Execute the command below to view the contents of the backup and confirm that it contains all the required resources:

velero backup describe wpb  --details

At this point, your backup is ready. You can repeat this step every time you wish to have a manual backup, or you can configure a schedule for automatic backups.

Step 3: Restore the deployment on the destination cluster

Once your backup is complete and confirmed, you can now turn your attention to restoring it. Note that this may take a few minutes to complete.

velero restore create --from-backup wpb

Wait until the backed-up resources are fully deployed and active. Use the kubectl get pods and kubectl get svc commands to track the status of the pods and service endpoint. Once the deployment has been restored, browse to the load balancer IP address and confirm that you see the same post content as that on the source cluster.

Requirements

Name Version
terraform >= 0.13
aws >= 3.13, < 4.0
helm >= 1.0, < 1.4.0
kubernetes >= 1.10.0

Providers

Name Version
aws >= 3.13, < 4.0
helm >= 1.0, < 1.4.0
kubernetes >= 1.10.0

Inputs

Name Description Type Default Required
aws_region AWS region where secrets are stored. string n/a yes
bucket_name Bucket name to store the backups. string n/a yes
cluster_identity_oidc_issuer The OIDC Identity issuer for the cluster. string n/a yes
cluster_identity_oidc_issuer_arn The OIDC Identity issuer ARN for the cluster that can be used to associate IAM roles with a service account. string n/a yes
cluster_name The name of the cluster string n/a yes
create_bucket Create bucket to store or get the backups. bool true no
create_namespace Whether to create Kubernetes namespace with name defined by namespace. bool true no
enabled Variable indicating whether deployment is enabled. bool true no
helm_chart_name Velero Helm chart name to be installed string "velero" no
helm_chart_release_name Helm release name string "velero" no
helm_chart_repo Velero repository name. string "https://vmware-tanzu.github.io/helm-charts" no
helm_chart_version Velero Helm chart version. string "2.14.5" no
mod_dependency Dependence variable binds all AWS resources allocated by this module, dependent modules reference this variable. any null no
namespace Kubernetes namespace to deploy Velero Helm chart. string "velero" no
service_account_name Velero service account name string "velero" no
settings Additional settings which will be passed to the Helm chart values. map(any) {} no
volume_snapshot_name Variable indicating the snapshot name. string "velero-snapshot" no

Outputs

No output.

Authors

Module managed by DNX Solutions.

License

Apache 2 Licensed. See LICENSE for full details.

terraform-aws-eks-velero's People

Contributors

arthurbdiniz avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.