{
  "name": "velero-backup",
  "title": "Back up a cluster with Velero",
  "category": "Kubernetes",
  "tags": [
    "kubectl",
    "kubernetes"
  ],
  "version": "1.0.0",
  "date": "2026-10-18",
  "notes": "Initial release.",
  "latest": true,
  "installable": true,
  "url": "https://catalog.dagweave.com/api/v1/items/velero-backup/1.0.0.json",
  "templateUrl": "https://catalog.dagweave.com/api/v1/items/velero-backup/1.0.0/template.yaml",
  "entrypoint": "backup",
  "parameters": [
    {
      "name": "name-prefix",
      "title": "Name prefix",
      "description": "Prefix for the backup name. Kubernetes adds a random suffix.",
      "type": "string",
      "required": false,
      "default": "backup"
    },
    {
      "name": "namespaces",
      "title": "Namespaces",
      "description": "Comma-separated namespaces to back up. Leave blank to back up all of them.",
      "type": "string",
      "required": false,
      "default": "",
      "example": "checkout,payments"
    },
    {
      "name": "storage-location",
      "title": "Storage location",
      "description": "Name of the Velero backup storage location. Leave blank for the default one.",
      "type": "string",
      "required": false,
      "default": ""
    },
    {
      "name": "timeout-seconds",
      "title": "Timeout seconds",
      "description": "Seconds to wait for the backup to finish before failing the step.",
      "type": "string",
      "required": false,
      "default": "1800"
    },
    {
      "name": "ttl",
      "title": "Ttl",
      "description": "How long Velero keeps the backup before deleting it.",
      "type": "string",
      "required": false,
      "default": "720h0m0s"
    },
    {
      "name": "velero-namespace",
      "title": "Velero namespace",
      "description": "Namespace Velero is installed in.",
      "type": "string",
      "required": false,
      "default": "velero"
    }
  ],
  "images": [
    {
      "ref": "cgr.dev/chainguard/kubectl@sha256:98f9c337808ecf5d5e80b79af4345762a3d8c803ebf8c857d2dddabf885107ba",
      "repository": "cgr.dev/chainguard/kubectl",
      "tag": "latest-dev",
      "digest": "sha256:98f9c337808ecf5d5e80b79af4345762a3d8c803ebf8c857d2dddabf885107ba"
    }
  ],
  "install": {
    "kubectl": "kubectl apply -n argo -f https://catalog.dagweave.com/api/v1/items/velero-backup/1.0.0/template.yaml",
    "argo": "argo template create -n argo https://catalog.dagweave.com/api/v1/items/velero-backup/1.0.0/template.yaml"
  },
  "template": "apiVersion: argoproj.io/v1alpha1\nkind: WorkflowTemplate\nmetadata:\n  name: velero-backup\n  labels:\n    dagweave.io/catalog-item: velero-backup\n  annotations:\n    dagweave.io/catalog-version: \"1.0.0\"\n    dagweave.io/catalog-category: \"Kubernetes\"\nspec:\n  entrypoint: backup\n  templates:\n    - name: backup\n      metadata:\n        annotations:\n          dagweave.io/local-support: unsupported\n          dagweave.io/local-support-reason: \u003e-\n            This step runs kubectl with whatever identity the pod is given. On Dagweave\n            Local that is the default service account of the hidden cluster's argo\n            namespace, which Argo's quick-start install grants create, get and patch on pods\n            and create and get on workflows, and nothing anywhere else. Creating a Velero\n            Backup is outside what that account may do, so the step fails on a 403 rather\n            than touching anything. The cluster you meant is one this run cannot reach.\n      inputs:\n        parameters:\n          - name: namespaces\n            default: \"\"\n          - name: ttl\n            default: \"720h0m0s\"\n          - name: storage-location\n            default: \"\"\n          - name: velero-namespace\n            default: \"velero\"\n          - name: name-prefix\n            default: \"backup\"\n          - name: timeout-seconds\n            default: \"1800\"\n      outputs:\n        parameters:\n          # Name of the Velero Backup object that was created.\n          - name: backup-name\n            valueFrom:\n              path: /tmp/backup-name\n      container:\n        # cgr.dev/chainguard/kubectl:latest-dev\n        image: cgr.dev/chainguard/kubectl@sha256:98f9c337808ecf5d5e80b79af4345762a3d8c803ebf8c857d2dddabf885107ba\n        command: [sh, -c]\n        args:\n          - |\n            set -eu\n            case \"${INCLUDED_NAMESPACES}${TTL}${STORAGE_LOCATION}${NAME_PREFIX}\" in\n              *[!A-Za-z0-9,._-]*) echo \"namespaces, ttl, storage-location and name-prefix take letters, digits and , . _ - only\" \u003e\u00262; exit 2 ;;\n            esac\n            backup=$(\n              {\n                echo \"apiVersion: velero.io/v1\"\n                echo \"kind: Backup\"\n                echo \"metadata:\"\n                echo \"  generateName: ${NAME_PREFIX}-\"\n                echo \"spec:\"\n                echo \"  ttl: ${TTL}\"\n                if [ -n \"${STORAGE_LOCATION}\" ]; then echo \"  storageLocation: ${STORAGE_LOCATION}\"; fi\n                if [ -n \"${INCLUDED_NAMESPACES}\" ]; then\n                  echo \"  includedNamespaces:\"\n                  IFS=,\n                  for ns in ${INCLUDED_NAMESPACES}; do echo \"    - ${ns}\"; done\n                fi\n              } | kubectl create -n \"${VELERO_NAMESPACE}\" -f - -o jsonpath='{.metadata.name}'\n            )\n            echo \"${backup}\" \u003e /tmp/backup-name\n            echo \"created backup ${backup}\"\n            end=$(( $(date +%s) + TIMEOUT_SECONDS ))\n            phase=\"\"\n            while [ \"$(date +%s)\" -lt \"${end}\" ]; do\n              phase=$(kubectl get backup \"${backup}\" -n \"${VELERO_NAMESPACE}\" -o jsonpath='{.status.phase}')\n              case \"${phase}\" in\n                Completed|PartiallyFailed|Failed|FailedValidation) break ;;\n              esac\n              sleep 10\n            done\n            echo \"backup ${backup}: ${phase:-no status yet}\"\n            [ \"${phase}\" = \"Completed\" ]\n        env:\n          - name: INCLUDED_NAMESPACES\n            value: \"{{inputs.parameters.namespaces}}\"\n          - name: TTL\n            value: \"{{inputs.parameters.ttl}}\"\n          - name: STORAGE_LOCATION\n            value: \"{{inputs.parameters.storage-location}}\"\n          - name: VELERO_NAMESPACE\n            value: \"{{inputs.parameters.velero-namespace}}\"\n          - name: NAME_PREFIX\n            value: \"{{inputs.parameters.name-prefix}}\"\n          - name: TIMEOUT_SECONDS\n            value: \"{{inputs.parameters.timeout-seconds}}\"\n        resources:\n          requests:\n            cpu: 50m\n            memory: 64Mi\n          limits:\n            memory: 256Mi\n",
  "templateSha256": "9adb0dc52431a522118596a4d55ebd0a5866687a7743860f43a58d2a46fe8d9a",
  "source": "https://github.com/dagweave/catalog/tree/67458f74dbbf913b03177f3cefc69424be85eb1d/catalog/velero-backup",
  "catalogSha": "67458f74dbbf913b03177f3cefc69424be85eb1d"
}
