Giter VIP home page Giter VIP logo

velero-examples's Introduction

velero-examples

This repo provides a few examples using velero to back up and restore applications. The CLI invocations use kubectl where it would work, and oc when there are openshift-specific resources involved. In a base kubernetes environment, some modification might be needed (use Deployments instead of DeploymentConfigs, etc.)

Install Velero (1.2 release)

The velero image used is the upstream 1.2 release from docker.io. The only plugin included is the aws plugin required for supporting an aws/s3 BackupStorageLocation

TODO: modify scripts to take VELERO_* from env/input to avoid risk of committing credentials to github.

  • replace VELERO_ACCESS_KEY_ID and VELERO_SECRET_ACCESS_KEY in velero-install/aws-credentials with your values (make sure this change doesn't get committed to github)
  • replace VELERO_BUCKET_NAME in velero-install/velero-server.yaml with your bucket name
kubectl apply -f velero-install/crds.yaml
kubectl apply -f velero-install/velero-namespace.yaml
kubectl create secret generic cloud-credentials --namespace velero --from-file cloud=velero-install/aws-credentials
kubectl apply -f velero-install/velero-server.yaml

Stateless application backup/restore (nginx)

Stateless example

Stateful application backup/restore (mysql)

Persistent application, backup/restore using Restic.

Stateful example

Application backup/restore with NooBaa

Stateful example with NooBaa

Stateful application backup/restore using snapshots (mssql)

Persistent application, backup/restore using PV snapshots.

Stateful example

velero-examples's People

Contributors

sseago avatar dymurray avatar devarshshah15 avatar kurwang avatar

Stargazers

Ai-feier avatar SM. Amin Aleahmad avatar Masa Abushamleh avatar DeMOLition avatar Francesco Furiani avatar Tiger Kaovilai avatar Simon Baerlocher avatar ibrahim edib kokdemir avatar Guillermo Ojea Quintana avatar Kelly Rodger avatar

Watchers

John Matthews avatar James Labocki avatar James Cloos avatar  avatar Jason Montleon avatar Todd Sanders avatar Savitha Raghunathan avatar Marco Rizzi avatar Tiger Kaovilai avatar  avatar Shubham Pampattiwar avatar

velero-examples's Issues

Getting ImagePullBack while deploying pgbench.yaml to cluster

Hi,

I was trying using patroni example to test velero backup and restore in OpenShift cluster. I deployed all the resources mentioned in repository but pgbench.yaml not deploying successfully as it's looking for quay.io/sagyvolkov/pgbench-container:0.1 container image which seems to not having access. I tried searching for that image from my quay.io account and even on internet but not getting. Can we make it public or mention the steps to create pgbench-container image locally.

Issue with hooks for cassandra

Tried B/R with noobaa enabled for cassandra and the backup partially failed with the following logs

velero backup logs cassandra --insecure-skip-tls-verify=true | grep error time="2020-08-06T16:05:02Z" level=info msg="stderr: error: ThreadPoolExecutor has shut down\n-- StackTrace --\njava.util.concurrent.RejectedExecutionException: ThreadPoolExecutor has shut down\n\tat org.apache.cassandra.concurrent.DebuggableThreadPoolExecutor$1.rejectedExecution(DebuggableThreadPoolExecutor.java:58)\n\tat java.util.concurrent.ThreadPoolExecutor.reject(ThreadPoolExecutor.java:830)\n\tat java.util.concurrent.ThreadPoolExecutor.execute(ThreadPoolExecutor.java:1379)\n\tat org.apache.cassandra.concurrent.DebuggableThreadPoolExecutor.execute(DebuggableThreadPoolExecutor.java:162)\n\tat org.apache.cassandra.db.ColumnFamilyStore.waitForFlushes(ColumnFamilyStore.java:990)\n\tat org.apache.cassandra.db.ColumnFamilyStore.forceFlush(ColumnFamilyStore.java:956)\n\tat org.apache.cassandra.db.ColumnFamilyStore.forceBlockingFlush(ColumnFamilyStore.java:996)\n\tat org.apache.cassandra.service.StorageService.forceKeyspaceFlush(StorageService.java:3434)\n\tat sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)\n\tat sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)\n\tat sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)\n\tat java.lang.reflect.Method.invoke(Method.java:498)\n\tat sun.reflect.misc.Trampoline.invoke(MethodUtil.java:72)\n\tat sun.reflect.GeneratedMethodAccessor5.invoke(Unknown Source)\n\tat sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)\n\tat java.lang.reflect.Method.invoke(Method.java:498)\n\tat sun.reflect.misc.MethodUtil.invoke(MethodUtil.java:276)\n\tat com.sun.jmx.mbeanserver.StandardMBeanIntrospector.invokeM2(StandardMBeanIntrospector.java:112)\n\tat com.sun.jmx.mbeanserver.StandardMBeanIntrospector.invokeM2(StandardMBeanIntrospector.java:46)\n\tat com.sun.jmx.mbeanserver.MBeanIntrospector.invokeM(MBeanIntrospector.java:237)\n\tat com.sun.jmx.mbeanserver.PerInterface.invoke(PerInterface.java:138)\n\tat com.sun.jmx.mbeanserver.MBeanSupport.invoke(MBeanSupport.java:252)\n\tat com.sun.jmx.interceptor.DefaultMBeanServerInterceptor.invoke(DefaultMBeanServerInterceptor.java:819)\n\tat com.sun.jmx.mbeanserver.JmxMBeanServer.invoke(JmxMBeanServer.java:801)\n\tat javax.management.remote.rmi.RMIConnectionImpl.doOperation(RMIConnectionImpl.java:1468)\n\tat javax.management.remote.rmi.RMIConnectionImpl.access$300(RMIConnectionImpl.java:76)\n\tat javax.management.remote.rmi.RMIConnectionImpl$PrivilegedOperation.run(RMIConnectionImpl.java:1309)\n\tat javax.management.remote.rmi.RMIConnectionImpl.doPrivilegedOperation(RMIConnectionImpl.java:1401)\n\tat javax.management.remote.rmi.RMIConnectionImpl.invoke(RMIConnectionImpl.java:829)\n\tat sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)\n\tat sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)\n\tat sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)\n\tat java.lang.reflect.Method.invoke(Method.java:498)\n\tat sun.rmi.server.UnicastServerRef.dispatch(UnicastServerRef.java:357)\n\tat sun.rmi.transport.Transport$1.run(Transport.java:200)\n\tat sun.rmi.transport.Transport$1.run(Transport.java:197)\n\tat java.security.AccessController.doPrivileged(Native Method)\n\tat sun.rmi.transport.Transport.serviceCall(Transport.java:196)\n\tat sun.rmi.transport.tcp.TCPTransport.handleMessages(TCPTransport.java:573)\n\tat sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.run0(TCPTransport.java:834)\n\tat sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.lambda$run$0(TCPTransport.java:688)\n\tat java.security.AccessController.doPrivileged(Native Method)\n\tat sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.run(TCPTransport.java:687)\n\tat java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)\n\tat java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)\n\tat java.lang.Thread.run(Thread.java:748)\n\n" backup=oadp-operator/cassandra hookCommand="[/bin/bash -c opt/cassandra/bin/nodetool disablegossip && opt/cassandra/bin/nodetool disablethrift && opt/cassandra/bin/nodetool disablebinary && opt/cassandra/bin/nodetool flush]" hookContainer=cassandra hookName="<from-annotation>" hookOnError=Fail hookPhase=pre hookSource=annotation hookTimeout="{30s}" hookType=exec logSource="pkg/podexec/pod_command_executor.go:172" name=cassandra-0 namespace=cassandra-stateful resource=pods time="2020-08-06T16:05:02Z" level=error msg="Error executing hook" backup=oadp-operator/cassandra error="command terminated with exit code 2" hookPhase=pre hookSource=annotation hookType=exec logSource="pkg/backup/item_hook_handler.go:100" name=cassandra-0 namespace=cassandra-stateful resource=pods time="2020-08-06T16:05:02Z" level=error msg="Error backing up item" backup=oadp-operator/cassandra error="command terminated with exit code 2" logSource="pkg/backup/backup.go:454" name=cassandra-0

Example with DeploymentConfig controller fail to restore

The mysql-persistent example fails to restore as is. If I modify the installation template to use a Deployment instead, everything works well.
Possibly related to: vmware-tanzu/velero#1981

I'm using the following Docker image/tags in my project:
https://github.com/rflorenc/openshift-backup-infra/blob/master/hack/docker_images.list

Components installed in order:
Noobaa S3
Velero (using Noobaa s3 as default BSL)
Restic Restore Helper Configmap
Openshift-Velero-Plugin

If I use a DC, Restic's pvc/pv restore times out. A working project is restored, but the mounted pod name and data will not match the one in the initial Backup.

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.