-
Notifications
You must be signed in to change notification settings - Fork 41
Workflow CLI Getting Started
This guide walks you through your first OpenSearch migration using the Workflow CLI. You'll learn how to configure, submit, and monitor a migration workflow.
Before starting, ensure:
- You have access to the migration console on your Kubernetes cluster
- Argo Workflows is installed and running
- Source and target clusters are accessible
- You've reviewed the Workflow CLI Overview
The Migration Console is a Kubernetes pod where you run the Workflow CLI. First, ensure kubectl is configured for your cluster.
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/bashYou should see a welcome message similar to:
Welcome to the Migration Assistant Console
To get started, run:
console --help
For workflow commands, run:
workflow --help
Customize the configuration for your clusters:
workflow configure editThis opens your default editor. Update these sections:
Source cluster:
sourceClusters:
my-es-source:
endpoint: https://source.example.com:9200
version: "7.10.2"
authConfig:
basic:
username: admin
password: your-passwordTarget cluster:
targetClusters:
my-os-target:
endpoint: https://target.example.com:9200
version: "2.11.0"
authConfig:
basic:
username: admin
password: your-passwordMigration configuration:
migrations:
- sourceCluster: my-es-source
targetCluster: my-os-target
snapshotMigrations:
- indices: ["logs-*", "metrics-*"]
metadataMigration:
enabled: true
documentBackfill:
enabled: trueSave and exit (in vi: Esc, then :wq, then Enter).
Before submitting the workflow, verify that the source and target clusters are reachable:
console clusters connection-checkYou should see successful connection status for both clusters. If there are connectivity issues, check your cluster endpoints and credentials in the configuration.
Submit your migration workflow:
workflow submitYou'll see output like:
Initializing workflow from session: default
Workflow initialized with prefix: a1b2c3d4-e5f6-7890-abcd-ef1234567890
Submitting workflow to namespace: ma
Workflow submitted successfully
Name: migration-xwz9r
Prefix: a1b2c3d4-e5f6-7890-abcd-ef1234567890
Namespace: ma
Important: Note the workflow name for monitoring.
Check the status of your workflow:
workflow statusYou'll see a tree view showing progress:
[*] Workflow: migration-xwz9r
Phase: Running
Started: 2024-01-15T10:30:00Z
📋 Workflow Steps
├── ✓ Initialize (Succeeded)
├── ▶ Create Snapshot (Running)
│ ├── ✓ Validate Indexes (Succeeded)
│ └── ▶ Snapshot Creation (Running)
├── ○ Register Snapshot (Pending)
├── ○ Migrate Metadata (Pending)
└── ○ Restore Documents (Pending)
Status symbols:
| Symbol | Meaning |
|---|---|
✓ |
Step completed successfully |
▶ |
Step currently running |
○ |
Step pending (waiting to run) |
✗ |
Step failed |
⟳ |
Step waiting for approval |
The workflow runs asynchronously. You can monitor it in several ways:
Option A: Check manually
workflow statusOption B: Auto-refresh with watch
watch -n 10 workflow status(Refreshes every 10 seconds. Press Ctrl+C to exit.)
Option C: Submit with wait flag
workflow submit --wait --timeout 3600If the workflow requires manual approval, you'll see:
├── ⟳ Manual Approval Gate - WAITING FOR APPROVAL
Approve to continue:
workflow approveThen check status again:
workflow statusWhen complete, you'll see:
[+] Workflow: migration-xwz9r
Phase: Succeeded
Started: 2024-01-15T10:30:00Z
Finished: 2024-01-15T11:45:00Z
📋 Workflow Steps
├── ✓ Initialize (Succeeded)
├── ✓ Create Snapshot (Succeeded)
├── ✓ Register Snapshot (Succeeded)
├── ✓ Migrate Metadata (Succeeded)
└── ✓ Restore Documents (Succeeded)
Verify data in your target cluster to confirm the migration succeeded.
migrations:
- sourceCluster: my-source
targetCluster: my-target
snapshotMigrations:
- indices: ["user-data-*", "application-logs-2024-*"]
metadataMigration:
enabled: true
documentBackfill:
enabled: truemigrations:
- sourceCluster: my-source
targetCluster: my-target
snapshotMigrations:
- indices: ["*"]
metadataMigration:
enabled: true
documentBackfill:
enabled: falsemigrations:
- sourceCluster: my-source
targetCluster: my-target
snapshotMigrations:
# Critical data with metadata
- indices: ["orders-*", "customers-*"]
metadataMigration:
enabled: true
documentBackfill:
enabled: true
# Logs without metadata
- indices: ["logs-*"]
metadataMigration:
enabled: false
documentBackfill:
enabled: trueProblem: Editor closes but configuration isn't saved.
Solution:
- Save the file before exiting (vi:
Esc→:wq→Enter) - Check for YAML syntax errors
Problem: Error: "No workflow configuration found"
Solution:
# Check if configuration exists
workflow configure view
# If empty, create one
workflow configure editProblem: All steps show "Pending"
Solution:
-
Check workflow templates are deployed:
kubectl get workflowtemplates -n ma
-
Check pod status:
kubectl get pods -n ma
-
View workflow logs:
workflow output
# Configuration commands
workflow configure sample --load # Start with sample
workflow configure edit # Edit configuration
workflow configure view # Show configuration
workflow configure clear # Clear configuration
# Execution commands
workflow submit # Submit workflow
workflow submit --wait # Submit and wait for completion
workflow status # Show all workflows
workflow status # Show specific workflow
workflow output # View workflow logs
# Management commands
workflow approve # Approve manual steps
workflow stop # Stop a running workflowNow that you've completed your first migration:
- Verify data in your target cluster
- Learn about Backfill Workflow for more details on document migration
- Review the Workflow CLI Overview for architectural details
- Check Troubleshooting if you encounter issues
If you encounter issues:
-
Check command help:
workflow --help workflow configure --help workflow submit --help
-
Enable verbose logging:
workflow -vv status
-
Check workflow logs:
workflow output
-
Provide feedback through the OpenSearch Migrations repository
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.