This topic describes the Velero and restic back up and restore process for Kubernetes workloads deployed to VMware Tanzu Kubernetes Grid Integrated Edition (TKGI) clusters.
Velero is an open-source product that provides full back up and recovery of Kubernetes workloads. Restic is used as a companion tool with Velero to provide platform independent volume snapshots. For more information about estic, see Restic Integration in the Velero documentation.
Together, Velero and restic support back up and recovery for all types of Kubernetes workloads deployed to Tanzu clusters.
An application deployed to Kubernetes can be stateless or stateful. Velero with restic can back up and restore both types, but the procedure might differ slightly. The examples in Scenarios for Backing Up and Restoring TKGI Workloads demonstrate the differences and process for each type.
In addition, an application might have a service attached or ingress enabled. See Services and Ingress for a summary of the available techniques for ensuring full restoration of functionality.
If a service is attached, the IP address might need to be static for back up and restore to work as expected.
Velero back up and restore is agnostic of NSX-T objects. To restore applications with same IP address, there are two mechanism available with TKGI:
loadBalancerIPin the YAML file.
Tanzu Kubernetes clusters support two persistence providers: VMware Cloud Provider (vCP) and the Container Storage Interface (CSI).
vCP is VMware’s Kubernetes storage plugin that allows cluster nodes on vSphere to interact with vCenter to support Kubernetes Persistent Volume objects. CSI is open-source software that enables Kubernetes implementations to provide a standard interface for storage systems, without having to create drivers for each system.
The provider is defined in the storage class. Velero with restic back up and restore is slightly different depending on the type of persistence provider.
The VMware Cloud Provider (vCP) StorageClass provisioner only works with TKGI:
kind: StorageClass apiVersion: storage.k8s.io/v1 metadata: name: demo-sts-sc provisioner: kubernetes.io/vsphere-volume parameters: diskformat: thin
The Container Storage Interface (CSI) StorageClass provisioner works with TKGI, TKGM, and TKGS.
kind: StorageClass apiVersion: storage.k8s.io/v1 metadata: name: guestbook-sc-csi annotations: storageclass.kubernetes.io/is-default-class: "true" provisioner: csi.vsphere.vmware.com parameters: datastoreurl: "ds:///vmfs/volumes/vsan:52d8eb4842dbf493-41523be9cd4ff7b7/"
This section lists the requirements for using Velero and restic for Kubernetes workload back up and recovery.
To back up and recover TKGI Kubernetes workloads using Velero and restic, TKGI installs a Velero and a restic Pod on each target Kubernetes cluster.
To configure your target clusters for Velero and restic back up and recovery, complete the steps in Modify the Host Path in Installing Velero and Restic.
You need to provide an object store for Velero backups. Velero supports a number of object store providers. For more information, see Providers in the Velero documentation. MinIO is an S3-compatible object store that is easy to install and use. This documentation uses the MinIO server installed on a Linux VM as the backup destination for the example scenarios.
To perform Velero back up and recovery, you install the Velero CLI on a client VM. This can be the TKGI client VM or an administrator laptop.
Refer to the Release Notes for the supported Velero version.
When you run the Velero CLI to install Velero on the Kubernetes cluster, Velero and restic pods are deployed to the cluster. To install the prods, the instructions assume that the cluster environment has internet access, including the client where the Velero CLI is installed as well as the Kubernetes cluster. In case the environment has no internet access, you use can use a private container registry to install Velero pods onto the target cluster. See Air-gapped deployments.
To get started with Velero and restic: