Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Application Mobility Documentation #318

Merged
merged 13 commits into from
Aug 19, 2022
3 changes: 2 additions & 1 deletion content/docs/_index.md
Original file line number Diff line number Diff line change
Expand Up @@ -64,4 +64,5 @@ CSM is made up of multiple components including modules (enterprise capabilities
| Observability v1.2| ✔️ | ❌ | ✔️ | ❌ | ❌ |
| Replication v1.3| ❌ | ✔️ | ✔️ | ✔️ | ❌ |
| Resiliency v1.2| ✔️ | ✔️ | ❌ | ❌ | ✔️ |
| Encryption v0.1.0| ❌ | ✔️ | ❌ | ❌ | ❌ |
| Encryption v0.1.0| ❌ | ✔️ | ❌ | ❌ | ❌ |
| Application Mobility v0.1.0| ✔️ | ✔️ | ✔️ | ✔️ | ✔️ |
40 changes: 40 additions & 0 deletions content/docs/application-mobility/_index.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
---
title: "Application Mobility"
linkTitle: "Application Mobility"
weight: 9
Description: >
Application Mobility for Dell Container Storage Modules (CSM)
tdawe marked this conversation as resolved.
Show resolved Hide resolved
---

>> NOTE: This tech-preview release is not intended for use in production environment.

>> NOTE: Application Mobility requires a time-based license. See [Deployment](./deployment) for instructions.

Container Storage Modules for Application Mobility provide Kubernetes administrators the ability to clone their stateful application workloads and application data to other clusters, either on-premise or in the cloud.

Application Mobility uses [Velero](https://velero.io) and its integration of [Restic](https://restic.net) to copy both application metadata and data to object storage. When a backup is requested, Application Mobility uses these options to determine how the application data is backed up:
- If [Volume Group Snapshots](../snapshots/volume-group-snapshots/) are enabled on the CSI driver backing the application's Persistent Volumes, crash consistent snapshots of all volumes are used for the backup.
- If [Volume Snapshots](../snapshots/) are enabled on the Kubernetes cluster and supported by the CSI driver, individual snapshots are used for each Persistent Volume used by the application.
- If no snapshot options are enabled, default to using full copies of each Persistent Volume used by the application.

After a backup has been created, it can be restored on the same Kubernetes cluster or any other cluster(s) if this criteria is met:
- Application Mobility is installed on the target cluster(s).
- The target cluster(s) has access to the object store bucket. For example, if backing up and restoring an application from an on-premise Kubernetes cluster to AWS EKS, an S3 bucket can be used if both the on-premise and EKS cluster have access to it.
- Storage Class is defined on the target cluster(s) to support creating the required Persistent Volumes used by the application.

## Supported Data Movers
{{<table "table table-striped table-bordered table-sm">}}
| Data Mover | Description |
|-|-|
| Restic | Persistent Volume data will be stored in the provided object store bucket |
{{</table>}}

## Supported Operating Systems/Container Orchestrator Platforms
{{<table "table table-striped table-bordered table-sm">}}
| COP/OS | Supported Versions |
|-|-|
| Kubernetes | 1.23, 1.24 |
| Red Hat OpenShift | 4.10 |
| RHEL | 7.x, 8.x |
| CentOS | 7.8, 7.9 |
{{</table>}}
62 changes: 62 additions & 0 deletions content/docs/application-mobility/deployment.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
---
title: "Deployment"
linkTitle: "Deployment"
weight: 1
Description: >
Deployment for Dell Container Storage Modules (CSM) for Application Mobility
---

## Pre-requisites
- [Request a License for Application Mobility](../../license/)
- Object store bucket accessible by both the source and target clusters

## Installation
1. Create a namespace where Application Mobility will be installed.
```
kubectl create ns application-mobility
```
1. Edit the license Secret file (see Pre-requisites above) and set the correct namespace (ex: `namespace: application-mobility`)
1. Create the Secret containing a license file
```
kubectl apply -f license.yml
```
1. Add the Dell Helm Charts repository
```
helm repo add dell https://dell.github.io/helm-charts
```
1. Either create a values.yml file or provide the `--set` options to the `helm install` to override default values from the [Configuration](#configuration) section.
1. Install the helm chart
```
helm install application-mobility -n application-mobility dell/csm-application-mobility
```


### Configuration

This table lists the configurable parameters of the Application Mobility Helm chart and their default values.

| Parameter | Description | Default |
| - | - | - |
| `replicaCount` | Number of replicas for the Application Mobility controllers | `1` |
| `image.pullPolicy` | Image pull policy for the Application Mobility controller images | `IfNotPresent` |
| `controller.image` | Location of the csm-application-mobility Docker image | `dell/csm-application-mobility-controller:v0.1.0` |
| `cert-manager.enabled` | If set to true, cert-manager will be installed during Application Mobility installation | `false` |
| `veleroNamespace` | If Velero is already installed, set to the namespace where Velero is insatlled | `velero` |
| `licenseName` | Name of the Secret that contains the License for CSM Application Mobility | `license` |
| `objectstore.secretName` | If velero is already installed on the cluster, specify the name of the secret in velero namespace that has credentials to access object store | ` ` |
tdawe marked this conversation as resolved.
Show resolved Hide resolved
| `velero.enabled` | If set to true, Velero will be installed during Application Mobility installation | `true` |
| `velero.use-volume-snapshots` | If set to true, Velero will use volume snapshots | `false` |
| `velero.deployRestic` | If set to true, Velero will also deploy Restic | `true` |
| `velero.cleanUpCRDs` | If set to true, Velero CRDs will be cleaned up | `true` |
| `velero.credentials.existingSecret` | Optionally, specify the name of the pre-created secret in the release namespace that holds the object store credentials. Either this or secretContents should be specified | ` ` |
| `velero.credentials.name` | Optionally, specify the name to be used for secret that will be created to hold object store credentials. Used in conjunction with secretContents. | ` ` |
| `velero.credentials.secretContents` | Optionally, specify the object store access credentials to be stored in a secret with key "cloud". Either this or existingSecret should be provided. | ` ` |
| `velero.configuration.provider` | Provider to use for Velero. | `aws` |
| `velero.configuration.backupStorageLocation.name` | Name of the backup storage location for Velero. | `default` |
| `velero.configuration.backupStorageLocation.bucket` | Name of the object store bucket to use for backups. | `velero-bucket` |
| `velero.configuration.backupStorageLocation.config` | Additional provider-specific configuration. See https://velero.io/docs/v1.9/api-types/backupstoragelocation/ for specific details. | ` ` |
| `velero.initContainers` | List of plugins used by Velero. Dell Velero plugin is required and plugins for other providers can be added. | ` ` |
| `velero.initContainers[0].name` | Name of the Dell Velero plugin. | `dell-custom-velero-plugin` |
| `velero.initContainers[0].image` | Location of the Dell Velero plugin image. | `dellemc/csm-application-mobility-velero-plugin:v0.1.0` |
| `velero.initContainers[0].volumeMounts[0].mountPath` | Mount path of the volume mount. | `/target` |
| `velero.initContainers[0].volumeMounts[0].name` | Name of the volume mount. | `plugins` |
48 changes: 48 additions & 0 deletions content/docs/application-mobility/troubleshooting.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
---
title: "Troubleshooting"
linkTitle: "Troubleshooting"
weight: 4
Description: >
Troubleshooting guide
tdawe marked this conversation as resolved.
Show resolved Hide resolved
---

## Frequently Asked Questions
1. [How can I diagnose an issue with Container Storage Modules (CSM) for Application Mobility?](#how-can-i-diagnose-an-issue-with-csm-for-observability)
2. [How can I view logs?](#how-can-i-view-logs)
3. [How can I debug and troubleshoot issues with Kubernetes?](#how-can-i-debug-and-troubleshoot-issues-with-kubernetes)
4. [Why are there error logs about a license?](#why-are-there-error-logs-about-a-license)

### How can I diagnose an issue with CSM for Application Mobility?

Once you have attempted to install CSM for Application Mobility to your Kubernetes or OpenShift cluster, the first step in troubleshooting is locating the problem.

Get information on the state of your Pods.
```console
kubectl get pods -n $namespace
```
Get verbose output of the current state of a Pod.
```console
kubectl describe pod -n $namespace $pod
```
### How can I view logs?

View pod container logs. Output logs to a file for further debugging.
```console
kubectl logs -n $namespace $pod $container
kubectl logs -n $namespace $pod $container > $logFileName
```

### How can I debug and troubleshoot issues with Kubernetes?

* To debug your application that may not be behaving correctly, please reference Kubernetes [troubleshooting applications guide](https://kubernetes.io/docs/tasks/debug-application-cluster/debug-application/).

* For tips on debugging your cluster, please see this [troubleshooting guide](https://kubernetes.io/docs/tasks/debug-application-cluster/debug-cluster/).

### Why are there error logs about a license?

Application Mobility requires a license in order to function. See the [Deployment](../deployment) instructions for steps to request a license.

There will be errors in the logs about the license for these cases:
- License does not exist
- License is not valid for the current Kubernetes cluster
- License has expired
17 changes: 17 additions & 0 deletions content/docs/application-mobility/uninstallation.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
---
title: Uninstallation
linktitle: Uninstallation
weight: 2
description: >
Uninstallation for Dell Container Storage Modules (CSM) for Application Mobility
---

This section outlines the uninstallation steps for Container Storage Modules (CSM) for Application Mobility.

## Uninstall the CSM for Application Mobility Helm Chart

This command removes all the Kubernetes components associated with the chart.

```
$ helm delete [APPLICATION_MOBILITY_NAME] --namespace [APPLICATION_MOBILITY_NAMESPACE]
```
73 changes: 73 additions & 0 deletions content/docs/application-mobility/use_cases.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,73 @@
---
title: "Use Cases"
linkTitle: "Use Cases"
weight: 3
Description: >
Use cases for Dell Container Storage Modules (CSM) for Application Mobility
---

After Application Mobility is installed, the [dellctl CLI](../../cli/) can be used to register clusters and manage backups and restores of applications.

## Backup and Restore an Application
This example details the steps when an application in namespace `demo1` is being backed up and then later restored to either the same cluster or another cluster. In this sample, both Application Mobility and Velero are installed in the `application-mobility` namespace.

1. If Velero is not installed in the default `velero` namespace, set this environment variable to the namespace where it is installed:
```
export VELERO_NAMESPACE=application-mobility
```
1. On the source cluster, create a Backup by providing a name and the included namespace where the application is installed. The application and its data will be available in the object store bucket and can be restored at a later time.
```
dellctl backup create backup1 --include-namespaces demo1 --namespace application-mobility
```
1. Monitor the backup status until it is marked as Completed.
```
dellctl backup get --namespace application-mobility
```
1. If the Storage Class name on the target cluster is different than the Storage Class name on the source cluster where the backup was created, a mapping between source and target Storage Class names must be defined. See [Changing PV/PVC Storage Classes](#changing-pvpvc-storage-classes).
1. The application and its data can be restored on either the same cluster or another cluster by referring to the backup name and providing an optional mapping of the original namespace to the target namespace.
```
dellctl restore create restore1 --from-backup backup1 \
--namespace-mappings "demo1:restorens1" --namespace application-mobility
```
1. Monitor the restore status until it is marked as Completed.
```
dellctl restore get --namespace application-mobility
```

## Clone an Application
This example details the steps when an application in namespace `demo1` is cloned from a source cluster to a target cluster in a single operation. In this sample, both Application Mobility and Velero are installed in the `application-mobility` namespace.

1. If Velero is not installed in the default `velero` namespace, set this environment variable to the namespace where it is installed:
```
export VELERO_NAMESPACE=application-mobility
```
1. Register both the source and target clusters
```
dellctl cluster add -n cluster1 -f ~/kubeconfigs/cluster1-kubeconfig
dellctl cluster add -n cluster2 -f ~/kubeconfigs/cluster2-kubeconfig
```
1. If the Storage Class name on the target cluster is different than the Storage Class name on the source cluster where the backup was created, a mapping between source and target Storage Class names must be defined. See [Changing PV/PVC Storage Classes](#changing-pvpvc-storage-classes).
1. Create a Backup by providing a name, the included namespace where the application is installed, the source cluster, and the target cluster and namespace mapping where the application will be restored.
```
dellctl backup create backup1 --include-namespaces demo1 --cluster-id cluster1 \
tdawe marked this conversation as resolved.
Show resolved Hide resolved
--clones "cluster2/demo1:restore-ns2" --namespace application-mobility
```
1. Monitor the backup status until it is marked as Completed.
```
dellctl backup get --namespace application-mobility
```

## Changing PV/PVC Storage Classes
Create a ConfigMap on the target cluster in the same namespace where Application Mobility is installed. The data field must contain a mapping of source Storage Class name to target Storage Class name. See Velero's documentation for [Changing PV/PVC Storage Classes](https://velero.io/docs/v1.9/restore-reference/#changing-pvpvc-storage-classes) for additional details.
```
apiVersion: v1
kind: ConfigMap
metadata:
name: change-storage-class-config
namespace: <application-mobility-namespace>
labels:
velero.io/plugin-config: ""
velero.io/change-storage-class: RestoreItemAction
data:
<source-storage-class-name>: <target-storage-class-name>
```