Deploy
expanso-cli job deploy
Deploy a job from a file
Synopsis
Deploy a new job or update an existing job from a YAML or JSON file.
What Happens When You Deploy:
- CLI sends job specification to the control plane
- Control plane validates the job (checks syntax, required fields)
- Control plane stores the job and returns immediately
- Assignment happens asynchronously:
- Control plane creates an evaluation
- Scheduler finds nodes matching the job's selector
- Executions are created on matching nodes
The deploy command returns after validation and storage, not after assignment. Use 'job describe' and 'execution list' to check status.
Job Identification:
By default, jobs are identified by name + namespace (from the spec): • Updates if a job with that name exists • Creates if no job with that name exists • Cannot rename jobs (changing the name creates a new job)
Use --id to explicitly target a job by its ID: • Useful for renaming jobs (name in spec can be different) • Requires job to exist (fails with 404 if not found) • Prevents accidental creation of duplicate jobs
Job Specification Format:
Jobs are defined in YAML or JSON with these required fields: • name: Job identifier (DNS-1123 label, max 63 chars) • type: Job type (currently only "pipeline") • config: Type-specific configuration
- For pipelines: input, pipeline (processors), output sections • selector: Node selection criteria (match_labels, match_expressions)
For complete job specification reference and examples, see the Pipeline Guide.
expanso-cli job deploy FILE [flags]
Examples
# Create a minimal job specification
cat > log-processor.yaml <<EOF
name: log-processor
type: pipeline
config:
input:
file:
paths: ["/var/log/app/*.log"]
pipeline:
processors: []
output:
stdout: {}
selector:
match_labels:
env: production
EOF
# Deploy the job
expanso-cli job deploy log-processor.yaml
# Check if job was created
expanso-cli job describe log-processor
# See which nodes are running it
expanso-cli execution list --job log-processor
# Validate before deploying
expanso-cli job validate log-processor.yaml
# Dry run to preview changes
expanso-cli job deploy log-processor.yaml --dry-run
# Deploy from stdin
cat log-processor.yaml | expanso-cli job deploy -
# Update a specific job by ID (e.g., to rename)
expanso-cli job deploy renamed-processor.yaml --id job-abc123
# Force update with ID (even if unchanged)
expanso-cli job deploy log-processor.yaml --id job-abc123 --force
Options
--dry-run Show what would be deployed without actually deploying
--force Force apply even if unchanged
-h, --help help for deploy
--id string Job ID for ID-based updates (enables job renaming)
Options inherited from parent commands
--auth-token string API bearer authentication token
-e, --endpoint string API endpoint URL
-k, --insecure Skip TLS certificate verification
-p, --profile string Profile to use for configuration
--timeout string Request timeout duration
-v, --verbose Enable verbose logging
SEE ALSO
- expanso-cli job - Manage jobs