Getting Started
This section discusses how to get jump-started with Trilio for Kubernetes in a customer environment
Deprecated Documentation
This document is deprecated and no longer supported. For accurate, up-to-date information, please refer to the documentation for the latest version of Trilio.
Getting Started
Overview
In order to get started with Trilio for Kubernetes in your environment, the following steps are needed:
Install Test CSI Driver - Leverage the test hostpath driver, if your environment doesn't support one with Snapshot capability today.
Software Access and Installation - Access software and install it based on specific directions for your environment.
License - Leverage the free or basic license (if not using an Enterprise) following instructions from the licensing page.
Run Example
Follow the steps to create a target, sample applications and backup/restore the applications.
Replace CSI Driver - If leveraging the hostpath CSI driver, replace it with your Enterprise-grade CSI driver.
Install CSI Driver
Skip this step if your environment already has a CSI driver installed with snapshot capability.
Follow the instructions provided in Appendix HostPath for T4K to install the Hostpath CSI driver. The proper functioning of the software will be determined by running an example with the hostpath driver.
Software Access and Installation
Please refer to the Installing Trilio section to install Trilio for Kubernetes in your environment.
Run Example
The following section will cover installing of a test CSI driver, creating a sample application and backup/restore of it via labels, Helm and Operator.
If your environment already has a CSI driver (supporting snapshots) installed, storage class and volumesnapshotclass configured, then you can skip to Create a Sample Application section below. If not, then follow the steps below to install the hostpath driver temporarily to test Trilio for Kubernetes till you have a CSI driver that supports snapshot, at which point you can migrate to the new CSI driver.
More details around CRDs and their usage/explanation can be found in the Custom Resource Definition Section.
Create a Target
Create a secret containing the credentials for data stores to store backups.
Please use one of the Target examples provided in the Custom Resource Definition section as a template for creating a NFS, Amazon S3, or any S3 compatible storage target. An Amazon S3 target example is provided below as well.
Create a Policy
Below is a backup cleanup policy. Users can define the amount of time after which backups should be deleted.
The following example defines Policy to delete snapshots of last 30 days.
Policy is not available as part of 1.0.0 release. Backups must be deleted manually.
Label Example
The following sections will create a sample application (tagged it with labels), backup the application via labels and then restore the application.
The following steps will be performed.
Create a sample MySQL application
Create a BackupPlan CR that specifies the mysql application to protect via labels
Create a Backup CR with a reference to the BackupPlan CR
Create a Restore CR with a reference to the Backup CR.
Create a Sample Application
Create the following file as mysql.yaml. Note the labels used to tag the different components of the application.
Create a BackupPlan
Create a BackupPlan CR that references the application created in the previous step via matching labels.
Create a Backup
Create a Backup CR to protect the BackupPlan. Type
of the backup can be either full or incremental.
Note: The first backup into a target location will always be a Full backup.
Restore the Backup/Application
Finally use the Restore CR to restore the Backup. In the example provided below, mysql-label-backup is being restored into the "default" namespace.
Note: If restoring into the same namespace, ensure that the original application components have been removed.
Note: If restoring to another cluster (migration scenario), ensure that Trilio for Kubernetes is running in the remote namespace/cluster as well. To restore into a new cluster (where the Backup CR does not exist), source.type
must be set to location. Please refer to the Custom Resource Definition Restore Section to view a restore by location example.
Helm Example
The following sections will create a sample application via Helm, backup the application via Helm selector fields and then restore the application.
The following steps will be performed.
Create a cockroachdb instance using Helm
Create a BackupPlan CR that specifies the cockroachdb application to protect.
Create a Backup CR with a reference to the BackupPlan CR
Create a Restore CR with a reference to the Backup CR.
Create a sample application via Helm
In this example, we will use Helm Tooling to create a "cockroachdb" application.
Run the following commands against a Kubernetes cluster. Use the attached cockroachdb_-values.yaml_ file for the installation by copying it to your local directory.
After running helm install, confirm the installation was successful by running helm ls
Create a BackupPlan
Use the following to create a BackupPlan. Ensure the name of the release you specify matches the output from the helm ls command in the previous step.
Create a Backup
Use the following content to create a backup CR.
Restore Backup/Application
After the backup has completed successfully, create a Restore CR to restore the application.
Before restoring the app, we need to clean the existing app. This is required cluster level resources of the app can create conflict during restore operation.
Similar to the Label example above:
Note: If restoring into the same namespace, ensure that the original application components have been removed. Especially the PVC of application are deleted.
Note: If restoring to another cluster (migration scenario), ensure that Trilio for Kubernetes is running in the remote namespace/cluster as well. To restore into a new cluster (where the Backup CR does not exist), source.type
must be set to location. Please refer to the Custom Resource Definition Restore Section to view a restore by location example.
Operator Example
The following steps will be performed.
Install a sample etcd Operator
Create a etcd cluster
Create a BackupPlan CR that specifies the etcd application to protect.
Create a Backup CR with a reference to the BackupPlan CR
Create a Restore CR with a reference to the Backup CR.
We are demonstrating standard 'etcd-operator' here. First we need to deploy the operator using it's helm chart. Then we need to deploy etcd cluster. Following are the commands for it.
Install etcd-operator
Create an etcd cluster using following yaml definition
Create a BackupPlan
Create 'BackupPlan' resource to protect 'etcd-operator' and it's clusters. Use the following yaml definition.
'operatorResourceName': This field holds the name of the operator whose backup we are going to take. In this case our operator name is "demo-etcd-cluster"
'operatorResourceSelector': This field selects the operator resources (whose backup we are going to take) using labels. In this case, operator is 'etcd-operator' and all it's resources like pods, services, deployments have a unique label - "release: trilio-demo-etcd-operator"
'applicationResourceSelector': This field selects the resources of the application launched using the operator. In this case, etcd-cluster is the application launched using etcd-operator. All the resources of this application have a unique label - "app: etcd"
Create a Backup
Take a backup of above 'BackupPlan'. Use following YAML definition to create a 'Backup' resource.
Restore the Backup/Application
After the backup completes successfully, you can perform the Restore of it.
To restore the etcd-operator and it's clusters from the above backup taken use the following yaml definition.
Note: If restoring into the same namespace, ensure that the original application components have been removed.
Note: If restoring to another cluster (migration scenario), ensure that Trilio for Kubernetes is running in the remote namespace/cluster as well. To restore into a new cluster (where the Backup CR does not exist), source.type
must be set to location. Please refer to the Custom Resource Definition Restore Section to view a restore by location example.
Replace Hostpath CSI Driver with Enterprise CSI Driver
If you have an Enterprise CSI driver available, you can replace the driver in the StorageClass and VolumeSnapshotClass to point to your Enterprise CSI driver. Please review the CSI Driver Appendix page to view the different CSI drivers that are available today with quick links to install popular CSI drivers.
If you do not have an Enterprise CSI driver with Snapshot support, continue using the Hostpath CSI Driver for evaluating Trilio for Kubernetes.
When replacing drivers ensure the correct schema, as per the API version that the Enterprise driver supports, is used.
Last updated