Skip to main content
  1. Blog/

Veeam + Kasten

Author
Marco Escobar
Data protection, Kubernetes, cybersecurity and AI. Hands-on guides from the trenches: Veeam, Kasten, VMware, Oracle, cloud, and whatever I’m breaking in the homelab this week.
Table of Contents
Veeam + Kasten — veeam kasten final

Great news! The acquisition of Kasten by Veeam Software, which extends the benefits of data protection of Veeam in modern data centers with container technologies using Kubernetes or k8s. In this post we will see the installation, configuration and recovery of containers with Kasten in a cluster of Kubernetes based on tanzu Kubernetes grid.

Introduction
#

Now more than one will wonder, what is Kasten?, Okay, Kasten is the backup and disaster recovery leader for Kubernetes, one of the important features is that it is a very easy to use solution, it is developed for kubernetes and in a cloud-native architecture.

It is because of that Kasten can help protect your containers with application integration either in Public or Private Clouds, for example, Google Kubernetes Engine, AWS Elastic Kubernetes Services, Azure Kubernetes Services, IBM Kubernetes Services, VMware vSphere, Red Hat OpenShift, among others.

As well as integrate with different Storage technologies, such as:

  • Amazon Elastic Block Store (EBS)
  • Amazon Elastic File System (EFS)
  • Azure Managed Disks
  • Google PersistentDisk
  • IBM Cloud Block Storage
  • Ceph (RBD)
  • Cinder-based providers on OpenStack
  • vSphere Cloud Native Storage (CNS) (Requires vSphere 6.7u3+)
  • portworx
  • Pure storage
  • netapp

It also allows container migrations between different container services in case of a disaster, change of provider, testing or simply maintaining a hybrid architecture.

If you want to know more about Kasten, you can enter their website and the documentation website:

https://www.kasten.io

https://docs.kasten.io/latest

After knowing a little what it is Kasten, we will start by detailing what I have as an environment to support my containers Subsidiary Kubernetes Grid 1.1.3, a vSphere 7 Update 1, remember that it can be used from vSphere 6.7 Update 3

Tanzu Productive Cluster Kubernetes grid:
#

Veeam + Kasten — screenshot 1
Veeam + Kasten — screenshot 2

Where the management cluster is with a production plan, and for the application cluster I also use the production plan to use multiple k8s roles, if you want to know more about the plans offered by Tanzu Kubernetes Grid or TKG visit:

https://docs.vmware.com/en/VMware-Tanzu-Kubernetes-Grid/1.1/vmware-tanzu-kubernetes-grid-11/GUID-tanzu-k8s-clusters-create.html

And if we review the cluster resources we can see:

Veeam + Kasten — screenshot 3

With the command:

 kubectl get pvc,pv,sc --all-namespaces

```bash

It will indicate the requests for pvc (PersistentVolumeClaim) disks for applications, persistent volumes that are provided by the system or dynamic pv (PersistentVolume), and the storage class offered to the cluster sc (Storage Classes).

```bash
kubectl get pod --all-namespaces

```bash

It will indicate all the pods that Tanzu installs by default when creating a cluster and their respective namespaces, which allows us to identify the project that is installed in the cluster.

```bash
kubectl get node --all-namespaces

```text

And finally see the number of nodes that are involved in the cluster and their respective role, as can be seen in the previous image it is possible to see:

```text
kube-system   vsphere-csi-controller-8c9b98f7f-tt9p6                   5/5     Running   8          3h30m
kube-system   vsphere-csi-node-5k2fp                                   3/3     Running   0          3h17m
kube-system   vsphere-csi-node-5skv2                                   3/3     Running   3          3h11m
kube-system   vsphere-csi-node-g9dpn                                   3/3     Running   0          3h17m
kube-system   vsphere-csi-node-rptch                                   3/3     Running   3          3h30m
kube-system   vsphere-csi-node-vgn7s                                   3/3     Running   3          3h17m
kube-system   vsphere-csi-node-xg6mb                                   3/3     Running   3          3h17m

