Skip to content

Commit 5360761

Browse files
committed
Merge remote-tracking branch 'origin/develop' into no-wercker
2 parents 8d5debf + fc55038 commit 5360761

File tree

3 files changed

+33
-10
lines changed

3 files changed

+33
-10
lines changed

docs-source/content/userguide/managing-domains/configoverrides/_index.md

Lines changed: 18 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -87,13 +87,15 @@ Typical attributes for overrides include:
8787
* Server and domain log locations
8888
* Node Manager related configuration
8989
* Changing any existing MBean name
90+
* Adding or removing a module (for example, a JDBC module)
9091

9192
**Specifically, do not use custom overrides for:**
9293

9394
* Adding or removing:
9495
* Servers
9596
* Clusters
9697
* Network Access Points (custom channels)
98+
* Modules
9799
* Changing any of the following:
98100
* Dynamic cluster size
99101
* Default, SSL, and Admin channel `Enabled`, listen address, and port
@@ -122,7 +124,7 @@ The operator requires a different file name format for override templates than W
122124
| JDBC module | `jdbc-MODULENAME.xml` |
123125
| Diagnostics module | `diagnostics-MODULENAME.xml` |
124126

125-
A `MODULENAME` must correspond to the MBean name of a system resource defined in your original `config.xml` file.
127+
A `MODULENAME` must correspond to the MBean name of a system resource defined in your original `config.xml` file. It's not possible to add a new module by using overrides. If you need your overrides to set up a new module, then have your original configuration specify 'skeleton' modules that can be overridden.
126128

127129
#### Override template schemas
128130

@@ -184,24 +186,28 @@ The secret macro `SECRETNAME` field must reference the name of a Kubernetes secr
184186

185187
#### Override template syntax special requirements
186188

187-
**Check each item below to ensure custom situational configuration takes effect:**
189+
**Check each item below for best practices and to ensure custom situational configuration takes effect:**
188190

