--- title: "Install and run EZswitch in PV autoscaling" slug: "install-and-run-ezswitch-in-storage-autoscaling" updated: 2026-07-21T09:45:50Z published: 2026-07-21T09:45:50Z canonical: "docs.zesty.co/install-and-run-ezswitch-in-storage-autoscaling" --- > ## Documentation Index > Fetch the complete documentation index at: https://docs.zesty.co/llms.txt > Use this file to discover all available pages before exploring further. # Install and run EZswitch in PV autoscaling This topic describes how to install and run EZswitch in PV autoscaling. **Prerequisites** - Kompass Storage deployed and configured (as described in [Deploy Storage Autoscaling](https://docs.zesty.co/docs/deploy-pvs-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](https://argo-cd.readthedocs.io/)), 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: 1. Install the zesty-ezswitch-helm chart automatically. 2. Create and manage the required [EZswitch custom resource](/v1/docs/install-and-run-ezswitch-in-kompass-storage#the-ezswitch-custom-resource). 3. Provide easy access to migration status and controls. **Prerequisites** - Krew is installed. To install Krew, see [Windows](https://krew.sigs.k8s.io/docs/user-guide/setup/install/) or [MacOS](https://formulae.brew.sh/formula/krew). - The latest version of the Kubectl-zesty plugin is installed. To install the plugin, see [To install the Zesty Kubectl plugin](https://docs.zesty.co/v1/docs/monitor-k8s#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](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](/v1/docs/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:** 1. 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` 2. 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 3. 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](/v1/docs/install-and-run-ezswitch-in-kompass-storage#the-ezswitch-custom-resource). **Example**: ```plaintext 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. Setting `autoMigrate: false` allows you to manually control when to proceed between migration phases. See the full CR options in the section [EZswitch custom resource](/v1/docs/install-and-run-ezswitch-in-kompass-storage#the-ezswitch-custom-resource). 4. 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 5. 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](https://github.com/kubernetes/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 -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.