• Stars
    star
    208
  • Rank 189,015 (Top 4 %)
  • Language
    Go
  • License
    Apache License 2.0
  • Created about 5 years ago
  • Updated 3 months ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

Plugins to support Velero on AWS

Build Status

Velero plugins for AWS

Overview

This repository contains these plugins to support running Velero on AWS:

  • An object store plugin for persisting and retrieving backups on AWS S3. Content of backup is kubernetes resources and metadata files for CSI objects, progress of async operations.
    It is also used to store the result data of backups and restores include log files, warning/error files, etc.

  • A volume snapshotter plugin for creating snapshots from volumes (during a backup) and volumes from snapshots (during a restore) on AWS EBS.

    • Since v1.4.0 the snapshotter plugin can handle the volumes provisioned by CSI driver ebs.csi.aws.com

Compatibility

Below is a listing of plugin versions and respective Velero versions that are compatible.

Plugin Version Velero Version
v1.7.x v1.11.x
v1.6.x v1.10.x
v1.5.x v1.9.x
v1.4.x v1.8.x
v1.3.x v1.7.x

Filing issues

If you would like to file a GitHub issue for the plugin, please open the issue on the core Velero repo

Setup

To set up Velero on AWS, you:

You can also use this plugin to migrate PVs across clusters or create an additional Backup Storage Location.

If you do not have the aws CLI locally installed, follow the user guide to set it up.

Create S3 bucket

Velero requires an object storage bucket to store backups in, preferably unique to a single Kubernetes cluster (see the FAQ for more details). Create an S3 bucket, replacing placeholders appropriately:

BUCKET=<YOUR_BUCKET>
REGION=<YOUR_REGION>
aws s3api create-bucket \
    --bucket $BUCKET \
    --region $REGION \
    --create-bucket-configuration LocationConstraint=$REGION

NOTE: us-east-1 does not support a LocationConstraint. If your region is us-east-1, omit the bucket configuration:

aws s3api create-bucket \
    --bucket $BUCKET \
    --region us-east-1

Set permissions for Velero

Option 1: Set permissions with an IAM user

For more information, see the AWS documentation on IAM users.

  1. Create the IAM user:

    aws iam create-user --user-name velero

    If you'll be using Velero to backup multiple clusters with multiple S3 buckets, it may be desirable to create a unique username per cluster rather than the default velero.

  2. Attach policies to give velero the necessary permissions:

    cat > velero-policy.json <<EOF
    {
        "Version": "2012-10-17",
        "Statement": [
            {
                "Effect": "Allow",
                "Action": [
                    "ec2:DescribeVolumes",
                    "ec2:DescribeSnapshots",
                    "ec2:CreateTags",
                    "ec2:CreateVolume",
                    "ec2:CreateSnapshot",
                    "ec2:DeleteSnapshot"
                ],
                "Resource": "*"
            },
            {
                "Effect": "Allow",
                "Action": [
                    "s3:GetObject",
                    "s3:DeleteObject",
                    "s3:PutObject",
                    "s3:AbortMultipartUpload",
                    "s3:ListMultipartUploadParts"
                ],
                "Resource": [
                    "arn:aws:s3:::${BUCKET}/*"
                ]
            },
            {
                "Effect": "Allow",
                "Action": [
                    "s3:ListBucket"
                ],
                "Resource": [
                    "arn:aws:s3:::${BUCKET}"
                ]
            }
        ]
    }
    EOF
    
    aws iam put-user-policy \
      --user-name velero \
      --policy-name velero \
      --policy-document file://velero-policy.json
  3. Create an access key for the user:

    aws iam create-access-key --user-name velero

    The result should look like:

    {
      "AccessKey": {
            "UserName": "velero",
            "Status": "Active",
            "CreateDate": "2017-07-31T22:24:41.576Z",
            "SecretAccessKey": <AWS_SECRET_ACCESS_KEY>,
            "AccessKeyId": <AWS_ACCESS_KEY_ID>
      }
    }
  4. Create a Velero-specific credentials file (credentials-velero) in your local directory:

    [default]
    aws_access_key_id=<AWS_ACCESS_KEY_ID>
    aws_secret_access_key=<AWS_SECRET_ACCESS_KEY>

    where the access key id and secret are the values returned from the create-access-key request.

