|
1 | 1 | --- |
2 | 2 | # Copyright Vespa.ai. All rights reserved. |
3 | | -title: "Instance, region, cloud and environment variants" |
| 3 | +title: "Application, instance, region, cloud and environment variants" |
4 | 4 | applies_to: cloud |
5 | 5 | redirect_from: |
6 | 6 | - en/reference/deployment-variants.html |
|
9 | 9 | <p> |
10 | 10 | Sometimes it is useful to create configuration that varies depending on properties of the deployment, |
11 | 11 | for example to set region specific endpoints of services used by <a href="/en/applications/searchers.html">Searchers</a>, |
12 | | - or use smaller clusters for a "beta" instance. |
| 12 | + use smaller clusters for a "beta" instance, or vary configuration when the same application package is shared across |
| 13 | + multiple applications. |
13 | 14 | </p> |
14 | 15 | <p> |
15 | 16 | This is supported both for <a href="#services.xml-variants">services.xml</a> and |
|
21 | 22 | <h2 id="services.xml-variants">services.xml variants</h2> |
22 | 23 | <p> |
23 | 24 | <a href="../reference/applications/services/services.html">services.xml</a> files support different configuration settings |
24 | | - for different <em>tags</em>, <em>instances</em>, <em>environments</em>, <em>clouds</em> and <em>regions</em>. |
| 25 | + for different <em>tags</em>, <em>applications</em>, <em>instances</em>, <em>environments</em>, <em>clouds</em> and <em>regions</em>. |
25 | 26 | To use this, import the <em>deploy</em> namespace: |
26 | 27 | </p> |
27 | 28 | <pre>{% highlight xml %} |
28 | 29 | <services version="1.0" xmlns:deploy="vespa"> |
29 | 30 | {% endhighlight %}</pre> |
30 | 31 | <p> |
31 | | - Deploy directives are used to specify with which tags, and in which instance, environment, |
| 32 | + Deploy directives are used to specify with which tags, and in which application, instance, environment, |
32 | 33 | cloud and/or <a href="https://cloud.vespa.ai/en/reference/zones">region</a> an XML element should be included: |
33 | 34 | </p> |
34 | 35 | <pre>{% highlight xml %} |
@@ -56,6 +57,11 @@ <h2 id="services.xml-variants">services.xml variants</h2> |
56 | 57 | count="4"> |
57 | 58 | <resources vcpu="16.0" memory="256Gb" disk="3750Gb"/> |
58 | 59 | </nodes> |
| 60 | + <nodes deploy:application="my-app" |
| 61 | + deploy:environment="prod" |
| 62 | + count="30"> |
| 63 | + <resources vcpu="16.0" memory="128Gb" disk="3750Gb"/> |
| 64 | + </nodes> |
59 | 65 | <nodes deploy:tags="myTag1 myTag2" count="8" /> |
60 | 66 | </content> |
61 | 67 | {% endhighlight %}</pre> |
@@ -104,7 +110,7 @@ <h2 id="services.xml-variants">services.xml variants</h2> |
104 | 110 |
|
105 | 111 |
|
106 | 112 | <h3 id="advanced">Specifying multiple targets</h3> |
107 | | -<p>More than one tag, instance, region or environment can be specified in the attribute, separated by space.</p> |
| 113 | +<p>More than one tag, application, instance, region or environment can be specified in the attribute, separated by space.</p> |
108 | 114 | <p> |
109 | 115 | Note that <code>tags</code> by default only apply in production instances, |
110 | 116 | and are matched whenever the tags of the element and the tags of the instance intersect. |
@@ -137,40 +143,40 @@ <h3 id="advanced">Specifying multiple targets</h3> |
137 | 143 | <h2 id="query-profile-variants">Query profile variants</h2> |
138 | 144 | <p> |
139 | 145 | <a href="/en/querying/query-profiles.html">Query profiles</a> support different configuration settings |
140 | | - for different <em>instances</em>, <em>environments</em> and <em>regions</em> through |
| 146 | + for different <em>applications</em>, <em>instances</em>, <em>environments</em> and <em>regions</em> through |
141 | 147 | <a href="/en/querying/query-profiles.html#query-profile-variants">query profile variants</a>. |
142 | 148 | This allows you to set different query parameters for a query type depending on these deployment attributes. |
143 | 149 | </p> |
144 | 150 | <p> |
145 | 151 | To use this feature, create a regular query profile variant with any of |
146 | | - <code>instance</code>, <code>environment</code> and <code>region</code> as dimension names and |
| 152 | + <code>application</code>, <code>instance</code>, <code>environment</code> and <code>region</code> as dimension names and |
147 | 153 | let your query profile vary by that. For example: |
148 | 154 | </p> |
149 | 155 | <pre>{% highlight xml %} |
150 | 156 | <query-profile id="default"> |
151 | 157 |
|
152 | | - <dimensions>instance, environment, region</dimensions> |
| 158 | + <dimensions>application, instance, environment, region</dimensions> |
153 | 159 |
|
154 | 160 | <field name="a">My default value</field> |
155 | 161 |
|
156 | 162 | <!-- Value for (any deployment of) the beta instance --> |
157 | | - <query-profile for="beta"> |
| 163 | + <query-profile for="*, beta"> |
158 | 164 | <field name="a">My beta value</field> |
159 | 165 | </query-profile> |
160 | 166 |
|
161 | 167 | <!-- Value for (any) dev deployment --> |
162 | | - <query-profile for="*, dev"> |
| 168 | + <query-profile for="*, *, dev"> |
163 | 169 | <field name="a">My dev value</field> |
164 | 170 | </query-profile> |
165 | 171 |
|
166 | 172 | <!-- Value for the default instance in prod --> |
167 | | - <query-profile for="default, prod"> |
| 173 | + <query-profile for="*, default, prod"> |
168 | 174 | <field name="a">My main instance prod value</field> |
169 | 175 | </query-profile> |
170 | 176 |
|
171 | 177 | </query-profile> |
172 | 178 | {% endhighlight %}</pre> |
173 | 179 | <p>You can pick and combine these dimensions in any way you want with other dimensions sent as query parameters, e.g:</p> |
174 | 180 | <pre>{% highlight xml %} |
175 | | - <dimensions>device, instance, usecase</dimensions> |
| 181 | + <dimensions>device, application, instance, usecase</dimensions> |
176 | 182 | {% endhighlight %}</pre> |
0 commit comments