-
Notifications
You must be signed in to change notification settings - Fork 58
Workflow CLI Overview
The Workflow CLI provides a declarative, workflow-driven approach to managing OpenSearch migrations on Kubernetes. Instead of running individual commands, you define your migration configuration and submit it as a workflow that Argo Workflows orchestrates.
The Workflow CLI is a command-line tool that you run from within the Migration Console pod. It lets you:
- Configure migrations using declarative YAML
- Submit migrations as Argo Workflows
- Monitor workflow execution and progress
- Manage workflow lifecycle (approve, stop, retry)
To use the Workflow CLI, first connect to the Migration Console pod:
For EKS deployments, configure kubectl:
aws eks update-kubeconfig --region <REGION> --name migration-eks-cluster-<STAGE>-<REGION>Connect to the Migration Console pod:
kubectl exec -it migration-console-0 -n ma -- /bin/bashThen run workflow commands from within the pod.
Instead of running commands step-by-step, you declare what you want to migrate. The configuration schema defines source clusters, target clusters, authentication, snapshot repositories, and migration options.
To see the complete configuration schema for your installed version:
workflow configure sampleThe system determines how to execute the migration based on your configuration.
Argo Workflows provides:
- Parallel execution: Multiple migration tasks run simultaneously
- Retry logic: Automatic retry on transient failures
- Progress tracking: Visual workflow status
- Resource management: Controlled pod scheduling
- Approval gates: Human checkpoints before critical operations
You don't interact with Argo Workflows directly—the Workflow CLI handles this for you.
Workflow state and coordination data are stored in a distributed key-value store:
- Configuration: Runtime settings accessible to all workflow steps
- Coordination: Synchronization between parallel tasks
- Status: Shared state for monitoring progress
This state is managed automatically; you don't need to interact with it directly.
Create a migration configuration using the workflow configure commands:
# Load a sample configuration as your starting point
workflow configure sample --load
# Edit the configuration
workflow configure edit
# View the configuration
workflow configure viewSubmit your configuration as a workflow:
workflow submitThis command:
- Validates your configuration
- Transforms it to run as an Argo Workflow
- Initializes workflow state
- Submits to Argo Workflows
- Prints the workflow name for tracking (runs asynchronously)
Argo Workflows executes the migration in stages:
- Initialize: Set up workflow environment
- Create snapshots: Snapshot source cluster indexes
- Register snapshots: Make snapshots available to target
- Migrate metadata: Transfer index templates and settings
- Load documents: Bulk load documents from snapshots
- Cleanup: Remove temporary state
Track progress with status commands:
# Interactive TUI to view progress, check logs, and approve steps
workflow manage
# View workflow progress
workflow status
# Approve manual steps if needed
workflow approve <TASK_NAMES>The workflow manage command launches an interactive terminal interface for monitoring and controlling your workflow:
- Live status view: See all workflow steps and their current state
- Log viewer: Drill into logs for any step without leaving the interface
- Approval handling: Approve pending steps directly from the TUI
- Progress tracking: Watch steps transition through states in real-time
This is the recommended way to monitor long-running migrations.
Certain workflow steps require manual approval before proceeding. This provides checkpoints to verify the migration is progressing correctly.
- Before metadata migration (to verify snapshot completed correctly)
- Before document backfill (to verify metadata migrated correctly)
- At other critical transition points depending on your configuration
An approval gate indicates the workflow has completed a phase and is waiting for you to verify the results before continuing. The ⟳ status symbol indicates a step waiting for approval.
# Using the TUI (recommended)
workflow manage
# Approve a specific step
workflow approve source.target.metadataMigrate
# Approve multiple steps matching a pattern
workflow approve "*.metadataMigrate"
# Approve multiple specific steps
workflow approve step.a step.b step.cWhen a workflow fails (indicated by ✗ status):
workflow statusIdentify which step failed and note the step name.
# View all logs
workflow output
# View logs for a specific step using label selectors
workflow output -l task=<task-name>If the failure was due to configuration issues:
workflow configure editAfter fixing the issue:
workflow submitThe workflow will restart. For document backfill, RFS checkpoints allow resuming from where it left off rather than starting over.
| Command | Description |
|---|---|
workflow configure sample |
Display sample configuration schema for your version |
workflow configure sample --load |
Load sample as starting point |
workflow configure edit |
Edit configuration in default editor |
workflow configure view |
Display current configuration |
workflow configure clear |
Clear current configuration |
| Command | Description |
|---|---|
workflow submit |
Submit workflow for execution |
| Command | Description |
|---|---|
workflow manage |
Interactive TUI: approve steps, view logs, monitor progress |
workflow approve <step> |
Approve a single step that is currently blocked |
workflow approve "*.pattern" |
Approve all matching steps (glob pattern) |
workflow approve a b c |
Approve multiple steps |
workflow stop |
Stop a running workflow |
| Command | Description |
|---|---|
workflow status |
Show workflow progress and task states |
workflow output |
View workflow logs across all pods |
workflow output --follow |
Stream logs as they are written |
workflow output -l key=value |
Filter logs using label selectors |
Label selectors for workflow output use tab-completion to discover available keys and values for your workflow. The -l flag auto-prefixes keys with migrations.opensearch.org/.
| Command | Description |
|---|---|
workflow --help |
Show general help |
workflow configure --help |
Show configure subcommand help |
workflow -vv status |
Enable verbose logging |
- Define what to migrate, not how
- Configuration is version-controlled
- Easy to review and audit
- Repeatable migrations
- Automatic parallelism
- Built-in retry logic
- State management
- Progress tracking
- Leverages Kubernetes scheduling
- Resource limits and requests
- Integration with Kubernetes ecosystem
- Scalable execution
- Limited to backfill migrations (no live capture/replay)
- Requires Kubernetes deployment
- Requires Argo Workflows installation
- Configuration changes require workflow resubmission
- Workflow CLI Getting Started - Step-by-step tutorial for your first workflow
- Backfill Workflow - Detailed backfill configuration and execution
- Troubleshooting - Common issues and solutions
- Deploying to Kubernetes - Generic Kubernetes deployment
- Deploying to EKS - AWS EKS deployment
- Migration Paths - Supported versions and compatibility
Encountering a compatibility issue or missing feature?
- Search existing issues to see if it’s already reported. If it is, feel free to upvote and comment.
- Can’t find it? Create a new issue to let us know.