Skip to main content

types.JobSpec

config object

Config contains type-specific configuration for the workload. The structure depends on the job type (e.g., pipeline config, query parameters).

property name*any

Config contains type-specific configuration for the workload. The structure depends on the job type (e.g., pipeline config, query parameters).

descriptionstring

Description is an optional human-readable description of the job.

labels object

Labels is used to associate arbitrary labels with this job. Labels can be used for filtering and selection.

property name*string
meta object

Meta is used to associate arbitrary metadata with this job. Keys with the prefix "expanso.io/" are reserved for system use.

property name*string
namestring

Name is the logical name of the job used to refer to it. Submitting a job with the same name as an existing job will result in an update to the existing job.

namespacestring

Namespace is the namespace this job is running in.

priorityinteger

Priority defines the scheduling priority of this job. Higher values indicate higher priority.

restart_policystring

RestartPolicy controls restart behavior when executions exit.

  • "on-failure" (default): Restart on non-zero exit, complete on success
  • "always": Restart on any exit (current daemon behavior)
  • "never": No restart, one-shot execution
rollout object

Rollout defines how to rollout the job

auto_promoteboolean

Auto-promote canary rollouts

canary_countinteger

Canary-specific settings

canary_percentinteger

Percentage of canary nodes

health_check object

HealthCheck defines health check configuration (required for rolling/canary, ignored for immediate)

deadlineinteger<int64>

Deadline is the maximum time to wait for an execution to become healthy (required)

Possible values: [-9223372036854776000, 9223372036854776000, 1, 1000, 1000000, 1000000000, 60000000000, 3600000000000, 3600000000000, 10000000000]

failure_thresholdinteger

FailureThreshold is the number of consecutive unhealthy intervals before the execution is considered unhealthy (optional, default: 3)

intervalinteger<int64>

Interval is the duration of each health evaluation window (optional, default: 10s) Error rate is calculated per interval, not lifetime.

Possible values: [-9223372036854776000, 9223372036854776000, 1, 1000, 1000000, 1000000000, 60000000000, 3600000000000, 3600000000000, 10000000000]

max_error_ratenumber

MaxErrorRate is the maximum error rate allowed during health checks (optional, default: 0.10) Pointer because we need to distinguish nil (use default) from explicit 0.0

success_thresholdinteger

SuccessThreshold is the number of consecutive healthy intervals before the execution is considered healthy (optional, default: 2)

max_failed_nodesinteger

MaxFailedNodes is the maximum number of failed nodes before stopping (optional, default: 10)

max_failed_nodes_percentnumber

MaxFailedNodesPercent is the maximum percentage of failed nodes before stopping (optional, default: 10.0)

max_parallelinteger

MaxParallel is the maximum percentage of nodes to update in parallel (0-100) For immediate strategy: this value is ignored (all nodes updated simultaneously) For rolling/canary: controls wave size as percentage of total nodes (default: 10 if not specified) Examples: 10 = 10% of nodes per wave, 50 = 50% of nodes per wave, 100 = all nodes at once

no_auto_rollbackboolean

NoAutoRollback disables automatic rollback on rollout failure (default: false = auto-rollback enabled)

strategytypes.RolloutStrategyType (string)

Strategy: immediate|rolling|canary

Possible values: [immediate, rolling, canary]

secret_providers object

SecretProviders declares named secret provider backends. Keys are user-chosen identifiers that secrets reference via their From field.

property name* types.SecretProviderSpec
addressstring

Address is the Vault server URL (required for hashicorp_vault).

auth object

Auth defines how to authenticate to this provider. Optional for cloud providers (SDK default chain), required for hashicorp_vault.

access_key_idstring

AccessKeyID is a static AWS access key ID.

client_idstring

ClientID is the Azure AD application (client) ID.

client_secret_envstring

ClientSecretEnv is the environment variable containing the Azure client secret.

impersonate_service_accountstring

ImpersonateServiceAccount is the target service account to impersonate.

jwtstring

JWT is the JWT token value.

jwt_envstring

JWTEnv is the environment variable containing the JWT token.

jwt_filestring

JWTFile is the path to a file containing the JWT token.

managed_identity_client_idstring

ManagedIdentityClientID is the client ID for a user-assigned managed identity.

methodstring

Method is the authentication method.

mount_pathstring

MountPath overrides the default auth mount path in Vault (e.g. "auth/approle").

pathstring

Path is the path to a credential file for file-based auth.

rolestring

Role is the backend role name (Vault role, AWS role, etc.) bound to the identity.

role_idstring

RoleID is the AppRole role ID value.

role_id_envstring

RoleIDEnv is the environment variable containing the AppRole role ID.

role_id_filestring

RoleIDFile is the path to a file containing the AppRole role ID.

secret_access_keystring

SecretAccessKey is a static AWS secret access key.

secret_idstring

SecretID is the AppRole secret ID value.

secret_id_envstring

SecretIDEnv is the environment variable containing the AppRole secret ID.

secret_id_filestring

SecretIDFile is the path to a file containing the AppRole secret ID.

service_account_key_filestring

ServiceAccountKeyFile is the path to a GCP service account key JSON file.

tenant_idstring

TenantID is the Azure AD tenant ID.

