|
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?
|
| 27 | + |
| 28 | +* Make sure your domain home meets the prerequisites. See [Prerequisites](#prerequisites). |
| 29 | +* Make sure your overrides are supported. See [Typical overrides](#typical-overrides) and [Unsupported overrides](#unsupported-overrides). |
22 | 30 | * Create a Kubernetes configuration map that contains:
|
23 |
| - * Override templates (also known as situational configuration templates). |
| 31 | + * Override templates (also known as situational configuration templates), with names and syntax as described in [Override template names and syntax](#override-template-names-and-syntax). |
24 | 32 | * A file named `version.txt` that contains the string `2.0`.
|
25 | 33 | * Set your domain resource `configOverrides` to the name of this configuration map.
|
26 | 34 | * 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. |
| 35 | +* Set your domain `configOverrideSecrets` to reference the aforementioned secrets. |
| 36 | +* Stop all running WebLogic Server pods in your domain. (See [Server Lifecycle](server-lifecycle.md).) |
| 37 | +* Start or restart your domain. (See [Server Lifecycle](server-lifecycle.md).) |
29 | 38 |
|
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 |
| -``` |
| 39 | +For a detailed walk-through of these steps, see the [Step-by-step guide](#step-by-step-guide). |
48 | 40 |
|
49 | 41 | ## How do overrides work during runtime?
|
50 |
| -* When a domain is first deployed, or is restarted, the operator will: |
| 42 | + |
| 43 | +* When a domain is first deployed, or is restarted after shutting down all the WebLogic Server pods, the operator will: |
51 | 44 | * Resolve any macros in your override templates.
|
52 | 45 | * Place expanded override templates in the `optconfig` directory located in each WebLogic domain home directory.
|
53 | 46 | * When the WebLogic Servers start, they will:
|
54 | 47 | * Automatically load the override files from the `optconfig` directory.
|
55 | 48 | * Use the override values in the override files instead of the values specified in their `config.xml` or system resource XML files.
|
56 | 49 |
|
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. |
| 50 | +For a detailed walk-through of the runtime flow, see the [Internal design flow](#internal-design-flow). |
58 | 51 |
|
59 | 52 | ---
|
60 | 53 | # Prerequisites
|
@@ -178,7 +171,7 @@ Two types of macros are supported `environment variable macros` and `secret macr
|
178 | 171 |
|
179 | 172 | * Secret macros have the syntax `${secret:SECRETNAME.SECRETKEY}` and `${secret:SECRETNAME.SECRETKEY:encrypt}`.
|
180 | 173 |
|
181 |
| -The secret macro `SECRETNAME` field must reference the name of a Kubernetes secret, and the `SECRETKEY` field must reference a key within that secret. For example, if you have created a secret named `dbuser` with a key named `username` that contains the value `scott`, then the macro `${secret:dbuser.username}` will be replaced with the word `scott` before the template is copied into its WebLogic server pod. |
| 174 | +The secret macro `SECRETNAME` field must reference the name of a Kubernetes secret, and the `SECRETKEY` field must reference a key within that secret. For example, if you have created a secret named `dbuser` with a key named `username` that contains the value `scott`, then the macro `${secret:dbuser.username}` will be replaced with the word `scott` before the template is copied into its WebLogic Server pod. |
182 | 175 |
|
183 | 176 | **SECURITY NOTE: Use the `:encrypt` suffix in a secret macro to encrypt its replacement value with the WebLogic WLST `encrypt` command (instead of leaving it at its plain text value). This is useful for overriding MBean attributes that expect encrypted values, such as the `password-encrypted` field of a data source, and is also useful for ensuring that a custom override situational configuration file the operator places in the domain home does not expose passwords in plain-text.**
|
184 | 177 |
|
@@ -237,6 +230,8 @@ The following `jdbc-testDS.xml` override template demonstrates setting the URL,
|
237 | 230 | ---
|
238 | 231 | # Step-by-step guide
|
239 | 232 |
|
| 233 | +* Make sure your domain home meets the prerequisites. See [Prerequisites](#prerequisites). |
| 234 | +* Make sure your overrides are supported. See [Typical overrides](#typical-overrides) and [Unsupported overrides](#unsupported-overrides). |
240 | 235 | * Create a directory containing (A) a set of situational configuration templates for overriding the MBean properties you want to replace and (B) a `version.txt` file.
|
241 | 236 | * This directory must not contain any other files.
|
242 | 237 | * The `version.txt` file must contain only the string `2.0`.
|
@@ -264,8 +259,34 @@ The following `jdbc-testDS.xml` override template demonstrates setting the URL,
|
264 | 259 | * Configure the names of each secret in domain CR.
|
265 | 260 | * If the secret contains the WebLogic admin `username` and `password` keys, set the domain CR `webLogicCredentialsSecret` field.
|
266 | 261 | * For all other secrets, add them to domain CR `configOverrideSecrets` field.
|
| 262 | +* Stop all running WebLogic Server pods in your domain. (See [Server Lifecycle](server-lifecycle.md).) |
| 263 | +* Start or restart your domain. (See [Server Lifecycle](server-lifecycle.md).) |
267 | 264 | * See [Debugging](#debugging) for ways to check if the situational configuration is taking effect or if there are errors.
|
268 | 265 |
|
| 266 | +**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.** |
| 267 | +
|
| 268 | +**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 that the 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.** |
| 269 | +
|
| 270 | +
|
| 271 | +Example domain resource yaml: |
| 272 | +``` |
| 273 | +apiVersion: "weblogic.oracle/v2" |
| 274 | +kind: Domain |
| 275 | +metadata: |
| 276 | + name: domain1 |
| 277 | + namespace: default |
| 278 | + labels: |
| 279 | + weblogic.resourceVersion: domain-v2 |
| 280 | + weblogic.domainUID: domain1 |
| 281 | +spec: |
| 282 | + [ ... ] |
| 283 | + webLogicCredentialsSecret: |
| 284 | + name: domain1-wl-credentials-secret |
| 285 | + configOverrides: domain1-overrides-config-map |
| 286 | + configOverrideSecrets: [my-secret, my-other-secret] |
| 287 | + [ ... ] |
| 288 | +``` |
| 289 | +
|
269 | 290 | ---
|
270 | 291 | # Debugging
|
271 | 292 |
|
@@ -307,9 +328,9 @@ The following `jdbc-testDS.xml` override template demonstrates setting the URL,
|
307 | 328 | -Dweblogic.debug.DebugSituationalConfigDumpXml=true
|
308 | 329 | ```
|
309 | 330 |
|
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.** |
| 331 | +**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 | 332 |
|
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.** |
| 333 | +**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 that the 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 | 334 |
|
314 | 335 | ---
|
315 | 336 | # Internal design flow
|
|
0 commit comments