```bash

This indicates that the vSphere CSI driver is already installed, CSI is the acronym for Container Storage Interface:

https://github.com/kubernetes-sigs/vsphere-csi-driver

This driver is the essential piece for the integration of Kubernetes with vSphere as it allows you to create disks to assign them to the persistent volumes needed for the applications installed in the Tanzu cluster Kubernetes grid.

## storage class

Now one of the requirements of Kasten they are persistent disks and as we saw before, the cluster by default does not have any Storage Class enabled, therefore, the application that we install will not be able to create the volumes that it needs for its operation, for this we must execute on the machine that is administering TKG:

```bash
echo "
 kind: StorageClass
 apiVersion: storage.k8s.io/v1
 metadata:
   name: 24xs-vol
   annotations:
     storageclass.kubernetes.io/is-default-class: \"true\"
 provisioner: csi.vsphere.vmware.com
 parameters:
   DatastoreURL: "ds:///vmfs/volumes/5b00a1aa-6b210381-9411-54e1ad1b3bcd/"
   fstype: ext4
 " > 24xs-vol.yaml
 kubectl create -f 24xs-vol.yaml

```bash

where on the line **5** we can assign the name of the Storage Class, in the line **7** make sure the value is **true**” since with this we make sure that it is configured and enabled by default, line **8** we make sure that it is the vsphere csi driver, on the line **10** It is key to indicate the url of the Datastore that we will use as the destination of the persistent volumes in vSphere (in the following image you will see where to take the data from) and finally the name of the file to save it with its .yaml extension.


Veeam + Kasten — screenshot 4
Veeam + Kasten — screenshot 5
As we can see in the previous image, the first command shows us that we do not have any Storage Class in our Tanzu cluster and then we execute the file to generate the Storage Class that we can see with the command: ```bash kubectl get sc ```bash
Veeam + Kasten — screenshot 6
Now, if we check the monitoring of the DataStore that we selected to be the storage of our persistent volumes, we will see the following in vCenter:
Veeam + Kasten — screenshot 7
So now we have everything ready to install. Kasten k10 in its latest version 2.5.22. ## Installation of Kasten We will now review the prerequisites of Kasten that you can find them: https://docs.kasten.io/latest/install/requirements.html The first thing you need is to install helm, which is a package manager for easily installing applications: https://helm.sh The installation of helm is very simple, we just have to download the file from github and move it to the executable folder of the server that you are using to administer Tanzu Kubernetes Grid or TKG: ```bash wget https://get.helm.sh/helm-v3.3.4-linux-amd64.tar.gz ```json
Veeam + Kasten — screenshot 8
```bash tar xvzf helm-v3.3.4-linux-amd64.tar.gz ```json
Veeam + Kasten — screenshot 9
```text cd linux-amd64/ ```bash
Veeam + Kasten — screenshot 10
And finally we move it to the executable folder: ```bash mv helm /usr/local/bin/ ```bash
Veeam + Kasten — screenshot 11
if we execute the command helm version we will see the version of helm:
Veeam + Kasten — screenshot 12
As indicated in the manual Kasten, what we must do now is add the repository of Kasten in helm, with the following command: ```bash helm repo add kasten https://charts.kasten.io/ ```bash
Veeam + Kasten — screenshot 13
And then create the project name or namespace with the command: ```bash kubectl create namespace kasten-io ```bash
Veeam + Kasten — screenshot 14
Then we will proceed to the installation as indicated in: https://docs.kasten.io/latest/install/vmware/vsphere.html The first command to run is: ```bash helm install k10 kasten/k10 --namespace=kasten-io ```bash Which will show us:
Veeam + Kasten — screenshot 15
And then with the following command we can see the installation progress: ```bash kubectl get pods --namespace kasten-io --watch ```bash And we can see:
Veeam + Kasten — screenshot 16
We must ensure that all pods are in the “ **Running**” since with this we can then access the console of Kasten. If we review our Datastore that previously did not store persistent volumes and update we can see:
Veeam + Kasten — screenshot 17
Veeam + Kasten — screenshot 18
It will list the volumes used by Kasten for its correct operation. And we make sure again that all the pods are in their “Running” state:
Veeam + Kasten — screenshot 19
And we already have installed Kasten! ## Access to Kasten As we saw in a previous image, Kasten It indicated that to access the Dashboard we need to enter a command: ```bash kubectl --namespace kasten-io port-forward service/gateway 8080:8000 ```text And then enter the url: ```text http://127.0.0.1:8080/k10/#/. ```bash And obviously if you have GUI or Desktop installed in your Tanzu administration linux Kubernetes Grid you will be able to access. But what happens if I don't have GUI installed and I need to access it from the network via Web? There are different ways to access the Dashboard of Kasten, here we will see the simplest and fastest with Authentikation that you can even find in the manual of Kasten, in fact we will review the following links: https://docs.kasten.io/latest/access/dashboard.html#dashboard https://docs.kasten.io/latest/access/Authentikation.html#basic-auth ```bash https://hostingcanada.org/htpasswd-generator/ ```bash The first link tells us the multiple ways to enter the Dashboard, in this case we will use “ **Accessing via LoadBalancer**“, for this we will install “metallb” which is a balancer for k8s: https://metallb.universe.tf The installation is very simple, we must execute the following command: ```bash kubectl apply -f https://raw.githubusercontent.com/google/metallb/v0.8.3/manifests/metallb.yaml ```bash
Veeam + Kasten — screenshot 20
And it's already installed. Now we'll configure it with the IP address range we want it to work with: ```bash cat <<EOF | kubectl apply -f - apiVersion: v1 kind: ConfigMap metadata: namespace: metallb-system name: config data: config: | address-pools: - name: default protocol: layer2 # MetalLB IP Pool addresses: - 20.20.20.110-20.20.20.140 EOF ```bash On the line **15**, we must enter a pool of IP addresses to be assigned to the services we install. And we execute:
Veeam + Kasten — screenshot 21
After this we return to the configuration of Kasten, we must generate a password htpasswd, in the previous links there is a website that allows us to do it online:
Veeam + Kasten — screenshot 22
We copy the username and password and add it in the following command (If you copy and paste the encrypted password is 24xsiempre.com): ```bash helm upgrade k10 kasten/k10 --namespace=kasten-io \ --set auth.basicAuth.enabled=true \ --set auth.basicAuth.htpasswd='admin:$apr1$8zsf2361$V3BlxNRZsfbnUmDFM.XRa1' ```bash On the line **3**, you must copy your username and password generated on the web. Then we run:
Veeam + Kasten — screenshot 23
With the previous command we only configure the Authentikation mechanism, now with the following instruction we will indicate that it allows us to access through the gateway of Kasten and the balancer: ```bash helm upgrade k10 kasten/k10 --namespace=kasten-io \ --reuse-values \ --set externalGateway.create=true ```bash
Veeam + Kasten — screenshot 24
We saw that the message changed and Kasten Now it indicates that we must access the Dashboard via: ```bash The K10 Dashboard is accessible via a LoadBalancer. Find the service's EXTERNAL IP using: `kubectl get svc gateway-ext --namespace kasten-io -o wide` And use it in following URL `http://SERVICE_EXTERNAL_IP/k10/#/` ```bash Therefore, we only have to know the IP address to access, which we will obtain with the following command: ```bash kubectl get svc gateway-ext --namespace kasten-io -o wide
Veeam + Kasten — screenshot 25