tokenstring

Token is a static Vault token value.

token_envstring

TokenEnv is the environment variable containing a static Vault token.

token_filestring

TokenFile is the path to the projected service account token. Default: /var/run/secrets/kubernetes.io/serviceaccount/token

duration_secondsinteger

DurationSeconds is the STS session duration (default: 3600, max: 43200).

endpoint_urlstring

EndpointURL is a custom endpoint (LocalStack, PrivateLink, VPC endpoints).

external_idstring

ExternalID is for sts:ExternalId trust policies.

locationstring

Location is the GCP location for regional secrets.

namespacestring

Namespace is the Vault Enterprise namespace.

profilestring

Profile is the AWS shared-config profile name.

projectstring

Project is the GCP project ID (required for gcp_secret_manager).

providerstring

Provider is the backend type (required).

regionstring

Region is the AWS region (required for AWS providers).

role_arnstring

RoleARN is the IAM role to assume (required for aws_sts).

session_namestring

SessionName appears in CloudTrail and the assumed-role ARN.

tls object

TLS configures TLS settings for the Vault connection.

ca_certstring

CACert is the path to a custom CA certificate for verifying the server.

client_certstring

ClientCert is the path to a client certificate for mutual TLS.

client_keystring

ClientKey is the path to a client key for mutual TLS.

skip_verifyboolean

SkipVerify disables TLS verification. For dev/testing only.

vault_urlstring

VaultURL is the Azure Key Vault URL (required for azure_key_vault).

secrets object

Secrets declares named secrets to be fetched from providers. Keys are variable names (or prefixes for multi-value providers) injected into the job runtime.

property name* types.SecretSpec
encodingstring

Encoding specifies the file encoding: "raw" (default) or "base64".

engine_versioninteger

EngineVersion is the KV engine version: 1 or 2 (default: 2).

fieldstring

Field extracts a single JSON key from the secret value.

fromstring

From references a key in the job's SecretProviders map (required).

mountstring

Mount is the Vault secret engine mount (e.g. "kv", "secret").

namestring

Name is the parameter name or ARN. Supports ":version" and ":label" suffixes.

pathstring

Path is the absolute path on the node to read from.

refreshinteger<int64>

Refresh overrides the refresh interval for this secret.

Possible values: [-9223372036854776000, 9223372036854776000, 1, 1000, 1000000, 1000000000, 60000000000, 3600000000000, 3600000000000, 10000000000]

secretstring

Secret is the GCP secret name.

secret_idstring

SecretID is the Secrets Manager secret name or ARN.

secret_namestring

SecretName is the Azure Key Vault secret name.

secret_pathstring

SecretPath is the path within the mount.

versionstring

Version pins a specific version (Vault KV v2, GCP, Azure).

version_idstring

VersionID selects the secret by version ID. Mutually exclusive with VersionStage.

version_stagestring

VersionStage selects the secret version (default: AWSCURRENT).

with_decryptionboolean

WithDecryption controls parameter decryption (default: true).

selector object

Selector defines which nodes to run the job on

match_expressionsstring[]

MatchExpressions selects nodes using label selector expression strings. Each expression is evaluated independently and all must match (AND logic). Supported syntax:

  • Equality: "key=value" or "key==value"
  • Inequality: "key!=value"
  • Set inclusion: "key in (value1,value2,...)"
  • Set exclusion: "key notin (value1,value2,...)"
  • Existence: "key"
  • Non-existence: "!key" Examples:
  • "region=us-east"
  • "tier in (premium,standard)"
  • "environment!=prod"
  • "gpu"
  • "!debug"
match_idsstring[]

MatchIDs selects specific nodes by their IDs. If specified, the job will only run on nodes whose ID is in this list.

match_labels object

MatchLabels selects nodes with labels that exactly match all specified key-value pairs. All labels must match (AND logic). Example: {"region": "us-east", "tier": "compute"}

property name*string
timeouts object

Timeouts defines timeout configurations for the job

execution_timeoutinteger

ExecutionTimeout is the maximum amount of time a task is allowed to run in seconds. Zero means no timeout, such as for a daemon task.

queue_timeoutinteger

QueueTimeout is the maximum amount of time a task is allowed to wait in the orchestrator queue in seconds before being scheduled. Zero means no timeout.

total_timeoutinteger

TotalTimeout is the maximum amount of time a task is allowed to complete in seconds. This includes the time spent in the queue, the time spent executing and the time spent retrying. Zero means no timeout.

typestring

Type specifies what kind of workload this job runs (e.g. "pipeline", "query", "update", "config"). The scheduling behavior is derived from this type.

types.JobSpec
{
"config": {
"input": {
"file": {
"paths": [
"/var/log/app/*.log"
]
}
},
"output": {
"stdout": {}
},
"pipeline": {
"processors": [
{
"mapping": "root = this\nroot.processed_at = now()\n"
}
]
}
},
"description": "Processes application logs from edge nodes",
"labels": {
"env": "production",
"region": "us-west",
"version": "v1.2.0"
},
"name": "log-processor",
"namespace": "production",
"priority": 50,
"selector": {
"match_labels": {
"env": "production",
"role": "app-server"
}
},
"type": "pipeline"
}