Skip to content

Your First Backup

A step-by-step tutorial for creating a backup with Retour.

Prerequisites

  • Retour installed (operator, worker, carrier running)
  • A StorageBackend configured and Ready
  • A Deployment or StatefulSet with PVCs (e.g., nginx with a volume)

Option 1: Backup a Single Deployment

Point Retour at a Deployment by name. Retour discovers all PVCs mounted by that Deployment.

apiVersion: retour.thebackup.company/v1
kind: Backup
metadata:
  name: webapp-backup
spec:
  storageBackend: s3-production
  namespacedResources:
    - resourceType: Deployment
      namespace: production
      name: webapp

Apply and verify:

kubectl apply -f backup.yaml
kubectl get backups
kubectl describe backup webapp-backup

Option 2: Backup Multiple Resources

You can back up multiple Deployments, StatefulSets, or other resources in one Backup:

apiVersion: retour.thebackup.company/v1
kind: Backup
metadata:
  name: multi-backup
spec:
  storageBackend: s3-production
  namespacedResources:
    - resourceType: Deployment
      namespace: production
      name: webapp
    - resourceType: StatefulSet
      namespace: production
      name: database
    - resourceType: Service
      namespace: production
      name: webapp-service

Option 3: Backup by Namespace

Back up an entire namespace by specifying a Namespace as a cluster resource:

apiVersion: retour.thebackup.company/v1
kind: Backup
metadata:
  name: namespace-backup
spec:
  storageBackend: s3-production
  clusterResources:
    - resourceType: Namespace
      name: production

Retour will discover all namespaced resources (Deployments, StatefulSets, PVCs, etc.) in that namespace.

Supported Resource Types

Namespaced Cluster-scoped
Deployment Namespace
StatefulSet PersistentVolume
DaemonSet StorageClass
ReplicaSet ClusterRole
ReplicationController ClusterRoleBinding
Job CustomResourceDefinition
CronJob Node
PersistentVolumeClaim
Service
ConfigMap
Secret

Excluding Persistent Volumes

By default, Retour backs up both manifests and PV data. To skip PV data:

spec:
  excludePVs: true

Next Steps