/platform-extras-skills:velero-backup-and-restorefrom platform-extras-skills
Guides using Velero to back up and restore Kubernetes cluster state and persistent volumes, including CSI snapshots, restic/kopia file-system backup, and cross-cluster migration.
Ships in platform-extras-skills. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
None: SKILL.md is the whole skill.
Kubernetes has no built-in way to snapshot "everything a namespace or cluster needs to exist" — object manifests, RBAC, CRDs, and the persistent volume data behind stateful workloads are each backed up (if at all) through different mechanisms. Velero unifies this: it snapshots Kubernetes API objects to object storage (S3, Azure Blob, GCS, or S3-compatible on-prem storage) and coordinates persistent volume data capture either through the cloud provider's native CSI volume snapshot API or through Velero's file-system backup path (restic, or its successor kopia) for volumes without CSI snapshot support — then restores both together, on the same cluster or a completely different one. That makes Velero the tool of choice for three distinct but related jobs: routine scheduled backup/restore of cluster state, disaster recovery of a specific namespace or the whole cluster, and cross-cluster/cross-account migration (e.g. moving a namespace from a dev cluster to a new AWS account, or between Kubernetes distributions). This skill is Velero- specific; for the broader RTO/RPO-driven DR pattern selection and backup immutability strategy that Velero backups should fit into, see the general disaster-recovery skill referenced below.
kubectl delete namespace, a botched
Helm upgrade/rollback, or a corrupted CRD/webhook that took down a
workload.kube-system,
cert-manager-issued Secrets that shouldn't be duplicated) from backup
scope.VolumeSnapshotClass for the CSI driver in use (EBS CSI, Azure
Disk CSI, PD CSI) and Velero's velero-plugin-for-csi installed.--use-node-agent/--uploader-type=kopia (kopia is the default
uploader path from Velero 1.10+, replacing restic).Secret, never inline in the BackupStorageLocation.Backup, Restore, Schedule, BackupStorageLocation,
VolumeSnapshotLocation) and its server Deployment/DaemonSet
(node-agent for file-system backup runs as a DaemonSet).Install Velero pointed at object storage, scoped credentials only:
velero install \
--provider aws \
--plugins velero/velero-plugin-for-aws:v1.10.0,velero/velero-plugin-for-csi:v0.7.1 \
--bucket <VELERO_BACKUP_BUCKET> \
--backup-location-config region=us-east-1 \
--snapshot-location-config region=us-east-1 \
--secret-file ./credentials-velero \
--use-node-agent \
--uploader-type=kopia
credentials-velero contains only the scoped IAM access key for the
backup bucket/role — reference it via a file path passed to
--secret-file, never paste the key into a manifest or command
history.
Confirm the BackupStorageLocation is Available before
trusting any backup:
velero backup-location get
Take an on-demand backup of a namespace, including PV data via CSI snapshots where the storage class supports it:
velero backup create payments-ns-backup \
--include-namespaces payments \
--snapshot-volumes=true \
--ttl 720h0m0s
For volumes without CSI snapshot support, add
--default-volumes-to-fs-backup=true to fall back to the
kopia/restic file-system path for that backup.
Exclude resources that shouldn't be duplicated or restored verbatim — cluster-scoped resources, webhook configurations, or Secrets managed by an external system (e.g. cert-manager-issued TLS certs, or Secrets synced by External Secrets Operator that will regenerate on restore anyway):
velero backup create payments-ns-backup \
--include-namespaces payments \
--exclude-resources secrets.certmanager.k8s.io \
--snapshot-volumes=true
Schedule recurring backups with a Schedule custom resource
instead of a cron job wrapping the CLI, so Velero manages retention
(TTL) and backup naming consistently:
apiVersion: velero.io/v1
kind: Schedule
metadata:
name: payments-ns-daily
namespace: velero
spec:
schedule: "0 3 * * *" # 03:00 daily, standard cron syntax
template:
includedNamespaces:
- payments
snapshotVolumes: true
ttl: 720h0m0s # 30-day retention
Restore into the same or a different cluster. Restoring while the original namespace/resources still exist will, by default, skip objects that already exist rather than overwrite them — but always verify this before running against a live cluster (see warning below):
velero restore create payments-ns-restore \
--from-backup payments-ns-backup \
--include-namespaces payments
To restore into a different namespace or cluster (migration use
case), remap the namespace and target a cluster with its own
BackupStorageLocation pointed at the same bucket:
velero restore create payments-ns-restore-staging \
--from-backup payments-ns-backup \
--namespace-mappings payments:payments-staging
⚠️ Warning — restore can overwrite live resources. If a
Restore targets a namespace where some objects still exist and
have since been modified, Velero's default policy is to leave
pre-existing objects alone (report them as skipped) for most
resource types, but this is not uniform across every resource
kind and Velero version, and --existing-resource-policy=update
explicitly enables overwriting. Never run a restore with
--existing-resource-policy=update against a live, currently-serving
namespace without first confirming in a dry run / staging restore
what will change — a restore that overwrites a live Deployment,
ConfigMap, or Secret with stale backup content can cause an
immediate outage or silently roll back a recent, intentional change.
Prefer restoring into a new/renamed namespace first to inspect
the result, then cut traffic over deliberately.
Validate restores periodically, not just on paper: restore the
most recent scheduled backup into a scratch namespace or scratch
cluster on a recurring basis and run a smoke test (pod readiness,
a basic application health check) to confirm backups are actually
restorable, not just "completed" per velero backup describe.
For cross-account/cross-cluster migration, set up a second
BackupStorageLocation in the destination cluster pointed at the
same bucket (with cross-account bucket policy/IAM trust configured
if the destination is a different AWS account), then run the restore
there — this is the same mechanism as disaster recovery, just
targeting a different cluster deliberately rather than reactively.
Completed backup status only means
the backup job ran, not that the data restores cleanly.Symptom: A restore into a namespace that already has live,
running workloads causes those workloads to revert to stale
configuration or briefly go unready.
Fix: The restore ran with --existing-resource-policy=update
(or against a resource type where Velero's default behavior updates
rather than skips) against a live namespace. Restore into a
scratch/renamed namespace first, diff the result against what's
currently live, and only promote deliberately — see the warning in
step 7.
Symptom: velero backup describe shows Completed, but
restoring that backup later fails to bring back persistent volume
data, or the restored PVs are empty.
Fix: --snapshot-volumes was left at its default (or
--default-volumes-to-fs-backup wasn't set) for a storage class
without CSI snapshot support, so PV data was silently skipped.
Confirm the storage class's CSI driver actually supports
VolumeSnapshotClass, or explicitly enable file-system backup for
volumes that don't.
Symptom: Backups are taking increasingly long, and the node-agent DaemonSet pods show high CPU/memory usage. Fix: File-system backup (kopia/restic) is being used for volumes that do support CSI snapshots, doing much more expensive file-level reads than necessary. Move eligible storage classes to CSI volume snapshots and reserve file-system backup only for volumes that genuinely require it.
Symptom: A scheduled Schedule backup silently stops running, and
nobody notices until a restore is needed and the most recent backup
is weeks old.
Fix: No monitoring/alerting was wired to Velero's backup status
(e.g. via the velero_backup_last_successful_timestamp metric
scraped by Prometheus). Add an alerting rule against that metric — see
prometheus-and-grafana-monitoring-stack
— so a stalled schedule pages someone within hours, not weeks.
Symptom: Cross-account migration restore fails with an access-
denied error reading the backup from object storage.
Fix: The destination cluster's BackupStorageLocation credential
doesn't have cross-account read access to the source bucket (missing
bucket policy / IAM trust relationship). Grant the destination
account's Velero role explicit read access to the shared bucket (or
copy the backup data to a bucket the destination account can already
reach) before attempting the restore.
Scenario: An engineer runs kubectl delete namespace payments
against the wrong cluster context, deleting the payments namespace and
everything in it, including a PostgreSQL StatefulSet's persistent
volumes. A daily Velero Schedule backup exists.
velero backup get
velero backup describe payments-ns-daily-20260728030000 --details
payments if
anything else in the cluster might already reference that name in a
half-recreated state — restore first into a scratch namespace to
verify integrity:
velero restore create payments-recovery-check \
--from-backup payments-ns-daily-20260728030000 \
--namespace-mappings payments:payments-recovery-check
payments namespace (which no
longer exists, so there's no live-overwrite risk in this specific
case):
velero restore create payments-ns-restore \
--from-backup payments-ns-daily-20260728030000 \
--include-namespaces payments
Ready and persistent
volumes are bound with data intact; clean up the scratch
payments-recovery-check namespace once satisfied.velero_backup_last_successful_timestamp so a
future failed/stalled schedule is caught immediately rather than
discovered during the next incident.What SKILL.md sets; muted values are Claude Code's defaults
Three short reads, in order
Kubernetes, AWS, GCP, Azure
npx claudepluginhub selvarajmurugesan90/ops-engineering-skills --plugin platform-extras-skills16 skills in this plugin
/backstage-developer-portalGuides building an internal developer portal with Backstage — authoring catalog-info.yaml to register services in the software catalog, setting up TechDocs for docs-as-code, writing Software Templates to scaffold new services, and understanding the plugin architecture. Use when a user asks to "register a service in Backstage", "write a catalog- info.yaml", "set up TechDocs", "create a Backstage software template for scaffolding new repos", "add a Backstage plugin", or "build an internal developer portal."
/distributed-tracing-with-tempo-and-jaegerGuides configuring Grafana Tempo or Jaeger as the distributed tracing backend — trace storage backend selection and retention, sampling strategy at the backend/collector level (head-based vs. tail-based), and trace-to-metrics/trace-to-logs correlation so a trace ID can pivot directly into a log line or a metrics exemplar. Use when the user asks to "set up Tempo," "configure Jaeger storage," "set trace retention," "configure trace-to-logs correlation in Grafana," "design a sampling strategy for traces," or "query traces with TraceQL." This is the tracing *backend/storage* layer — instrumenting applications and configuring the OpenTelemetry Collector that feeds this backend is covered separately in opentelemetry-instrumentation-and-collector-configuration.
/fluent-bit-configuration-validationValidates Fluent Bit pipeline configuration syntax and tests the INPUT/FILTER/OUTPUT pipeline against sample log lines before a production rollout — dry-run checks, parser testing, and route/Match verification. Use when a user asks to "validate this Fluent Bit config before deploying," "test my Fluent Bit parser against sample logs," "will this Fluent Bit change break log routing," "check this Fluent Bit config in CI," or reports logs silently missing/misrouted after a Fluent Bit config change.
/fluent-bit-log-forwarding-configurationConfigures Fluent Bit as a lightweight log forwarder — INPUT sources (`tail`, `systemd`, Kubernetes container logs), FILTER stages (`kubernetes` metadata enrichment, `parser`, `grep`, `modify`, `nest`/`lift`), and OUTPUT routing to Loki, Elasticsearch/OpenSearch, or S3, including multiple outputs via tags/`Match` and backpressure/ buffering settings. Use when the user asks to "set up Fluent Bit," "forward Kubernetes pod logs to Loki/Elasticsearch/S3," "write a Fluent Bit parser for my log format," "route different logs to different outputs," or "Fluent Bit is dropping logs / backing up."
/incident-investigation-using-metrics-logs-tracesGuides correlating Prometheus metrics, log queries, and distributed traces together during a live incident investigation — using each signal's strengths to narrow from "something is wrong" to a specific root cause faster than any single signal alone. Use when a user asks to "investigate this incident using our metrics and logs," "find the root cause across dashboards, logs, and traces," "correlate this latency spike with logs and a trace," "pivot from an alert to the actual failing request," or is actively triaging a live production issue and needs a systematic cross-signal approach rather than guessing which dashboard to check next.
/karpenter-cluster-autoscalingGuides configuring Karpenter for Kubernetes node autoscaling — NodePool and EC2NodeClass (or equivalent) provisioning, consolidation and bin-packing behavior, Spot/On-Demand mixing, and how Karpenter compares to and can replace the Kubernetes Cluster Autoscaler. Use when a user asks to "set up Karpenter", "write a NodePool spec", "reduce node cost via consolidation/bin-packing", "mix Spot and On-Demand nodes", "choose between Karpenter and Cluster Autoscaler", or "debug why pods are stuck Pending / a node won't scale down."
Other plugins' skills for the same job