Option 2: Set permissions using kube2iam

Kube2iam is a Kubernetes application that allows managing AWS IAM permissions for pod via annotations rather than operating on API keys.

This path assumes you have kube2iam already running in your Kubernetes cluster. If that is not the case, please install it first, following the docs here: https://github.com/jtblin/kube2iam

It can be set up for Velero by creating a role that will have required permissions, and later by adding the permissions annotation on the velero deployment to define which role it should use internally.

  1. Create a Trust Policy document to allow the role being used for EC2 management & assume kube2iam role:

    cat > velero-trust-policy.json <<EOF
    {
        "Version": "2012-10-17",
        "Statement": [
            {
                "Effect": "Allow",
                "Principal": {
                    "Service": "ec2.amazonaws.com"
                },
                "Action": "sts:AssumeRole"
            },
            {
                "Effect": "Allow",
                "Principal": {
                    "AWS": "arn:aws:iam::<AWS_ACCOUNT_ID>:role/<ROLE_CREATED_WHEN_INITIALIZING_KUBE2IAM>"
                },
                "Action": "sts:AssumeRole"
            }
        ]
    }
    EOF
    
  2. Create the IAM role:

    aws iam create-role --role-name velero --assume-role-policy-document file://./velero-trust-policy.json
  3. Attach policies to give velero the necessary permissions:

    BUCKET=<YOUR_BUCKET>
    cat > velero-policy.json <<EOF
    {
        "Version": "2012-10-17",
        "Statement": [
            {
                "Effect": "Allow",
                "Action": [
                    "ec2:DescribeVolumes",
                    "ec2:DescribeSnapshots",
                    "ec2:CreateTags",
                    "ec2:CreateVolume",
                    "ec2:CreateSnapshot",
                    "ec2:DeleteSnapshot"
                ],
                "Resource": "*"
            },
            {
                "Effect": "Allow",
                "Action": [
                    "s3:GetObject",
                    "s3:DeleteObject",
                    "s3:PutObject",
                    "s3:AbortMultipartUpload",
                    "s3:ListMultipartUploadParts"
                ],
                "Resource": [
                    "arn:aws:s3:::${BUCKET}/*"
                ]
            },
            {
                "Effect": "Allow",
                "Action": [
                    "s3:ListBucket"
                ],
                "Resource": [
                    "arn:aws:s3:::${BUCKET}"
                ]
            }
        ]
    }
    EOF
    
    aws iam put-role-policy \
      --role-name velero \
      --policy-name velero-policy \
      --policy-document file://./velero-policy.json

Install and start Velero

Download Velero

Install Velero, including all prerequisites, into the cluster and start the deployment. This will create a namespace called velero, and place a deployment named velero in it.

If using IAM user and access key:

velero install \
    --provider aws \
    --plugins velero/velero-plugin-for-aws:v1.6.0 \
    --bucket $BUCKET \
    --backup-location-config region=$REGION \
    --snapshot-location-config region=$REGION \
    --secret-file ./credentials-velero

If using kube2iam:

velero install \
    --provider aws \
    --plugins velero/velero-plugin-for-aws:v1.6.0 \
    --bucket $BUCKET \
    --backup-location-config region=$REGION \
    --snapshot-location-config region=$REGION \
    --pod-annotations iam.amazonaws.com/role=arn:aws:iam::<AWS_ACCOUNT_ID>:role/<VELERO_ROLE_NAME> \
    --no-secret

Additionally, you can specify --use-node-agent to enable node agent support, and --wait to wait for the deployment to be ready.

Note: If you are using EKS, there is a known permissions issue when using Velero with Kubernetes versions 1.18 and earlier that will prevent the Velero from being able to read S3 storage locations. To fix this, update the Velero deployment yaml file to include following securityContext value:

securityContext:
        fsGroup: 65534

