|
7 | 7 | * [Typical overrides](#typical-overrides)
|
8 | 8 | * [Unsupported overrides](#unsupported-overrides)
|
9 | 9 | * [Override template names and syntax](#override-template-names-and-syntax)
|
| 10 | + * [Override template names](##override-template-names) |
| 11 | + * [Override template macros](##override-template-macros) |
| 12 | + * [Override template samples](##override-template-samples) |
10 | 13 | * [Step-by-step guide](#step-by-step-guide)
|
11 | 14 | * [Debugging](#debugging)
|
12 | 15 | * [Internal design flow](#internal-design-flow)
|
|
18 | 21 |
|
19 | 22 | Use configuration overrides (also called _situational configuration_) to customize a WebLogic domain home configuration without modifying the domain's actual `config.xml` or system resource files. For example, you may want to override a JDBC datasource XML module user name, password, and URL so that it references a local database.
|
20 | 23 |
|
| 24 | +You can use overrides to customize domains as they are moved from QA to production, are deployed to different sites, or are even deployed multiple times at the same site. |
| 25 | + |
21 | 26 | ## How do you specify overrides?
|
22 | 27 | * Create a Kubernetes configuration map that contains:
|
23 | 28 | * Override templates (also known as situational configuration templates).
|
24 | 29 | * A file named `version.txt` that contains the string `2.0`.
|
25 | 30 | * Set your domain resource `configOverrides` to the name of this configuration map.
|
26 | 31 | * Create Kubernetes secrets that contain template macro values.
|
27 |
| -* Set your domain `configOverrideSecrets` to reference the aforementioned secrets. See the example below. |
28 |
| -* Start or restart your domain. |
| 32 | +* Set your domain `configOverrideSecrets` to reference the aforementioned secrets. |
| 33 | +* Stop all running WebLogic server pods in your domain. (See [Server Lifecycle](server-lifecycle.md).) |
| 34 | +* Start or restart your domain. (See [Server Lifecycle](server-lifecycle.md).) |
29 | 35 |
|
30 |
| -Example: |
31 |
| -``` |
32 |
| -apiVersion: "weblogic.oracle/v2" |
33 |
| -kind: Domain |
34 |
| -metadata: |
35 |
| - name: domain1 |
36 |
| - namespace: default |
37 |
| - labels: |
38 |
| - weblogic.resourceVersion: domain-v2 |
39 |
| - weblogic.domainUID: domain1 |
40 |
| -spec: |
41 |
| - [ ... ] |
42 |
| - webLogicCredentialsSecret: |
43 |
| - name: domain1-wl-credentials-secret |
44 |
| - configOverrides: domain1-overrides-config-map |
45 |
| - configOverrideSecrets: [domain1-overrides-db1-secret, domain1-config-jms1-secret] |
46 |
| - [ ... ] |
47 |
| -``` |
| 36 | +For a detailed walk-through of these steps, [Step-by-step guide](#step-by-step-guide). |
48 | 37 |
|
49 | 38 | ## How do overrides work during runtime?
|
50 |
| -* When a domain is first deployed, or is restarted, the operator will: |
| 39 | +* When a domain is first deployed, or is restarted after shutting down all WebLogic server pods, the operator will: |
51 | 40 | * Resolve any macros in your override templates.
|
52 | 41 | * Place expanded override templates in the `optconfig` directory located in each WebLogic domain home directory.
|
53 | 42 | * When the WebLogic Servers start, they will:
|
54 | 43 | * Automatically load the override files from the `optconfig` directory.
|
55 | 44 | * Use the override values in the override files instead of the values specified in their `config.xml` or system resource XML files.
|
56 | 45 |
|
57 |
| -You can use overrides to customize domains as they are moved from QA to production, are deployed to different sites, or are even deployed multiple times at the same site. |
58 |
| - |
59 | 46 | ---
|
60 | 47 | # Prerequisites
|
61 | 48 |
|
@@ -264,8 +251,35 @@ The following `jdbc-testDS.xml` override template demonstrates setting the URL,
|
264 | 251 | * Configure the names of each secret in domain CR.
|
265 | 252 | * If the secret contains the WebLogic admin `username` and `password` keys, set the domain CR `webLogicCredentialsSecret` field.
|
266 | 253 | * For all other secrets, add them to domain CR `configOverrideSecrets` field.
|
| 254 | +* Stop all running WebLogic server pods in your domain. (See [Server Lifecycle](server-lifecycle.md).) |
| 255 | +* Start or restart your domain. (See [Server Lifecycle](server-lifecycle.md).) |
267 | 256 | * See [Debugging](#debugging) for ways to check if the situational configuration is taking effect or if there are errors.
|
268 | 257 |
|
| 258 | +**IMPORTANT: Custom override changes, such as updating an override configuration map, a secret, or a domain resource, will not take effect until all running WebLogic server pods in your domain are shutdown (so no servers are left running), and the domain is subsequently restarted.** |
| 259 | +
|
| 260 | +**IMPORTANT: Incorrectly formatted override files are 'somewhat' silently ignored. WebLogic Servers log errors or warnings when they detect an incorrectly formatted configuration override template file, but will still boot, and will skip overriding. So it is important to make sure template files are correct in a QA environment by checking your WebLogic pod logs for situational configuration errors and warnings, before attempting to use them in production.** |
| 261 | +
|
| 262 | +
|
| 263 | +Example domain resource yaml: |
| 264 | +``` |
| 265 | +apiVersion: "weblogic.oracle/v2" |
| 266 | +kind: Domain |
| 267 | +metadata: |
| 268 | + name: domain1 |
| 269 | + namespace: default |
| 270 | + labels: |
| 271 | + weblogic.resourceVersion: domain-v2 |
| 272 | + weblogic.domainUID: domain1 |
| 273 | +spec: |
| 274 | + [ ... ] |
| 275 | + webLogicCredentialsSecret: |
| 276 | + name: domain1-wl-credentials-secret |
| 277 | + configOverrides: domain1-overrides-config-map |
| 278 | + configOverrideSecrets: [my-secret, my-other-secret] |
| 279 | + [ ... ] |
| 280 | +``` |
| 281 | +
|
| 282 | +
|
269 | 283 | ---
|
270 | 284 | # Debugging
|
271 | 285 |
|
@@ -307,9 +321,9 @@ The following `jdbc-testDS.xml` override template demonstrates setting the URL,
|
307 | 321 | -Dweblogic.debug.DebugSituationalConfigDumpXml=true
|
308 | 322 | ```
|
309 | 323 |
|
310 |
| -**IMPORTANT: Custom override changes, such as updating an override configuration map, a secret, or a domain resource, will not take effect until your domain is restarted.** |
| 324 | +**IMPORTANT: Custom override changes, such as updating an override configuration map, a secret, or a domain resource, will not take effect until all running WebLogic server pods in your domain are shutdown (so no servers are left running), and the domain is subsequently restarted.** |
311 | 325 |
|
312 |
| -**IMPORTANT: Incorrectly formatted override files are 'somewhat' silently ignored. WebLogic Servers log errors or warnings, but will still boot, and will skip overriding, when they detect an incorrectly formatted configuration override template file. So it is important to make sure template files are correct in a QA environment by checking your WebLogic pod logs for situational configuration errors and warnings, before attempting to use them in production.** |
| 326 | +**IMPORTANT: Incorrectly formatted override files are 'somewhat' silently ignored. WebLogic Servers log errors or warnings when they detect an incorrectly formatted configuration override template file, but will still boot, and will skip overriding. So it is important to make sure template files are correct in a QA environment by checking your WebLogic pod logs for situational configuration errors and warnings, before attempting to use them in production.** |
313 | 327 |
|
314 | 328 | ---
|
315 | 329 | # Internal design flow
|
|
0 commit comments