Installing and configuring Kasten to protect container workloads on VMware Tanzu Kubernetes Grid
Tags: kubernetes, vmware, backup, kasten
Published: 2021-05-25 23:32:24

---
title: Installing and configuring Kasten to protect container workloads on VMware Tanzu Kubernetes Grid
published: true
date: 2021-05-24 18:52:19 UTC
tags: Kubernetes,VMware,backup,Kasten
canonical_url: https://veducate.co.uk/kasten-tanzu/?utm_source=rss&utm_medium=rss&utm_campaign=kasten-tanzu
---

This blog post will take you through the full steps on installing and configuring Kasten, the container based enterprise backup software now owned by Veeam Software

This deployment will be for VMware Tanzu Kubernetes Grid which is running on top of VMware vSphere.

You can read how to create backup policies and restore your data in [this blog post.](https://veducate.co.uk/kasten-backup-restore/)

For the data protection demo, I’ll be using my trusty Pac-Man application that has data persistence using MongoDB.

###### Installing Kasten on Tanzu Kubernetes Grid

In this guide, I am going to use Helm, you can learn [how to install it here](https://helm.sh/docs/intro/install/).

Add the Kasten Helm charts repo.

```
helm repo add kasten https://charts.kasten.io/
```

Create a Kubernetes namespace called “kasten-io”

```
kubectl create namespace kasten-io
```

[![kubectl create namespace kasten-io](https://i1.wp.com/veducate.co.uk/wp-content/uploads/2021/02/kubectl-create-namespace-kasten-io-.png?resize=604%2C24&ssl=1)](https://i1.wp.com/veducate.co.uk/wp-content/uploads/2021/02/kubectl-create-namespace-kasten-io-.png?ssl=1)

Next we are going to use Helm to install the Kasten software into our Tanzu Kubernetes Grid cluster.

```
helm install k10 kasten/k10 --namespace=kasten-io \
--set externalGateway.create=true \ --set auth.tokenAuth.enabled=true \--set global.persistence.storageClass=<storage-class-name>
```

Breaking down the command arguments;

- –set externalGateway.crete=true
  - This creates an [external service](https://docs.kasten.io/latest/access/dashboard.html#accessing-via-a-loadbalancer) to use ServiceType=LoadBalancer to allow external access to the Kasten K10 Dashboard outside of your cluster.
- –set auth.tokenAuth.enabled=true
  - This sets the [authentication type](https://docs.kasten.io/latest/install/openshift/openshift.html#authentication) of the Kasten Dashboard.
- –set global.persistence.storageClass=<storage-class-name>
  - This sets the storage class to be used for the PV/PVCs to be created for the Kasten install. (In a TKG guest cluster there may not be a [default storage class.](https://anthonyspiteri.net/tanzu-no-default-storageclass/))

You will be presented an output similar to the below.

```
NAME: k10
LAST DEPLOYED: Fri Feb 26 01:17:55 2021
NAMESPACE: kasten-io
STATUS: deployed
REVISION: 1
TEST SUITE: None
NOTES:
Thank you for installing Kasten’s K10 Data Management Platform!

Documentation can be found at https://docs.kasten.io/.

How to access the K10 Dashboard:

The K10 dashboard is not exposed externally. To establish a connection to it use the following

`kubectl --namespace kasten-io port-forward service/gateway 8080:8000`

The Kasten dashboard will be available at: `http://127.0.0.1:8080/k10/#/`

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/#/`
```

It will take a few minutes for your pods to be running, you can review with the following command;

```
kubectl get pods -n kasten-io
```

[![ kubectl get pods -n kasten-io](https://i0.wp.com/veducate.co.uk/wp-content/uploads/2021/02/kubectl-get-pods-n-kasten-io-.png?resize=604%2C230&ssl=1)](https://i0.wp.com/veducate.co.uk/wp-content/uploads/2021/02/kubectl-get-pods-n-kasten-io-.png?ssl=1)

Next we need to get our LoadBalancer IP address for the External Web Front End, so that we can connect to the Kasten K10 Dashboard.

```
kubectl get svc -n kasten-io
```

[![kubectl get svc -n kasten-io](https://i2.wp.com/veducate.co.uk/wp-content/uploads/2021/02/kubectl-get-svc-n-kasten-io.png?resize=604%2C116&ssl=1)](https://i2.wp.com/veducate.co.uk/wp-content/uploads/2021/02/kubectl-get-svc-n-kasten-io.png?ssl=1)

If you don’t have a load-balancer available, then you can use the “kubectl port-forward” options, as described in the install output from helm.

Before we browse to our FQDN we also need to get the token from our user to access the environmment. For this example I am going to use the default user “k10-k10”, which has full administrator privileges to Kasten. You have the ability to create a new user with the correct level of access also, [see here](https://docs.kasten.io/latest/access/authentication.html#obtaining-tokens).

```
sa_secret=$(kubectl get serviceaccount k10-k10 -o jsonpath="{.secrets[0].name}" --namespace kasten-io)

kubectl get secret $sa_secret --namespace kasten-io -ojsonpath="{.data.token}{'\n'}" | base64 --decode
```

The first command passes our secret into a variable, which is reference in the second command.

Extract your token as per the below.

```
# sa_secret=$(kubectl get serviceaccount k10-k10 -o jsonpath="{.secrets[0].name}" --namespace kasten-io)

# kubectl get secret $sa_secret --namespace kasten-io -ojsonpath="{.data.token}{'\n'}" | base64 --decode

eyJhbGciOiJSUzI1NiIsImtpZCI6IjlPQy1MZUhMa3BaVXNoS29Wc1dqWVA0LXRIN3BOUHp5ZWFqRVd6SXlOVW8ifQ.eyJpc3MiOiJrdWJlcm5ldGVzL3NlcnZpY2VhY2NvdW50Iiwia3ViZXJuZXRlcy5pby9zZXJ2aWNlYWNjb3VudC9uYW1lc3BhY2UiOiJrYXN0ZW4taW8iLCJrdWJlcm5ldGVzLmlvL3NlcnZpY2VhY2NvdW50L3NlY3JldC5uYW1lIjoia
.....
aPRjztGna0cTK8OwwUYYAxqKXWrQOactAbsFQ7fi0bR-9Uiywta3gCfbXh7EkJShVpakpRQTcWppmqczRg_dqVtBvQeBnAWlhCpd7bC58LXS_Yd3Geciq4OZg 

#
```

[![kubectl get secret](https://i2.wp.com/veducate.co.uk/wp-content/uploads/2021/02/kubectl-get-secret-.png?resize=604%2C185&ssl=1)](https://i2.wp.com/veducate.co.uk/wp-content/uploads/2021/02/kubectl-get-secret-.png?ssl=1)

Login to your Kasten K10 Dashboard using the token.

- http://{LB\_IPaddr}/k10

[![Kasten K10 - Log in to dashboard with token](https://i0.wp.com/veducate.co.uk/wp-content/uploads/2021/02/Kasten-K10-Log-in-to-dashboard-with-token.png?resize=604%2C456&ssl=1)](https://i0.wp.com/veducate.co.uk/wp-content/uploads/2021/02/Kasten-K10-Log-in-to-dashboard-with-token.png?ssl=1)

Accept the EULA.

[![Kasten K10 - Accept the EULA](https://i1.wp.com/veducate.co.uk/wp-content/uploads/2021/02/Kasten-K10-Accept-the-EULA.png?resize=604%2C383&ssl=1)](https://i1.wp.com/veducate.co.uk/wp-content/uploads/2021/02/Kasten-K10-Accept-the-EULA.png?ssl=1)

###### Configuring Kasten to integrate with VMware vSphere

Currently the [VMware CSI Driver](https://vsphere-csi-driver.sigs.k8s.io) does not support snapshot first class disks (FCD) at the Kubernetes layer. However Kasten can snapshot the FCD by using its integration into vSphere by calling the vCenter API. To enable this capability we need to configure an [infrastructure profile](https://docs.kasten.io/latest/install/storage.html#vsphere).

1. Click the “Settings” link in the top right-hand corner of the dashboard.
2. Click the Infrastructure tab on the left-hand side menu.
3. Click New Profile button.

[![Kasten Create infrastructure profile](https://i2.wp.com/veducate.co.uk/wp-content/uploads/2020/11/Kasten-Create-infrastructure-profile.png?resize=604%2C242&ssl=1)](https://i2.wp.com/veducate.co.uk/wp-content/uploads/2020/11/Kasten-Create-infrastructure-profile.png?ssl=1)

This will open up a configuration pane on the right-hand side of the dashboard.

- Provide a profile name
- Provide your vCenter Server details and authentication details
- Click validate and save once done.

[![Kasten Create infrastructure profile vSphere](https://i1.wp.com/veducate.co.uk/wp-content/uploads/2020/11/Kasten-Create-infrastructure-profile-vSphere.png?resize=439%2C919&ssl=1)](https://i1.wp.com/veducate.co.uk/wp-content/uploads/2020/11/Kasten-Create-infrastructure-profile-vSphere.png?ssl=1)

Once saved, you will be taken back to the dashboard and shown a successful notification pop-up.

[![Kasten - Create infrastructure profile - vSphere - profile created](https://i0.wp.com/veducate.co.uk/wp-content/uploads/2020/11/Kasten-Create-infrastructure-profile-vSphere-profile-created.png?resize=604%2C344&ssl=1)](https://i0.wp.com/veducate.co.uk/wp-content/uploads/2020/11/Kasten-Create-infrastructure-profile-vSphere-profile-created.png?ssl=1)

###### Create a location profile to enable backup storage

We will now create a [location profile](https://docs.kasten.io/latest/usage/configuration.html#location-profile).

Kasten out of the box will create a snapshot that resides with the Kubernetes cluster, however to provide a complete backup of your data, a location profile provides Kasten and the protection policies access to external object storage or [external NFS file storage (tech preview)](https://docs.kasten.io/latest/usage/configuration.html#nfs-file-storage-location).

1. Select the Settings Link (click in the top right hand corner if needed).
2. Click the Locations Tab.
3. Click the New Profile button.

[![Kasten - Create Location profile](https://i0.wp.com/veducate.co.uk/wp-content/uploads/2020/11/Kasten-Create-Location-profile-.png?resize=604%2C278&ssl=1)](https://i0.wp.com/veducate.co.uk/wp-content/uploads/2020/11/Kasten-Create-Location-profile-.png?ssl=1)

A dialog box will appear on the right-hand side of the dashboard interface.

Select your Cloud Storage Provider of choice and enter the necessary details. Click validate and save.

[![Kasten - Create Location profile - azure](https://i0.wp.com/veducate.co.uk/wp-content/uploads/2020/11/Kasten-Create-Location-profile-azure.png?resize=441%2C935&ssl=1)](https://i0.wp.com/veducate.co.uk/wp-content/uploads/2020/11/Kasten-Create-Location-profile-azure.png?ssl=1)

You will then see a Profile Created message if this is successful.

[![Kasten Create Location profile azure profile created](https://i1.wp.com/veducate.co.uk/wp-content/uploads/2020/11/Kasten-Create-Location-profile-azure-profile-created.png?resize=604%2C344&ssl=1)](https://i1.wp.com/veducate.co.uk/wp-content/uploads/2020/11/Kasten-Create-Location-profile-azure-profile-created.png?ssl=1)

###### Creating Backup Policies, protecting and restoring your data

Now we have deployed our Kasten environment to our VMware Tanzu Kubernetes platform, and setting up the base configuration, we move onto the next phase:

- [How to create protection policies, backup your data and restore your data.](https://veducate.co.uk/kasten-backup-restore)

Regards

[Follow @Saintdle](https://twitter.com/saintdle)<script async src="https://platform.twitter.com/widgets.js" charset="utf-8"></script>

[Dean Lewis](https://uk.linkedin.com/in/saintdle?trk=profile-badge)

The post [Installing and configuring Kasten to protect container workloads on VMware Tanzu Kubernetes Grid](https://veducate.co.uk/kasten-tanzu/) appeared first on [vEducate.co.uk](https://veducate.co.uk).