(Optional) Specify additional configurable parameters for the --backup-location-config flag.

(Optional) Specify additional configurable parameters for the --snapshot-location-config flag.

(Optional) Customize the Velero installation further to meet your needs.

For more complex installation needs, use either the Helm chart, or add --dry-run -o yaml options for generating the YAML representation for the installation.

Create an additional Backup Storage Location

If you are using Velero v1.6.0 or later, you can create additional AWS Backup Storage Locations that use their own credentials. These can also be created alongside Backup Storage Locations that use other providers.

Limitations

It is not possible to use different credentials for additional Backup Storage Locations if you are pod based authentication such as kube2iam.

Prerequisites

  • Velero 1.6.0 or later
  • AWS plugin must be installed, either at install time, or by running velero plugin add velero/velero-plugin-for-aws:plugin-version, replace the plugin-version with the corresponding value

Configure S3 bucket and credentials

To configure a new Backup Storage Location with its own credentials, it is necessary to follow the steps above to create the bucket to use and to generate the credentials file to interact with that bucket. Once you have created the credentials file, create a Kubernetes Secret in the Velero namespace that contains these credentials:

kubectl create secret generic -n velero bsl-credentials --from-file=aws=</path/to/credentialsfile>

This will create a secret named bsl-credentials with a single key (aws) which contains the contents of your credentials file. The name and key of this secret will be given to Velero when creating the Backup Storage Location, so it knows which secret data to use.

Create Backup Storage Location

Once the bucket and credentials have been configured, these can be used to create the new Backup Storage Location:

velero backup-location create <bsl-name> \
  --provider aws \
  --bucket $BUCKET \
  --config region=$REGION \
  --credential=bsl-credentials=aws

The Backup Storage Location is ready to use when it has the phase Available. You can check this with the following command:

velero backup-location get

To use this new Backup Storage Location when performing a backup, use the flag --storage-location <bsl-name> when running velero backup create.

Migrating PVs across clusters

Setting AWS_CLUSTER_NAME (Optional)

If you have multiple clusters and you want to support migration of resources between them, you can use kubectl edit deploy/velero -n velero to edit your deployment:

Add the environment variable AWS_CLUSTER_NAME under spec.template.spec.env, with the current cluster's name. When restoring backup, it will make Velero (and cluster it's running on) claim ownership of AWS volumes created from snapshots taken on different cluster. The best way to get the current cluster's name is to either check it with used deployment tool or to read it directly from the EC2 instances tags.

The following listing shows how to get the cluster's nodes EC2 Tags. First, get the nodes external IDs (EC2 IDs):

kubectl get nodes -o jsonpath='{.items[*].spec.externalID}'

Copy one of the returned IDs <ID> and use it with the aws CLI tool to search for one of the following:

  • The kubernetes.io/cluster/<AWS_CLUSTER_NAME> tag of the value owned. The <AWS_CLUSTER_NAME> is then your cluster's name:

    aws ec2 describe-tags --filters "Name=resource-id,Values=<ID>" "Name=value,Values=owned"
  • If the first output returns nothing, then check for the legacy Tag KubernetesCluster of the value <AWS_CLUSTER_NAME>:

    aws ec2 describe-tags --filters "Name=resource-id,Values=<ID>" "Name=key,Values=KubernetesCluster"

More Repositories

1

velero

Backup and migrate Kubernetes applications and their persistent volumes
Go
8,593
star
2

kubeapps

A web-based UI for deploying and managing applications in Kubernetes clusters
Go
4,954
star
3

sonobuoy

Sonobuoy is a diagnostic tool that makes it easier to understand the state of a Kubernetes cluster by running a set of Kubernetes conformance tests and other plugins in an accessible and non-destructive manner.
Go
2,822
star
4

community-edition

VMware Tanzu Community Edition is no longer an actively maintained project. Code is available for historical purposes only.
Go
1,333
star
5

carvel-ytt

YAML templating tool that works on YAML structure instead of text
Go
1,286
star
6

carvel-kapp

