Go to file
Bridget McErlean 9ffffda11e
Use Credential from BSL for restic commands (#3489)
* Use Credential from BSL for restic commands

This change introduces support for restic to make use of per-BSL
credentials. It makes use of the `credentials.FileStore` introduced in
PR #3442 to write the BSL credentials to disk. To support per-BSL
credentials for restic, the environment for the restic commands needs to
be modified for each provider to ensure that the credentials are
provided via the correct provider specific environment variables.
This change introduces a new function `restic.CmdEnv` to check the BSL
provider and create the correct mapping of environment variables for
each provider.

Previously, AWS and GCP could rely on the environment variables in the
Velero deployments to obtain the credentials file, but now these
environment variables need to be set with the path to the serialized
credentials file if a credential is set on the BSL.

For Azure, the credentials file in the environment was loaded and parsed
to set the environment variables for restic. Now, we check if the BSL
has a credential, and if it does, load and parse that file instead.

This change also introduces a few other small improvements. Now that we
are fetching the BSL to check for the `Credential` field, we can use the
BSL directly to get the `CACert` which means that we can remove the
`GetCACert` function. Also, now that we have a way to serialize secrets
to disk, we can use the `credentials.FileStore` to get a temp file for
the restic repo password and remove the `restic.TempCredentialsFile`
function.

Signed-off-by: Bridget McErlean <bmcerlean@vmware.com>

* Add documentation for per-BSL credentials

Signed-off-by: Bridget McErlean <bmcerlean@vmware.com>

* Address review feedback

Signed-off-by: Bridget McErlean <bmcerlean@vmware.com>

* Address review comments

Signed-off-by: Bridget McErlean <bmcerlean@vmware.com>
2021-03-11 13:10:51 -05:00
.github Assign a smaller number of reviewers to PRs (#3543) 2021-03-08 16:28:03 -08:00
changelogs Use Credential from BSL for restic commands (#3489) 2021-03-11 13:10:51 -05:00
cmd Updates for org move to vmware-tanzu (#1920) 2019-09-30 17:26:56 -04:00
config Partially revert adding credentials to VSL (#3561) 2021-03-11 10:10:27 -08:00
design Proposal for handling multiple credential secrets (#2403) 2021-02-05 13:15:38 -05:00
examples 📖 use correct link to the minio.md (#3071) 2020-11-12 16:08:26 -08:00
hack Download restic binary using curl (#3421) 2021-02-08 10:31:20 -08:00
internal Pass configured BSL credential to plugin via config (#3442) 2021-03-04 13:43:15 -08:00
pkg Use Credential from BSL for restic commands (#3489) 2021-03-11 13:10:51 -05:00
site Use Credential from BSL for restic commands (#3489) 2021-03-11 13:10:51 -05:00
test/e2e Address review comments 2021-03-10 17:35:17 -05:00
third_party/kubernetes/pkg/kubectl/cmd remove hardcoded svc, netpol mappings 2020-01-16 19:16:45 -07:00
tilt-resources Add Tilt configuration to debug using Delve (#3189) 2021-01-22 10:12:04 +08:00
.dockerignore Refactor image builds to use buildx for multi arch image building (#2754) 2020-08-04 11:40:05 -07:00
.gitignore Add Tilt configs (#3119) 2020-12-08 13:42:03 -05:00
.goreleaser.yml Updates for org move to vmware-tanzu (#1920) 2019-09-30 17:26:56 -04:00
ADOPTERS.md Fix adopters logos (#2968) 2020-09-23 15:35:00 -07:00
CHANGELOG.md Add changelog and docs for v1.5 release (#2941) 2020-09-16 17:17:30 -04:00
CODE_OF_CONDUCT.md Update to latest covenant coc (#3076) 2020-11-19 16:07:38 -05:00
CONTRIBUTING.md Update links to point to main branch (#2915) 2020-09-09 12:11:57 -07:00
Dockerfile Bump Go to 1.15 (#2974) 2020-10-13 12:42:06 -07:00
GOVERNANCE.md Update links to point to main branch (#2915) 2020-09-09 12:11:57 -07:00
LICENSE Initial commit 2017-08-02 13:27:17 -04:00
MAINTAINERS.md (low priority) Update to Thompson (#3502) 2021-02-24 08:01:35 -05:00
Makefile Add more E2E tests and improvement (#3111) 2020-12-09 16:26:05 -08:00
PROJECT Convert manifests + BSL api client to kubebuilder (#2561) 2020-06-24 12:55:18 -04:00
README.md Add CII Best Practices badge to README (#2880) 2020-08-31 17:33:03 -04:00
ROADMAP.md Proposed 1.7.0 roadmap (#3537) 2021-03-08 17:04:30 -08:00
SECURITY.md Rename security policy file to show up accurately in the GitHub UI (#2879) 2020-08-31 12:10:09 -04:00
SUPPORT.md Update links to point to main branch (#2915) 2020-09-09 12:11:57 -07:00
Tiltfile Install CA certificates in Tilt Docker image (#3496) 2021-02-24 13:50:30 +08:00
go.mod Add E2E test for multiple credentials 2021-03-10 16:43:47 -05:00
go.sum Add E2E test for multiple credentials 2021-03-10 16:43:47 -05:00
golangci.yaml Add linter (#2615) 2020-06-30 12:51:10 -04:00
netlify.toml v1.5 blog post (#2940) 2020-09-16 17:56:47 -04:00
restore-hooks_product-requirements.md Create restore-hooks_product-requirements.md (#2699) 2020-08-12 16:13:52 -07:00

README.md

100

Build Status CII Best Practices

Overview

Velero (formerly Heptio Ark) gives you tools to back up and restore your Kubernetes cluster resources and persistent volumes. You can run Velero with a public cloud platform or on-premises. Velero lets you:

  • Take backups of your cluster and restore in case of loss.
  • Migrate cluster resources to other clusters.
  • Replicate your production cluster to development and testing clusters.

Velero consists of:

  • A server that runs on your cluster
  • A command-line client that runs locally

Documentation

The documentation provides a getting started guide and information about building from source, architecture, extending Velero, and more.

Please use the version selector at the top of the site to ensure you are using the appropriate documentation for your version of Velero.

Troubleshooting

If you encounter issues, review the troubleshooting docs, file an issue, or talk to us on the #velero channel on the Kubernetes Slack server.

Contributing

If you are ready to jump in and test, add code, or help with documentation, follow the instructions on our Start contributing documentation for guidance on how to setup Velero for development.

Changelog

See the list of releases to find out about feature changes.