**It should be noted that I have DHCP enabled in TKG**

In my case the access url will be http://kastentkg.24xsiempre.cl/k10/#/ since the IP address associates it with the DNS (If you do not directly access the IP of EXTERNAL-IP) and will request the previously configured username and password through the page that generates the htpasswd:

Veeam + Kasten — screenshot 26

And we will see the Welcome screen of Kasten, we enter company, mail and accept:

Veeam + Kasten — screenshot 27

configuration Kasten
#

we already have it working Kasten, with the possibility of remote access with username and password, now we only need to enable and configure the solution, an important message appears at the bottom of the Dashboard “ K10 Disaster Recovery is not enabled for this cluster. “

Veeam + Kasten — screenshot 28

We click on " see settings" where it will indicate that we must make some configurations before enabling Kasten:

Veeam + Kasten — screenshot 29

We click on " Room rental” and we will create a new profile, in this case Amazon s3:

Veeam + Kasten — screenshot 30

As can be seen, you can use different profiles to store the Containers, which can be:

  • Google Cloud Storage
  • Amazon S3
  • AzureStorage
  • S3 Supported

Enter the requested data and we will see the created profile:

Veeam + Kasten — screenshot 31

Then click on “ Infrastructure” and we will generate a profile for vSphere:

Veeam + Kasten — screenshot 32

Like the previous profile, we have different options:

  • OpenStack
  • front
  • portworx
  • vSphere

Now we click on “ K10 Disaster Recovery” and we will proceed to enable Kasten by clicking on " Enable K10 DR“, we select the profile of “ Location” and assign a password to encrypt the backups. Very important Save the password as you will need it for some recoveries

Veeam + Kasten — screenshot 33

And then if you want, you change the Dashboard theme in the “Dashboard” menu and we return to the beginning to configure Backup Policies:

Veeam + Kasten — screenshot 34

At the same time I installed a wordpress in its own namespace to see the backups of an additional application:

Veeam + Kasten — screenshot 35

When creating a new namespace, Kasten will automatically recognize it in the “ Applications” and will indicate that it is “ unmanaged” since it has no associated backup policy:

Veeam + Kasten — screenshot 36
Veeam + Kasten — screenshot 37

You can throw a Snapshot” directly from “ Applications“, perform restore tasks or “ Export” the Container you want.

Backup Policies
#

We will enter " Policies” and we will see a default policy of Kasten to protect yourself:

Veeam + Kasten — screenshot 38

Which, as a recommendation, we should not change since it will be running with its respective retention policy.

Veeam + Kasten — screenshot 39

Now we will click on “ Create New Policy” and we will enter the requested data:

Veeam + Kasten — screenshot 40
Veeam + Kasten — screenshot 41

Where we enter the name, comments and action, for the case of data protection we need to select “ Snapshot” and select the frequency of the snapshots and their respective retention. If you click on “ Show Advanced Frequency Options” you can select the execution time:

Veeam + Kasten — screenshot 42

Then if we wish, we can export the backups to the S3 bucket by enabling “ Backups via Snapshot Exports"

Veeam + Kasten — screenshot 43

Then we will select the application to back up, searching for it by “ Name” or if you want by “ Label” in this case I will select wordpress

Veeam + Kasten — screenshot 44

And finally we click on “ Create Policy"

Veeam + Kasten — screenshot 45

Now we can run the backup directly or wait for the schedule. I will run it to view the backup by clicking “ run eleven"

Veeam + Kasten — screenshot 46

And we will return to the Dashboard to see the status of the backup:

Veeam + Kasten — screenshot 47

We will also see snapshot executions in vCenter:

Veeam + Kasten — screenshot 48

We will also see all the executions that we configured in the policy:

Veeam + Kasten — screenshot 49

And we are already endorsing our Tanzu Kubernetes grid with Kasten!

Recovery Containers with Kasten
#

If we click on “ Applications” we will see our successful backup policy for wordpress:

Veeam + Kasten — screenshot 50

At the bottom of the policy you will see a button “ Restore” will show us the restore points we have:

Veeam + Kasten — screenshot 51

And if we click on the restore point:

Veeam + Kasten — screenshot 52

It will allow us to choose where you want to recover from, either from s3 or from the local snapshot, in this case I will select the local one:

Veeam + Kasten — screenshot 53

To confirm:

Veeam + Kasten — screenshot 54

And finally we return to the Dashboard to see the status:

Veeam + Kasten — screenshot 55

And we can see the successful recovery:

Veeam + Kasten — screenshot 56

There are multiple recovery options that must be analyzed according to the need, but as we saw the backup is simple, the detection of namespaces does it automatically and it is very easy to configure backup policies, in the following link you have the details of all the recovery options:

https://docs.kasten.io/latest/usage/restore.html

And with that we end this guide to use Kasten! Any idea is welcome as always!

Related posts#