kapp is a simple deployment tool focused on the concept of "Kubernetes application" — a set of resources with the same label
Go
707
star
7

pinniped

Pinniped is the easy, secure way to log in to your Kubernetes clusters.
Go
493
star
8

cartographer

Cartographer is a Supply Chain Choreographer.
Go
436
star
9

k-bench

Workload Benchmark for Kubernetes
Go
372
star
10

helm-charts

Contains Helm charts for Kubernetes related open source tools
Mustache
248
star
11

carvel

Carvel provides a set of reliable, single-purpose, composable tools that aid in your application building, configuration, and deployment to Kubernetes. This repo contains information regarding the Carvel open-source community.
HTML
243
star
12

tanzu-framework

Tanzu Framework provides a set of building blocks to build atop of the Tanzu platform and leverages Carvel packaging and plugins to provide users with a much stronger, more integrated experience than the loose coupling and stand-alone commands of the previous generation of tools.
Go
198
star
13

cluster-api-provider-bringyourownhost

Kubernetes Cluster API Provider BYOH for already-provisioned hosts running Linux.
Go
196
star
14

carvel-kbld

kbld seamlessly incorporates image building and image pushing into your development and deployment workflows
Go
182
star
15

crash-diagnostics

Crash-Diagnostics (Crashd) is a tool to help investigate, analyze, and troubleshoot unresponsive or crashed Kubernetes clusters.
Go
176
star
16

carvel-vendir

Easy way to vendor portions of git repos, github releases, helm charts, docker image contents, etc. declaratively
Go
168
star
17

carvel-kapp-controller

Continuous delivery and package management for Kubernetes.
Go
153
star
18

carvel-kwt

Kubernetes Workstation Tools CLI
Go
145
star
19

carvel-imgpkg

Store application configuration files in Docker/OCI registries
Go
134
star
20

tanzu-dev-portal

Content for Tanzu dev portal
HTML
132
star
21

velero-plugin-for-csi

Velero plugins for integrating with CSI snapshot API
Go
111
star
22

cloud-native-security-inspector

This project scans and assesses workloads in Kubernetes at runtime. It can apply protection rules to workloads to avoid further risks as well.
Go
104
star
23

velero-plugin-for-microsoft-azure

Plugins to support Velero on Microsoft Azure
Go
99
star
24

vm-operator

Self-service manage your virtual infrastructure...
Go
86
star
25

cloud-suitability-analyzer

Automated, rule based source code scanning to determine cloud suitability
Go
77
star
26

secrets-manager

VMware Secrets Manager for Cloud-Native Apps is a lightweight secrets manager to protect your sensitive data. It’s perfect for edge deployments where energy and footprint requirements are strict—See more: https://vsecm.com/
Go
77
star
27

velero-plugin-for-gcp

Plugins to support Velero on Google Cloud Platform (GCP)
Go
75
star
28

sonobuoy-plugins

Plugins for Sonobuoy
Go
60
star
29

carvel-secretgen-controller

secretgen-controller provides CRDs to specify what secrets need to be on Kubernetes cluster (to be generated or not)
Go
57
star
30

velero-plugin-for-vsphere

Plugin to support Velero on vSphere
Go
57
star
31

service-installer-for-vmware-tanzu

Service Installer for VMware Tanzu is a one-click automation solution that enables VMware field engineers to easily and rapidly install, configure, and operate VMware Tanzu services across a variety of cloud infrastructures.
Python
55
star
32

velero-plugin-example

Example project for plugins for Velero, a Kubernetes disaster recovery utility
Go
50
star
33

application-accelerator-samples

Project for samples to be used with "Application Accelerator for VMware Tanzu" which is part of "VMware Tanzu Platform".
Java
45
star
34

terraform-provider-carvel

Carvel Terraform provider with resources for ytt and kapp to template and deploy to Kubernetes
Go
43
star
35

asset-relocation-tool-for-kubernetes

A tool for relocating Kubernetes Assets
Go
38
star
36

astrolabe

Data protection framework for complex applications
Go
37
star
37

carvel-community

