Skip to content
SHC Docs

shc constraint set

set a where or prefer constraint at a scope

Set a where or prefer row at one scope (default tenant). The tenant comes from the global -t; a deployment scope also takes -s and -e. --where '' replaces the scope’s where row and --prefer '' its prefer row; both may be given in one call. ” deletes that form. A form not given is left alone. A where that leaves no node is refused.

shc constraint set [flags]
shc constraint set --where 'site=ogden' -t acme
shc constraint set --where 'location=hetzner/hel1' --scope cluster --reason 'data residency'
shc constraint set --where 'node=hel-01' --prefer 'tier=gold' --scope deployment -s wiki -t acme
-h, --help help for set
--prefer string should: prefer nodes matching this selector; '' clears it
--reason string why the constraint exists, recorded with it
--scope string the scope: cluster, tenant and deployment (default "tenant")
--where string must: keep the scope's deployments on nodes matching this selector; '' clears it
--config stringArray extra YAML config file to layer on top of auto-discovered config; repeatable, later files win
-d, --debug enable debug mode (default: $SHC_DEBUG)
-e, --environment string environment name (default: "prod", or "default" on an estate with no licence and no trial; $SHC_ENVIRONMENT and shc ctx -e override it, and the "master" tenant is always "default")
--exclude string comma-separated dotted paths to drop
--fields string comma-separated columns/keys to show (and their order)
--filter string comma-separated dotted paths to keep (drops everything else)
-o, --output string output format: tty|text|json|yaml (default: $SHC_OUTPUT)
-s, --stack string stack name (default: $SHC_STACK)
-t, --tenant string tenant name (default: $SHC_TENANT)
-v, --verbose verbose output (default: $SHC_VERBOSE)