Linux serverNETWORK ADMINISTRATIONSredhat

Velero – Backup & Restore Kubernetes Cluster (Application with Persistent Volume )

Velero (formerly Heptio Ark) gives you tools to back up and restore your Kubernetes cluster resources and persistent volumes. You can run Velero with a cloud provider or on-premises. Velero lets you:

Take backups of your cluster and restore in case of loss.
Migrate cluster resources to other clusters.
Replicate your production cluster to development and testing clusters.
Velero consists of:

A server that runs on your cluster
A command-line client that runs locally

https://velero.io/docs/v1.2.0/

source

by WeMake

redhat openstack

9 thoughts on “Velero – Backup & Restore Kubernetes Cluster (Application with Persistent Volume )

  • thanks for your nice video but do I need to install miniO in the same k8s machine? or I can install that in a separate server for storage only?

  • I tried this but my server nodeport have issue. When I try to access minio the port no change itself to console port. In log I can see console have different port no than nodeport service . Any advice please

  • Thanks Rohtash for the video. I have an issue , this my case MIGRATION K8s cluster GCP to AKS , I used velero , It does a backup and restore from gcp to AKS .. but data from the disk missed .. Is there a way to retreive data stored on the cloud provider's managed disk from gcp to azure disk ?

  • Thanks for the video!
    Can you please put the commands you executed?
    Did you try to actually install Velero inside a kubernetes Cluster? Can you make a video for that?
    Thanks!

  • Thanks for the video..Can you post the velero video for AKS clsuter where the storage will be Azure blob storage instead of minio? . Thanks in advance

  • Thanks Rohtash to share this demo. this will help for me to namespace backup.

  • #### Dow#### Download The Release #####
    https://github.com/vmware-tanzu/velero/releases/tag/v1.2.0

    velero-v1.3.0-beta.2-darwin-amd64

    ####### Change NodePort for S3 Compatible local Storage #####
    velero-v1.3.0-beta.2-darwin-amd64/examples/minio/

    clusterIP replaced by NodePort

    kubectl apply -f 00-minio-deployment.yaml

    ###### Credential File for minio setup #########
    vim credentials-velero
    [default]
    aws_access_key_id = minio
    aws_secret_access_key = minio123
    kubectl get svc -n velero

    ####### velero Install #####
    ./velero install
    –provider aws
    –plugins velero/velero-plugin-for-aws:v1.0.0
    –bucket velero
    –secret-file ./credentials-velero
    –use-volume-snapshots=false
    –backup-location-config region=minio,s3ForcePathStyle="true",s3Url=http://minio.velero.svc:9000,publicUrl=http://localhost:30000 –use-restic

    ############################### Veryfy the Installation ######
    kubectl get deployments -l component=velero –namespace=velero
    ######## Create your App with PV ##########

    ####### PVC ######
    apiVersion: v1
    kind: PersistentVolumeClaim
    metadata:
    name: local-path-pvc
    namespace: nginx
    spec:
    accessModes:
    – ReadWriteOnce
    storageClassName: hostpath ### Depend upon your SC #######
    resources:
    requests:
    storage: 5Mi

    ##########POD#############
    apiVersion: v1
    kind: Pod
    metadata:
    name: volume-test
    namespace: nginx
    spec:
    containers:
    – name: volume-test
    image: nginx:stable-alpine
    imagePullPolicy: IfNotPresent
    volumeMounts:
    – name: volv
    mountPath: /data
    ports:
    – containerPort: 80
    volumes:
    – name: volv
    persistentVolumeClaim:
    claimName: local-path-pvc

    #################################

    ./velero backup create nginx –include-namespaces nginx –wait

    ./velero backup logs nginx

    ./velero restore create –from-backup nginx

    kubectl get pod -n ngix
    kubectl get pod -n nginx
    nload The Release #####
    https://github.com/vmware-tanzu/velero/releases/tag/v1.2.0

    velero-v1.3.0-beta.2-darwin-amd64

    ####### Change NodePort for S3 Compatible local Storage #####
    velero-v1.3.0-beta.2-darwin-amd64/examples/minio/

    clusterIP replaced by NodePort

    kubectl apply -f 00-minio-deployment.yaml

    ###### Credential File for minio setup #########
    vim credentials-velero
    [default]
    aws_access_key_id = minio
    aws_secret_access_key = minio123
    kubectl get svc -n velero

    ####### velero Install #####
    ./velero install
    –provider aws
    –plugins velero/velero-plugin-for-aws:v1.0.0
    –bucket velero
    –secret-file ./credentials-velero
    –use-volume-snapshots=false
    –backup-location-config region=minio,s3ForcePathStyle="true",s3Url=http://minio.velero.svc:9000,publicUrl=http://localhost:30000 –use-restic

    ############################### Veryfy the Installation ######
    kubectl get deployments -l component=velero –namespace=velero
    ######## Create your App with PV ##########

    ####### PVC ######
    apiVersion: v1
    kind: PersistentVolumeClaim
    metadata:
    name: local-path-pvc
    namespace: nginx
    spec:
    accessModes:
    – ReadWriteOnce
    storageClassName: hostpath ### Depend upon your SC #######
    resources:
    requests:
    storage: 5Mi

    ##########POD#############
    apiVersion: v1
    kind: Pod
    metadata:
    name: volume-test
    namespace: nginx
    spec:
    containers:
    – name: volume-test
    image: nginx:stable-alpine
    imagePullPolicy: IfNotPresent
    volumeMounts:
    – name: volv
    mountPath: /data
    ports:
    – containerPort: 80
    volumes:
    – name: volv
    persistentVolumeClaim:
    claimName: local-path-pvc

    #################################

    ./velero backup create nginx –include-namespaces nginx –wait

    ./velero backup logs nginx

    ./velero restore create –from-backup nginx

    kubectl get pod -n ngix
    kubectl get pod -n nginx

Comments are closed.