Carvel provides a set of reliable, single-purpose, composable tools that aid in your application building, configuration, and deployment to Kubernetes. This repo contains information regarding the Carvel open-source community.
Shell
35
star
38

servicebinding

Service Bindings for Kubernetes
Go
32
star
39

cert-injection-webhook

Provides a Kubernetes webhook to inject CA certificates and proxy environment variables into pods.
Go
31
star
40

carvel-simple-app-on-kubernetes

K8s simple Go app example deployed with k14s tools
Shell
29
star
41

vsphere-kubernetes-drivers-operator

vSphere Kubernetes Driver Operator to simplify and automate the lifecycle management of CSI and CPI for Kubernetes cluster running on vSphere
Go
28
star
42

application-portfolio-auditor

Application Portfolio Auditor is a tool assessing cloud readiness, quality, and security of large sets of apps. It gathers and aggregates insights of multiple software analyzers.
Shell
28
star
43

graph-framework-for-microservices

Graph Framework for Microservices is a platform software stack that bootstraps and accelerates cloud-native microservice development, that is out-of-the-box ready to thrive in the ever challenging world of distributed systems and SaaS.
Go
28
star
44

load-balancer-operator-for-kubernetes

A Cluster API speaking operator for load balancers
Go
27
star
45

tanzu-cli

The Tanzu Core CLI project provides the core functionality of the Tanzu CLI. The CLI is based on a plugin architecture where CLI command functionality can be delivered through independently developed plugin binaries
Go
27
star
46

sources-for-knative

VMware-related event sources for Knative.
Go
26
star
47

kpack-cli

A command line interface for interacting with kpack.
Go
26
star
48

cross-cluster-connectivity

Multi-cluster DNS for Cluster API
Go
26
star
49

thepodlets

A VMware cloud native podcast. Exploring cloud native, one buzzword at a time!
HTML
25
star
50

carvel-ytt-library-for-kubernetes

