This topic describes how to install and run EZswitch in Storage Autoscaling.
Prerequisites
Kompass Storage deployed and configured (as described in Deploy Storage Autoscaling)
Kubernetes v1.24 or later
cluster-admin permissions to deploy and manage the EZswitch controller and related CRDs
Install and start EZswitch
You can install and start EZswitch in either of these ways:
Automatically: This single command method, using the kubectl-zesty plugin is best for quick, streamlined migrations.
Manually: This method provides more control, allowing you to version-control your EZswitch resources, integrate with GitOps tools (like Argo CD), and fine-tune the migration process before starting.
Automatically install and start EZswitch
The kubectl-zesty plugin provides a streamlined command-line interface for EZswitch operations.
When using the plugin, it will:
Install the zesty-ezswitch-helm chart automatically.
Create and manage the required EZswitch custom resource.
Provide easy access to migration status and controls.
Prerequisites
The latest version of the Kubectl-zesty plugin is installed.
To install the plugin, see To install the Zesty Kubectl plugin.
To update the currently-installed plugin to the latest version, run the following command:kubectl krew update zesty
To install and start EZswitch automatically:
Install and start EZswitch by running the following command:
kubectl zesty ezswitch start <stsName> [--autoMigrate=<true|false>] [--helm-namespace=<namespace>] [--set key=value ...]
Example:
kubectl zesty ezswitch start myapp-sts --autoMigrate=false --set logLevel=4
To see all available fields, see https://github.com/zesty-co/zesty-ezswitch-helm
By default, EZswitch resources are installed in the zesty-ezswitch namespace. To override the default, use the
--helm-namespace
option, as described in EZswitch Command reference.Manually install and start EZswitch
Use this method for direct Helm management (such as GitOps workflows) or if you don't want to use the kubectl-zesty plugin.
To install and start EZswitch manually:
Add (or update) the zesty repository to your namespace:
To add the repository:
helm repo add zestyezswitchrepo https://zesty-co.github.io/zesty-ezswitch-helm
If the repository is already configured, update it:
helm repo update
Install the EZswitch Helm chart:
helm install zesty-ezswitch [-n <NAMESPACE>] zestyezswitchrepo/ezswitch
Note For a description of additional Helm settings, see XXhelm-chart-valuesXXX
Create the EZswitch custom resource.
Create a YAML file (for example, ezswitch-resource.yaml) that includes your EZswitch configurations as outlined in the EZswitch custom resource.
Example:apiVersion: storage.zesty.co/v1alpha1 kind: EZswitch metadata: name: myapp-sts-ezswitch namespace: default # Namespace should match stsNamespace spec: stsName: myapp-sts # Name of source statefulset to be migrated stsNamespace: default # Namespace of source statefulset autoMigrate: true # Sets migration process to migrate as soon as all data is copied zestyStsName: myapp-sts-zesty # Name of target statefulset to migrate into
Setting
autoMigrate: true
will run the migration automatically from start to finish. SettingautoMigrate: false
allows you to manually control when to proceed between migration phases. See the full CR options in the section EZswitch custom resource.Apply the EZswitch custom resource, by running the following command:
kubectl apply -f ezswitch-resource.yaml
When the resource is applied, the migration will start running.
Note: Deleting the EZswitch resource during an ongoing migration will trigger a rollback, undoing all changes made so far. For the rollback to function correctly, the original StatefulSet must still be present. To remove the created resources in a more graceful way, use the delete command: kubectl delete ezswitch <ezswitch-name>
Clean up by removing resources that are no longer needed, by running the following command:
helm uninstall zesty-ezswitch [--helm-namespace <NAMESPACE>]
Helm chart values
Key | Default | Description |
logLevel | 6 | Log level for the ezswitch-controller |
controller.image | zd/k8s/ezswitch-controller | The controller container image |
controller.tag | latest | The controller image tag |
syncJob.image | zd/k8s/sync-pvcs | The sync job container image (for data migration) |
syncJob.tag | latest | The sync job image tag |
Note: The logLevel sets the verbosity level based on the klog style. Higher numbers mean more verbose logs.
The EZswitch Custom Resource
An EZswitch resource specifies the intended migration actions.
Important fields are:
.spec.stsName: Name of the original StatefulSet.
.spec.stsNamespace: Namespace of the original StatefulSet.
.spec.autoMigrate:
true (default): Executes a fully automated process (sync, scale down the old STS, final sync, deploy the new STS).
false: Halts at Syncing, maintaining the original StatefulSet and continuously syncing PVCs until manually resumed.
.spec.zestyStsName: Name of the new Zesty-backed StatefulSet (defaults to <stsName>-zesty).
If you are not using the zesty-plugin, you can manage migration behavior with these fields:
.status.phase:
Pausing - Pauses ezswitch migration
Activating - Resumes ezswitch migration
.spec.transferRateLimits: Specifies the maximum transfer rate for sync jobs in kb/s (utilizes rsync's bwlimit argument). If unset, no limit is applied.
.spec.autoMigrate: Initially determines if the migration process is fully automated or semi-controlled. For semi-controlled migration (autoMigrate=false), change .spec.autoMigrate to true to continue the migration process.