Giter VIP home page Giter VIP logo

local-velero's Introduction

Velero Local

Prequest

that you can install velero you have a kind-cluster and minio running

Minio running in a docker container

In this repo there are the default user and password.

docker run -d --rm -p 9000:9000 --name minio \
  -e "MINIO_ROOT_USER=AKIAIOSFODNN7EXAMPLE" \
  -e "MINIO_ROOT_PASSWORD=wJalrXUtnFEMI/K7MDENG/bPxRfiCYEXAMPLEKEY" \
  -v ${HOME}/dev/velero/data:/data \
  minio/minio server /data

to get access on a mac ⇒ systempreference - network - IP <ip-address>:9000 or localhost:9000
add a new bucket ⇒ acme-develpoment

Kind Kubernetes in Docker

$ kind create cluster --name velero --image kindest/node:v1.19.1
````

=== Install Velero

1. with brew
```bash
brew install velero
  1. in a container

docker run -it --rm -v ${HOME}:/root/ -v ${PWD}:/work -w /work --net host alpine sh

# install curl & kubectl
in the container
```bash
export KUBE_VERSION=v1.19.1
apk add --no-cache curl vim
#curl -LO https://storage.googleapis.com/kubernetes-release/release/`curl -s https://storage.googleapis.com/kubernetes-release/release/stable.txt`/bin/linux/amd64/kubectl
curl -LO https://storage.googleapis.com/kubernetes-release/release/${KUBE_VERSION}/bin/linux/amd64/kubectl
chmod +x ./kubectl
mv ./kubectl /usr/local/bin/kubectl

install verlero

in the container

export VELERO_VERSION=v1.5.3
# version see https://github.com/vmware-tanzu/velero/releases/
curl -L -o /tmp/velero.tar.gz https://github.com/vmware-tanzu/velero/releases/download/${VELERO_VERSION}/velero-${VELERO_VERSION}-linux-amd64.tar.gz
tar -C /tmp -xvf /tmp/velero.tar.gz
mv /tmp/velero-${VELERO_VERSION}-linux-amd64/velero /usr/local/bin/velero
chmod +x /usr/local/bin/velero

generate a security file

echo '[default]' > ~/dev/velero/creds/credentials-velero-minio
echo 'aws_access_key_id = minioadmin'  >> ~/dev/velero/creds/credentials-velero-minio
echo 'aws_secret_access_key = minioadmin' >> ~/dev/velero/creds/credentials-velero-minio
velero install \
--provider aws \
--plugins velero/velero-plugin-for-aws:v1.1.0 \
--use-volume-snapshots=false \
--secret-file ~/dev/velero/creds/credentials-velero-minio \
--bucket acme-development \
--backup-location-config region=minio,s3ForcePathStyle="true",s3Url=http://*<ip-address>:9000

*change the IP to your IP-address from the minio container.

Backup

# velero backup create default-namespace-backup --include-namespaces default

# velero backup describe default-namespace-backup

# velero backup logs default-namespace-backup

Restore

# velero restore create default-namespace-backup --from-backup default-namespace-backup

Clean Up

Uninstall Verlero

in the container

velero install -o yaml --dry-run \
--provider aws \
--plugins velero/velero-plugin-for-aws:v1.1.0 \
--use-volume-snapshots=false \
--secret-file ~/dev/velero/creds/credentials-velero-minio \
--bucket acme-development \
--backup-location-config region=minio,s3ForcePathStyle="true",s3Url=http://*<ip-address>:9000  | kubectl delete -f -

````
delete container +
exit out of the container with the --rm the container is deleted.

Delete the kind cluster

```bash
kind delete cluster velero

Trubleshot

time="2021-01-06T11:51:17Z" level=info msg="No backup locations were ready to be verified" controller=backupstoragelocation logSource="pkg/controller/backupstoragelocation_controller.go:120" time="2021-01-06T11:51:17Z" level=error msg="Current backup storage locations available/unavailable/unknown: 0/0/1)" controller=backupstoragelocation logSource="pkg/controller/backupstoragelocation_controller.go:154" I0106 11:51:18.685344 1 request.go:621] Throttling request took 1.048411596s, request: GET:https://10.0.0.1:443/apis/apiregistration.k8s.io/v1beta1?timeout=32s

❯ kubectl get secrets -n velero cloud-credentials -o jsonpath="{.data.cloud}" | base64 -d
[default]
aws_access_key_id = minioadmin
aws_secret_access_key = minioadmin

local-velero's People

Watchers

 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.