ytt (https://github.com/k14s/ytt) library that includes reusable K8s components (app, ...)
Shell
21
star
51

function-buildpacks-for-knative

Buildpacks for Knative Functions
Go
21
star
52

vsphere-tanzu-kubernetes-grid-image-builder

For building virtual machine images with VMware vSphere
Python
18
star
53

carvel-setup-action

Github Action for setting up Carvel apps (ytt, kbld, kapp, kctrl, kwt, imgpkg and vendir)
TypeScript
17
star
54

apps-cli-plugin

Apps Plugin for the Tanzu CLI
Go
16
star
55

cartographer-conventions

Conventions provide a mechanism for platform operators to define cross cutting behavior that is applied to Kubernetes resources by understanding the developers intent and the semantics of the resources being advised.
Go
15
star
56

community-engagement

Go
14
star
57

projects-operator

Provides a `Project` CRD and controller for k8s to help with organising resources
Go
13
star
58

vscode-ytt

Visual Studio Code extension for working with ytt yaml files
12
star
59

carvel-ytt-library-for-kubernetes-demo

Demo of ytt + kapp + k8s-lib to deploy a simple app with basic autoscaling
Go
10
star
60

tanzu-toolkit-for-visual-studio

C#
9
star
61

nsx-operator

Kubernetes Operator for managing NSX network resources
Go
9
star
62

dependency-labeler

Dependency Labeler adds metadata about a container image's dependencies as a label to the container image. Formerly maintained by the NavCon team, currently maintained by the Source Insight Tooling team
Go
9
star
63

tanzu-application-platform-reference-service-packages

Reference Service Instance Packages for Tanzu Application Platform.
Shell
9
star
64

homebrew-carvel

Provides tools from https://carvel.dev via Homebrew package.
Ruby
8
star
65

carvel-ytt-starter-for-kubernetes

Use this repo as an example for organizing ytt templates within your application repo
HTML
8
star
66

tanzu-plugin-runtime

The Tanzu Plugin Runtime provides functionality and helper methods to develop Tanzu CLI plugins
Go
8
star
67

carvel-docker-image

Source for ghcr.io/vmware-tanzu/carvel-docker-image:latest that includes various Carvel tools
Dockerfile
8
star
68

homebrew-tanzu

Homebrew tap and formulas for installing Tanzu Community Edition
Ruby
7
star
69

build-tooling-for-integrations

This project enables developers to start building and packaging new Tanzu integrations, including cluster packages and custom CLI commands.
Go
7
star
70

app-migrator-for-cloud-foundry

A CLI tool for exporting and importing Cloud Foundry applications between Cloud Foundry installations.
Go
7
star
71

package-for-cartographer

carvel-based Packaging for Cartographer
Shell
6
star
72

tanzu-source-controller

Tanzu Source Controller enables app devs to fetch OCI images and maven artifacts from remote source code repository. The controller follows the spirit of the FluxCD Source Controller.
Go
6
star
73

image-registry-operator-api

As part of the vSphere on Tanzu project, this VM Image Service offers a Kubernetes API to upload/download/share VM images backed by vSphere Content Library.
Go
5
star
74

observability-event-resource

Go
5
star
75

service-instance-migrator-for-cloud-foundry

A CLI tool for exporting and importing Cloud Foundry service instances between Cloud Foundry installations.
Go
5
star
76

ytt.vim

syntax for ytt
Vim Script
5
star
77

package-for-kpack

This repo will house the carvel tooling specific configuration and templating for a deployment of kpack (https://github.com/pivotal/kpack) that will be leveraged by TCE and TBS
Shell
5
star
78

package-for-kubeapps

This repo will house the carvel tooling specific configuration and templating for a deployment of Kubeapps (https://github.com/vmware-tanzu/kubeapps) that will be leveraged by TCE
Mustache
5
star
79

tanzu-plug-in-for-asdf

This ASDF plugin enables the download of Tanzu related tools from Github.
Shell
4
star
80

concourse-kpack-resource

Use a kpack image in a concourse pipeline naturally.
Go
4
star
81

net-operator-api

A client API for the Net Operator project, designed to allow for integration with vSphere 7 with Kubernetes
Go
4
star
82

carvel-guestbook-example-on-kubernetes

K8s guestbook example deployed with k14s tools
JavaScript
4
star
83

oss-httpd-build

This project is a schema to build Apache HTTP Server (httpd), along with a number of frequently updated library components (dependencies), on Linux or Windows. The results of this build are also distributed periodically to the general public from the https://network.tanzu.vmware.com/products/p-apache-http-server (login required)
PowerShell
4
star
84

carvel-release-scripts

contains scripts for releasing carvel tools
Shell
3
star
85

rotate-instance-identity-certificates

Tooling to rotate the Diego Instance Identity Certificates on Tanzu Application Service 2.4-2.6.
Go
3
star
86

build-image-action

A GitHub Action that can be used to call into a Tanzu Application Platform (TAP) installation and use Tanzu Build Service (TBS) to build an image from source.
Go
3
star
87

cartographer-catalog

Reusable Cartographer blueprints
Shell
2
star
88

homebrew-pinniped

Homebrew tap for Pinniped
Ruby
2
star
89

homebrew-kpack-cli

Homebrew Tap for kpack-cli (https://github.com/vmware-tanzu/kpack-cli)
Ruby
2
star
90

azure-log-analytics-nozzle-release

Go
2
star
91

vmotion-migration-tool-for-bosh-deployments

Tooling and instructions to seamlessly move a BOSH deployed Cloud Foundry installation to new vSphere hardware via vMotion. This tool allows you to live migrate without needing to take on an expensive and disruptive migration to a new platform just to support a hardware refresh.
Go
2
star
92

cartographer-site

Cartographer website
JavaScript
1
star
93

tanzu-observability-slug-generator

Java
1
star
94

asdf-carvel

k14s asdf plugin
Shell
1
star
95

package-for-source-controller

This repo will house the carvel tooling specific configuration and templating for a deployment of fluxcd-source-controller (https://github.com/fluxcd/source-controller) that will be leveraged by TCE
Shell
1
star
96

service-apis

Fork of kubernetes-sigs/service-apis
1
star