Skip to content

Commit 86b7be9

Browse files
authored
Merge pull request #771 from oracle/config-overrides-doc-update
doc update: further emphasize need to restart domain after custom override changes
2 parents 10c7f51 + be62fe2 commit 86b7be9

File tree

1 file changed

+47
-26
lines changed

1 file changed

+47
-26
lines changed

site/config-overrides.md

Lines changed: 47 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,9 @@
77
* [Typical overrides](#typical-overrides)
88
* [Unsupported overrides](#unsupported-overrides)
99
* [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)
1013
* [Step-by-step guide](#step-by-step-guide)
1114
* [Debugging](#debugging)
1215
* [Internal design flow](#internal-design-flow)
@@ -18,43 +21,33 @@
1821

1922
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.
2023

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+
2126
## 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).
2230
* 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).
2432
* A file named `version.txt` that contains the string `2.0`.
2533
* Set your domain resource `configOverrides` to the name of this configuration map.
2634
* 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).)
2938

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).
4840

4941
## 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:
5144
* Resolve any macros in your override templates.
5245
* Place expanded override templates in the `optconfig` directory located in each WebLogic domain home directory.
5346
* When the WebLogic Servers start, they will:
5447
* Automatically load the override files from the `optconfig` directory.
5548
* Use the override values in the override files instead of the values specified in their `config.xml` or system resource XML files.
5649

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).
5851

5952
---
6053
# Prerequisites
@@ -178,7 +171,7 @@ Two types of macros are supported `environment variable macros` and `secret macr
178171

179172
* Secret macros have the syntax `${secret:SECRETNAME.SECRETKEY}` and `${secret:SECRETNAME.SECRETKEY:encrypt}`.
180173

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.
182175

183176
**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.**
184177

@@ -237,6 +230,8 @@ The following `jdbc-testDS.xml` override template demonstrates setting the URL,
237230
---
238231
# Step-by-step guide
239232

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).
240235
* 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.
241236
* This directory must not contain any other files.
242237
* 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,
264259
* Configure the names of each secret in domain CR.
265260
* If the secret contains the WebLogic admin `username` and `password` keys, set the domain CR `webLogicCredentialsSecret` field.
266261
* 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).)
267264
* See [Debugging](#debugging) for ways to check if the situational configuration is taking effect or if there are errors.
268265
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+
269290
---
270291
# Debugging
271292
@@ -307,9 +328,9 @@ The following `jdbc-testDS.xml` override template demonstrates setting the URL,
307328
-Dweblogic.debug.DebugSituationalConfigDumpXml=true
308329
```
309330
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.**
311332
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.**
313334
314335
---
315336
# Internal design flow

0 commit comments

Comments
 (0)