Vespa CloudThis page's content is applicable to Vespa Cloud.
Instance, region, cloud and environment variants
Sometimes it is useful to create configuration that varies depending on properties of the deployment,
for example to set region specific endpoints of services used by Searchers,
or use smaller clusters for a "beta" instance.
services.xml files support different configuration settings
for different tags, instances, environments, clouds and regions.
To use this, import the deploy namespace:
<servicesversion="1.0"xmlns:deploy="vespa">
Deploy directives are used to specify with which tags, and in which instance, environment,
cloud and/or region an XML element should be included:
This can be used to modify any config by deployment target.
The deploy directives have a set of override rules:
A directive specifying more conditions will override one specifying fewer.
Directives are inherited in child elements.
When multiple XML elements with the same name is specified
(e.g. when specifying search or docproc chains),
the id attribute or the idref attribute of the element
is used together with the element name when applying directives.
Some overrides are applied by default in some environments,
see environments.
Any override made explicitly for an environment will override the defaults for it.
Specifying multiple targets
More than one tag, instance, region or environment can be specified in the attribute, separated by space.
Note that tags by default only apply in production instances,
and are matched whenever the tags of the element and the tags of the instance intersect.
To match tags in other environments,
an explicit deploy:environment directive for that environment must also match.
Use tags if you have a complex instance structure which you want config to vary by.
The namespace can be applied to any element. Example:
<containerid="default"version="1.0"deploy:environment="perf test staging prod"><search><chainid="default"inherits="vespa"><searcherbundle="basic-application"id="vespa.ai.ExampleSearcher"><configname="example.message"><message>Hello from application config</message><messagedeploy:region="aws-us-east-1c">Hello from east colo!</message></config></searcher></chain></search></container>
Above, the container element is configured for the 4 environments only (it will not apply to dev) -
and in region aws-us-east-1c, the config is different.
Query profile variants
Query profiles support different configuration settings
for different instances, environments and regions through
query profile variants.
This allows you to set different query parameters for a query type depending on these deployment attributes.
To use this feature, create a regular query profile variant with any of
instance, environment and region as dimension names and
let your query profile vary by that. For example:
<query-profileid="default"><dimensions>instance, environment, region</dimensions><fieldname="a">My default value</field><!-- Value for (any deployment of) the beta instance --><query-profilefor="beta"><fieldname="a">My beta value</field></query-profile><!-- Value for (any) dev deployment --><query-profilefor="*, dev"><fieldname="a">My dev value</field></query-profile><!-- Value for the default instance in prod --><query-profilefor="default, prod"><fieldname="a">My main instance prod value</field></query-profile></query-profile>
You can pick and combine these dimensions in any way you want with other dimensions sent as query parameters, e.g: