Back to articles
AI & Cloud

Comprehensive Guide to Deploying Cloud Native Backup with Velero on k3s VPS

A detailed guide on deploying Velero for cloud native backup on a k3s cluster running on VPS, covering configuration, installation, authentication, and successful backup and restore...

DPTCloud Engineering4 min read
Comprehensive Guide to Deploying Cloud Native Backup with Velero on k3s VPS

Introduction

In cloud native environments, protecting data and the state of applications running on Kubernetes is crucial for ensuring availability and recovery capability. Velero is an open-source tool designed to back up and restore Kubernetes resources, including cluster state, persistent volume data, and custom resources. This guide walks through deploying Velero on a k3s cluster running on a VPS, creating a reliable and automated backup and recovery solution for cloud native applications.

Prerequisites

To deploy Velero on a k3s VPS, ensure the following requirements are met:

  • 1 VPS running Ubuntu 20.04 or 22.04 (minimum 4GB RAM, 2 vCPUs)
  • k3s installed and running on the VPS
  • Access to the k3s cluster via kubectl
  • Access to a cloud storage system (e.g., AWS S3, MinIO, or Google Cloud Storage)
  • Velero CLI installed on the local machine

Deploying Velero on k3s VPS

We will deploy Velero by installing the cloud storage plugin and configuring backup options.

1. Install Velero CLI

On your local machine, download the Velero CLI from the official site:

curl -LO https://github.com/vmware-tanzu/velero/releases/latest/download/velero-v1.10.0-linux-amd64.tar.gz
tar -xzf velero-v1.10.0-linux-amd64.tar.gz
sudo mv velero-v1.10.0-linux-amd64/velero /usr/local/bin/velero

2. Configure Storage Plugin

Assuming you are using MinIO as your storage system, create a bucket and generate authentication credentials:

export MINIO_ACCESS_KEY="your-access-key"
export MINIO_SECRET_KEY="your-secret-key"
export MINIO_ENDPOINT="minio.example.com:9000"
export MINIO_BUCKET="velero-backups"

3. Deploy Velero on k3s

Use the following command to install Velero with the MinIO plugin:

velero install \
  --provider aws \
  --bucket $MINIO_BUCKET \
  --secret-file ./credentials-minio \
  --use-volume-snapshots=false \
  --use-restic \
  --backup-location-config region=us-east-1,s3ForcePathStyle="true",s3Url=$MINIO_ENDPOINT \
  --plugins velero/velero-plugin-for-aws:v1.6.0

Ensure the credentials-minio file contains:

[default]
aws_access_key_id = $MINIO_ACCESS_KEY
aws_secret_access_key = $MINIO_SECRET_KEY

Verification and Authentication

After installation, verify Velero's status:

velero backup get
velero restore get

Create a test backup:

velero backup create test-backup --include-namespaces default

Data Restore

To restore from a backup:

velero restore create restore-test --from-backup test-backup

Monitor the restore process:

velero restore describe restore-test

Alternative Solutions and Options

Velero supports multiple storage systems, including:

  • AWS S3
  • Google Cloud Storage
  • Microsoft Azure Blob Storage
  • MinIO (self-hosted)

Simply adjust the plugin and backup-location-config settings accordingly.

Troubleshooting

  • Cannot connect to MinIO: Verify endpoint, access key, secret key, and bucket permissions.
  • Backup failure: Check Velero pod logs and plugin logs.
  • No data in bucket: Ensure Velero is correctly configured and has write permissions.

References

Related infrastructure & engineering guides: High-RAM Cloud VPS for Self-Hosted LLMs & API Gateways

DPTCloud Tier III Infrastructure

High-RAM Cloud VPS Plans Optimized for AI, Databases & Cache

Enterprise RAID 10 NVMe SSDs, CMC & FPT District 9 uplinks with Anycast Anti-DDoS and 99.99% SLA.

View 22 VPS Plans
ECO · vn-02Recommended

VPS-4E

297.000 ₫ / mo

10% VAT included

  • CPU: 4 vCPU
  • RAM: 8 GB
  • SSD: 50 GB NVMe
ECO · vn-02

VPS-5E

614.900 ₫ / mo

10% VAT included

  • CPU: 8 vCPU
  • RAM: 16 GB
  • SSD: 100 GB NVMe
ADVANCED · vn-03Recommended

VPS-4T

548.900 ₫ / mo

10% VAT included

  • CPU: 4 vCPU
  • RAM: 8 GB
  • SSD: 50 GB NVMe

Related Articles

View all
ZaloZalo SupportDiscord0384 753 478