189191
* Reference the name of the current bean and each parent bean in any hierarchy you override.
190192
* Note that the `combine-mode` verbs (`add` and `replace`) should be omitted for beans that are already defined in your original domain home configuration.
191-
* See [Override template samples](#override-template-samples) for examples.
193+
* See [Override template samples](#override-template-samples) for examples.
192194
* Use situational config `replace` and `add` verbs as follows:
193195
* If you are adding a new bean that doesn't already exist in your original domain home `config.xml`, then specify `add` on the MBean itself and on each attribute within the bean.
194196
* See the `server-debug` stanza in [Override template samples](#override-template-samples) for an example.
195197
* If you are adding a new attribute to an existing bean in the domain home `config.xml`, then the attribute needs an `add` verb.
196198
* See the `max-message-size` stanza in [Override template samples](#override-template-samples) for an example.
197199
* If you are changing the value of an existing attribute within a domain home `config.xml`, then the attribute needs a `replace` verb.
198-
* See the `public-address` stanza in [Override template samples](#override-template-samples) for an example.
200+
* See the `public-address` stanza in [Override template samples](#override-template-samples) for an example.
199201
* When overriding `config.xml`:
200202
* The XML namespace (`xmlns:` in the XML) must be exactly as specified in [Override template schemas](#override-template-schemas).
201203
* For example, use `d:` to reference `config.xml` beans and attributes, `f:` for `add` and `replace` `domain-fragment` verbs, and `s:` to reference the situational configuration schema.
202204
* Avoid specifying the domain name stanza, as this may cause some overrides to be ignored (for example, server-template scoped overrides).
203205
* When overriding modules:
204206
* It is a best practice to use XML namespace abbreviations `jms:`, `jdbc:`, and `wldf:` respectively for JMS, JDBC, and WLDF (diagnostics) module override files.
207+
* A module must already exist in your original configuration if you want to override it; it's not possible to add a new module by using overrides. If you need your overrides to set up a new module, then have your original configuration specify 'skeleton' modules that can be overridden.
208+
* See [Overriding a data source module](#overriding-a-data-source-module) for best practice advice. Note that similar advice applies generally to other module types.
209+
* Consider having your original configuration reference invalid user names, passwords, and URLs:
210+
* If your original (non-overridden) configuration references non-working user names, passwords, and URLS, then this helps guard against accidentally deploying a working configuration that's invalid for the intended environment. For example, if your base configuration references a working QA database, and there is some mistake in setting up overrides, then it's possible the running servers will connect to the QA database when you deploy to your production environment.
205211

206212
#### Override template samples
207213

@@ -238,8 +244,13 @@ The following `config.xml` override file demonstrates:
238244

239245
#### Overriding a data source module
240246

241-
The following `jdbc-testDS.xml` override template demonstrates setting the URL, user name, and password-encrypted fields of a JDBC module named `testDS` via `secret macros`. The generated situational configuration that replaces the macros with secret values will be located in the `DOMAIN_HOME/optconfig/jdbc` directory. The `password-encrypted` field will be populated with an encrypted value because it uses a secret macro with an `:encrypt` suffix. The secret is named `dbsecret` and contains three keys: `url`, `username`, and `password`.
247+
The following `jdbc-testDS.xml` override template demonstrates setting the URL, user name, and password-encrypted fields of a JDBC module named `testDS` by using `secret macros`. The generated situational configuration that replaces the macros with secret values will be located in the `DOMAIN_HOME/optconfig/jdbc` directory. The `password-encrypted` field will be populated with an encrypted value because it uses a secret macro with an `:encrypt` suffix. The secret is named `dbsecret` and contains three keys: `url`, `username`, and `password`.
242248

249+
Best practices for data source modules and their overrides:
250+
251+
* A data source module must already exist in your original configuration if you want to override it; it's not possible to add a new module by using overrides. If you need your overrides to set up a new module, then have your original configuration specify 'skeleton' modules that can be overridden. See the next two bulleted items for the typical contents of a skeleton data source module.
252+
* Set your original (non-overridden) URL, username, and password to invalid values. This helps prevent accidentally starting a server without overrides, and then having the data source successfully connect to a database that's wrong for the current environment. For example, if these attributes are set to reference a QA database in your original configuration, then a mistake configuring overrides in your production Kubernetes deployment could cause your production applications to use your QA database.
253+
* Set your original (non-overridden) `JDBCConnectionPoolParams` `MinCapacity` and `InitialCapacity` to `0`, and set your original `DriverName` to a reference an existing JDBC Driver. This ensures that you can still successfully boot a server even when you have configured invalid URL/username/password values, your database isn't running, and/or you haven't specified your overrides yet.
243254

244255
```
245256
<?xml version='1.0' encoding='UTF-8'?>
@@ -282,7 +293,7 @@ The following `jdbc-testDS.xml` override template demonstrates setting the URL,
282293
kubectl -n MYNAMESPACE label cm MYCMNAME weblogic.domainUID=DOMAIN_UID
283294
```
284295
* Create any Kubernetes secrets referenced by a template 'secret macro'.
285-
* Secrets can have multiple keys (files) that can hold either cleartext or base64 values. We recommend that you use base64 values for passwords via `Opaque` type secrets in their `data` field, so that they can't be easily read at a casual glance. For more information, see https://kubernetes.io/docs/concepts/configuration/secret/.
296+
* Secrets can have multiple keys (files) that can hold either cleartext or base64 values. We recommend that you use base64 values for passwords by using `Opaque` type secrets in their `data` field, so that they can't be easily read at a casual glance. For more information, see https://kubernetes.io/docs/concepts/configuration/secret/.
286297
* Secrets must be in the same Kubernetes namespace as the domain.
287298
* If a secret is going to be used by a single `DOMAIN_UID`, then we recommend adding the `weblogic.domainUID=<mydomainuid>` label to help track the resource.
288299
* For example:
@@ -382,7 +393,7 @@ Incorrectly formatted override files may be accepted without warnings or errors
382393
383394
* When a domain is first deployed, or is restarted, the operator runtime creates an introspector Kubernetes job named `DOMAIN_UID-introspect-domain-job`.
384395
* The introspector job's pod:
385-
* Mounts the Kubernetes configuration map and secrets specified via the operator domain resource `configOverrides`, `webLogicCredentialsSecret`, and `configOverrideSecrets` fields.
396+
* Mounts the Kubernetes configuration map and secrets specified by using the operator domain resource `configOverrides`, `webLogicCredentialsSecret`, and `configOverrideSecrets` fields.
386397
* Reads the mounted situational configuration templates from the configuration map and expands them to create the actual situational configuration files for the domain:
387398
* It expands some fixed replaceable values (for example, `${env:DOMAIN_UID}`).
388399
* It expands referenced secrets by reading the value from the corresponding mounted secret file (for example, `${secret:mysecret.mykey}`).

integration-tests/src/test/java/oracle/kubernetes/operator/utils/Domain.java

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1354,9 +1354,15 @@ private void initialize(Map<String, Object> inputDomainMap) throws Exception {
13541354
}
13551355

13561356
if (domainMap.containsKey("domainHomeImageBuildPath")) {
1357-
domainHomeImageBuildPath = ((String) domainMap.get("domainHomeImageBuildPath")).trim();
1357+
domainHomeImageBuildPath =
1358+
BaseTest.getResultDir()
1359+
+ "/"
1360+
+ ((String) domainMap.get("domainHomeImageBuildPath")).trim();
13581361
domainMap.put(
1359-
"domainHomeImageBuildPath", BaseTest.getResultDir() + "/" + domainHomeImageBuildPath);
1362+
"domainHomeImageBuildPath",
1363+
BaseTest.getResultDir()
1364+
+ "/"
1365+
+ ((String) domainMap.get("domainHomeImageBuildPath")).trim());
13601366
}
13611367
if (System.getenv("IMAGE_PULL_SECRET_WEBLOGIC") != null) {
13621368
domainMap.put("imagePullSecretName", System.getenv("IMAGE_PULL_SECRET_WEBLOGIC"));

integration-tests/src/test/java/oracle/kubernetes/operator/utils/Operator.java

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -378,7 +378,13 @@ private void generateInputYaml() throws Exception {
378378
sb.append(operatorNS);
379379
break;
380380
}
381-
sb.append(" DNS:");
381+
// here we are assuming that if the "host name" starts with a digit, then it is actually
382+
// an IP address, and so we need to use the "IP" prefix in the SANS.
383+
if (Character.isDigit(TestUtils.getHostName().charAt(0))) {
384+
sb.append(" IP:");
385+
} else {
386+
sb.append(" DNS:");
387+
}
382388
sb.append(TestUtils.getHostName());
383389
sb.append(" >> ");
384390
sb.append(generatedInputYamlFile);

0 commit comments

Comments
 (0)