Target Selection
Choosing the right targets for your deployment ensures your changes reach the intended machines.
Selection Methods
Section titled “Selection Methods”A deployment’s targets are resolved from either explicit target IDs or a set of tags — these are the two underlying selector types. The UI layers convenience flows (manual picking, name patterns) on top of them. The environment is a separate deployment context that supplies the candidate targets and their priority ordering; it is not itself a target selector.
| Method | Resolves via | Best For |
|---|---|---|
| By Tag | Tags | Targeted updates |
| By Target | Target IDs | Ad-hoc operations |
Deploying Within an Environment
Section titled “Deploying Within an Environment”When deploying a solution, the environment supplies the candidate targets, which you can then narrow:
┌─────────────────────────────────────────────────────────────┐│ Target Selection │├─────────────────────────────────────────────────────────────┤│ ││ Environment: Production ││ ││ Targets in environment (12): ││ ┌────────────────┬────────┬──────────┬────────────┐ ││ │ Name │ Status │ Mode │ Priority │ ││ ├────────────────┼────────┼──────────┼────────────┤ ││ │ ✓ web-prod-01 │ Online │ Listen │ 80 │ ││ │ ✓ web-prod-02 │ Online │ Listen │ 70 │ ││ │ ✓ web-prod-03 │ Online │ Listen │ 60 │ ││ │ ⚠ db-prod-01 │ Stale │ Poll │ 10 │ ││ └────────────────┴────────┴──────────┴────────────┘ ││ ││ [✓] Include all online targets ││ [ ] Include stale targets ││ │└─────────────────────────────────────────────────────────────┘Environment Selection Process
Section titled “Environment Selection Process”- Choose the target environment
- View all assigned targets
- See target status and priority
- Optionally exclude offline/stale targets
- Proceed with deployment
Tag-Based Selection
Section titled “Tag-Based Selection”Filter targets using tags for more granular control:
┌─────────────────────────────────────────────────────────────┐│ Filter by Tags │├─────────────────────────────────────────────────────────────┤│ ││ Include targets where: ││ ││ ┌─────────────────────────────────────────────────────┐ ││ │ role [=] [web ] [×] │ ││ │ region [=] [us-east-1 ] [×] │ ││ │ [+ Add Filter] │ ││ └─────────────────────────────────────────────────────┘ ││ ││ Matching targets (4 of 12): ││ ● web-prod-01 ││ ● web-prod-02 ││ ● web-prod-03 ││ ● web-prod-04 ││ │└─────────────────────────────────────────────────────────────┘Tag Filter Operations
Section titled “Tag Filter Operations”Tag filters match by exact key=value equality. Each filter you add must specify both a key and a value; a target is included only when it carries a tag with that exact key and that exact value.
| Field | Description | Example |
|---|---|---|
key | The tag key to match | role |
value | The exact value | web |
Combining Filters
Section titled “Combining Filters”Multiple filters combine with AND logic:
role = web AND region = us-east-1 AND tier = frontendThis selects only targets matching all criteria.
By Target Selection
Section titled “By Target Selection”For ad-hoc deployments, manually pick targets by their ID. The search box filters the displayed list by name or hostname on the client side — it is a convenience filter for finding the right targets, not a deployment selector itself. Only the targets you check are sent to the deployment.
┌─────────────────────────────────────────────────────────────┐│ Select Targets │├─────────────────────────────────────────────────────────────┤│ ││ Search: [web-prod_________] ││ ││ Available Targets: ││ ┌────────────────┬────────┬──────────┬────────────────┐ ││ │ [✓] web-prod-01│ Online │ Listen │ Production │ ││ │ [✓] web-prod-02│ Online │ Listen │ Production │ ││ │ [ ] web-prod-03│ Online │ Listen │ Production │ ││ │ [ ] web-stg-01 │ Online │ Poll │ Staging │ ││ └────────────────┴────────┴──────────┴────────────────┘ ││ ││ Selected: 2 targets ││ │└─────────────────────────────────────────────────────────────┘When to Use By Target Selection
Section titled “When to Use By Target Selection”- Testing on specific machines
- Investigating issues on particular targets
- Running maintenance on subset of servers
- Canary deployments to single targets
Target Status Filtering
Section titled “Target Status Filtering”Control which targets by status:
| Status | Default | Description |
|---|---|---|
| Online | Included | Healthy, connected targets |
| Stale | Excluded | Recently missed heartbeat |
| Offline | Excluded | Not connected |
Including Stale Targets
Section titled “Including Stale Targets”┌─────────────────────────────────────────────────────────────┐│ Status Filter │├─────────────────────────────────────────────────────────────┤│ ││ Include targets with status: ││ [✓] Online (10 targets) ││ [ ] Stale (2 targets) ││ [ ] Offline (1 target) ││ ││ ┌───────────────────────────────────────────────────────┐ ││ │ ⚠ Including offline targets may cause failures │ ││ └───────────────────────────────────────────────────────┘ ││ │└─────────────────────────────────────────────────────────────┘Priority-Based Ordering
Section titled “Priority-Based Ordering”Selected targets are ordered by priority. Priority values range from -100 to 100 (default 50), and targets with higher priority deploy first:
| Target | Priority | Deploy Order |
|---|---|---|
| web-01 | 80 | First batch |
| web-02 | 80 | First batch |
| web-03 | 70 | Second batch |
| web-04 | 70 | Second batch |
| db-01 | 10 | Last |
Selection Validation
Section titled “Selection Validation”Before deployment, Mantis validates your selection:
Validation Checks
Section titled “Validation Checks”| Check | Description |
|---|---|
| Minimum targets | At least one target selected |
| Target health | Warns about offline/stale targets |
Validation Warnings
Section titled “Validation Warnings”┌─────────────────────────────────────────────────────────────┐│ Selection Warnings │├─────────────────────────────────────────────────────────────┤│ ││ ⚠ 1 target is stale and may fail: ││ - db-prod-01 (last seen 15 minutes ago) ││ ││ ⚠ 2 targets are in different environments: ││ - web-staging-01 (Staging) ││ - web-staging-02 (Staging) ││ ││ [Continue Anyway] [Modify Selection] ││ │└─────────────────────────────────────────────────────────────┘CLI Target Selection
Section titled “CLI Target Selection”Using the CLI for target selection:
# By environmentmantisctl deployment create --solution-id <id> --environment-id production
# By tag (repeat --target-tag for multiple key=value pairs)mantisctl deployment create --solution-id <id> \ --target-tag role=web --target-tag region=us-east-1
# Explicit targets by UUID (repeat --target for each)mantisctl deployment create --solution-id <id> \ --target <target-uuid-1> --target <target-uuid-2> --target <target-uuid-3>Building a Target List from a File
Section titled “Building a Target List from a File”--target is repeatable, so you can expand a one-target-per-line file with
your shell:
# targets.txt - one target UUID per line (blank lines and # comments ignored)args=$(grep -v '^\s*#' targets.txt | grep -v '^\s*$' | sed 's/^/--target /')mantisctl deployment create --solution-id <id> $argsSelection Strategies
Section titled “Selection Strategies”Canary Deployment
Section titled “Canary Deployment”Deploy to a single target first:
┌─────────────────────────────────────────────────────────────┐│ Canary Strategy │├─────────────────────────────────────────────────────────────┤│ ││ Phase 1: Canary (1 target) ││ [✓] web-prod-01 ││ ││ Phase 2: Remaining (11 targets) ││ [ ] web-prod-02 through web-prod-12 ││ ││ ● Deploy Phase 1, then manually approve Phase 2 ││ │└─────────────────────────────────────────────────────────────┘Geographic Rollout
Section titled “Geographic Rollout”Deploy by region:
Phase 1: us-east-1 (tag: region=us-east-1)Phase 2: us-west-2 (tag: region=us-west-2)Phase 3: eu-west-1 (tag: region=eu-west-1)Role-Based Rollout
Section titled “Role-Based Rollout”Deploy by server role:
Phase 1: Workers (tag: role=worker)Phase 2: API servers (tag: role=api)Phase 3: Web servers (tag: role=web)Best Practices
Section titled “Best Practices”1. Always Preview Selection
Section titled “1. Always Preview Selection”Review matched targets before deploying:
Preview shows:├── Target count├── Target names├── Target status└── Any warnings2. Use Tags Consistently
Section titled “2. Use Tags Consistently”Standardize tags across your infrastructure:
| Tag | Purpose |
|---|---|
role | Server function |
region | Geographic location |
tier | Application tier |
team | Owning team |
3. Consider Target Status
Section titled “3. Consider Target Status”- Deploy to online targets for reliability
- Investigate stale targets before including
- Never deploy to offline targets in production
4. Document Selection Criteria
Section titled “4. Document Selection Criteria”Record why you selected specific targets:
Deployment: Emergency security patchSelection: role=web AND region=us-east-1Reason: Patch critical vulnerability in US East web servers onlyTroubleshooting
Section titled “Troubleshooting”No Targets Found
Section titled “No Targets Found”Cause: Filter criteria too restrictive
Solution: Broaden filters or check tag values
Wrong Targets Selected
Section titled “Wrong Targets Selected”Cause: Incorrect filter or environment
Solution: Review selection preview before deploying
Target Missing from Selection
Section titled “Target Missing from Selection”Cause: Target not in environment or missing tags
Solution: Verify target assignment and tag values
Next Steps
Section titled “Next Steps”- Execution Modes - How targets are deployed
- Monitoring - Track deployment progress
- Creating Deployments - Start a deployment
- Overview - Return to deployments overview
