From 799e8ef8f470f0493fa796347477a6df6843204e Mon Sep 17 00:00:00 2001 From: Anil Kedia Date: Thu, 22 Jul 2021 16:30:52 +0000 Subject: [PATCH 1/8] OWLS-90955 - Document expected file merge order for auxiliary images at a particular scope and at different scopes. --- .../model-in-image/auxiliary-images.md | 84 +++++++++++++++++++ .../model-in-image/model-files.md | 2 +- 2 files changed, 85 insertions(+), 1 deletion(-) diff --git a/documentation/staging/content/userguide/managing-domains/model-in-image/auxiliary-images.md b/documentation/staging/content/userguide/managing-domains/model-in-image/auxiliary-images.md index c2e2e235c99..2c8048b6423 100644 --- a/documentation/staging/content/userguide/managing-domains/model-in-image/auxiliary-images.md +++ b/documentation/staging/content/userguide/managing-domains/model-in-image/auxiliary-images.md @@ -14,6 +14,7 @@ description = "Auxiliary images are an alternative approach for supplying a doma - [Auxiliary images](#auxiliary-images) - [Auxiliary volumes and paths](#auxiliary-volumes-and-paths) - [Model in Image paths](#model-in-image-paths) + - [Auxiliary images file loading order](#auxiliary-images-file-loading-order) - [Sample](#sample) - [Step 1: Prerequisites](#step-1-prerequisites) - [Step 2: Create the auxiliary image](#step-2-create-the-auxiliary-image) @@ -22,6 +23,16 @@ description = "Auxiliary images are an alternative approach for supplying a doma ### Introduction +{{% notice warning %}} +The auxiliary images feature is a work in progress and is currently unsupported. +Its configuration or behavior may change between releases and it is disabled by default. +If you want to enable this feature, then set your operator's `"featureGates"` +Helm configuration attribute to include `"AuxiliaryImage=true"`. +The `"featureGates"` attribute acknowledges use of an unsupported feature, +will not be required after auxiliary images are fully supported, +defaults to being unset, and accepts a comma-separated list. +{{% /notice %}} + Auxiliary images are an alternative approach for including Model in Image model files, application archive files, WebLogic Deploying Tooling installation files, or other types of files, in your pods. @@ -123,6 +134,79 @@ respectively, and must be changed to specify a directory in wdtInstallHome: "/auxiliary/weblogic-deploy" ``` +### File merge order +Refer to this section if you need to control the order in which files from auxiliary images +are included in the Pod's main container. + +If you specify multiple auxiliary images at a particular scope, then the files from those +images will be included in the order in which images appear under `serverPod.auxiliaryImages`. +If you specify the multiple auxiliary images at the different scopes, then the files from the +auxiliary images specified at the domain scope will be included first, the files from the auxiliary +images at the WebLogic cluster scope will be included next and finally, the files from auxiliary images +at the server scope will be included. +If you have the same files (under the same mountPath) in these auxiliary images, then the files from the +auxiliary image at the WebLogic cluster scope will override the same files from the auxiliary image at the +domain scope. Similarly, files from the auxiliary images at the server scope will +override the same files from the auxiliary image at the WebLogic cluster scope. + +If you have overlapping directories under the `mountPath` of different auxiliary images, +then the directories from the auxiliary images that are loaded last will overwrite the directories +from the previously loaded auxiliary images. If this is not your intention, then you can customize +the `copyCommand` for the auxiliary image. E.g. you can save the directory created from a previous +auxiliary image before performing a recursive copy. To save a previously created directory `mydir` +under `mountPath` with name `mydir_v1`, you can do this: +``` +mv $TARGET_MOUNT_PATH/mydir $TARGET_MOUNT_PATH/mydir_v1; cp -R $COMMON_MOUNT_PATH/mydir/* $TARGET_MOUNT_PATH/mydir +``` + +If you have two or more model files that refer to the same configuration provided in the same auxiliary +image or multiple auxiliary images, refer to +[Model file naming and loading order]({{< relref "/userguide/managing-domains/model-in-image/model-files#model-file-naming-and-loading-order">}}) +for model files loading order. + +For example, if you have these auxiliary images are defined at the domain, the WebLogic cluster, +and the server scope (myserver is part of the mycluster). + +``` +apiVersion: "weblogic.oracle/v8" +kind: Domain +metadata: + name: sample-domain1 + namespace: sample-domain1-ns + labels: + weblogic.domainUID: sample-domain1 +spec: + serverPod: + auxiliaryImages: + - image: model-in-image:v1 + volume: auxiliaryImageVolume1 + - image: app-image:v1 + volume: auxiliaryImageVolume1 + cluster: + - name: mycluster + serverPod: + auxiliaryImages: + - image: model-in-image:v2 + volume: auxiliaryImageVolume1 + - image: second-app-image:v1 + volume: auxiliaryImageVolume1 + managedServers: + - serverName: "myserver" + serverPod: + auxiliaryImages: + - image: app-image:v2 + volume: auxiliaryImageVolume1 + +``` +Then the files from different auxiliary images will be included in the below order. + +``` +model-in-image:v1 (first) +app-image:v1 +model-in-image:v2 +second-app-image:v1 +app-image:v2 (last) +``` ### Sample This sample demonstrates deploying a Model in Image domain that uses diff --git a/documentation/staging/content/userguide/managing-domains/model-in-image/model-files.md b/documentation/staging/content/userguide/managing-domains/model-in-image/model-files.md index 32df856f541..50b55f59353 100644 --- a/documentation/staging/content/userguide/managing-domains/model-in-image/model-files.md +++ b/documentation/staging/content/userguide/managing-domains/model-in-image/model-files.md @@ -90,7 +90,7 @@ For a description of model file macro references to secrets and environment vari Refer to this section if you need to control the order in which your model files are loaded. The order is important when two or more model files refer to the same configuration, because the last model that's loaded has the highest precedence. -During domain home creation, model, and property files are first loaded from the `configuration.models.modelHome` directory within the image, which defaults to `/u01/wdt/models`, and are then loaded from the optional WDT ConfigMap, described in [Optional WDT model ConfigMap]({{< relref "/userguide/managing-domains/model-in-image/usage/_index.md#optional-wdt-model-configmap" >}}). +During domain home creation, model, and property files are first loaded from the `configuration.models.modelHome` directory within the image, which defaults to `/u01/wdt/models`, and are then loaded from the optional WDT ConfigMap, described in [Optional WDT model ConfigMap]({{< relref "/userguide/managing-domains/model-in-image/usage/_index.md#optional-wdt-model-configmap" >}}). If the model, and property files are supplied using [Auxiliary images]({{< relref "/userguide/managing-domains/model-in-image/auxiliary-images.md" >}}), then see [Auxiliary images file loading order]({{< relref "/userguide/managing-domains/model-in-image/auxiliary-images#auxiliary-images-file-loading-order" >}}) for order in which auxiliary images are loaded. The loading order within each of these locations is first determined using the convention `filename.##.yaml` and `filename.##.properties`, where `##` are digits that specify the desired order when sorted numerically. Additional details: From be90e3ca7b91aca7448ff5c8fcd984c6fa950768 Mon Sep 17 00:00:00 2001 From: Anil Kedia Date: Thu, 22 Jul 2021 16:34:58 +0000 Subject: [PATCH 2/8] Fix table of contents and remove warning. --- .../model-in-image/auxiliary-images.md | 13 +------------ 1 file changed, 1 insertion(+), 12 deletions(-) diff --git a/documentation/staging/content/userguide/managing-domains/model-in-image/auxiliary-images.md b/documentation/staging/content/userguide/managing-domains/model-in-image/auxiliary-images.md index 2c8048b6423..ad73a867843 100644 --- a/documentation/staging/content/userguide/managing-domains/model-in-image/auxiliary-images.md +++ b/documentation/staging/content/userguide/managing-domains/model-in-image/auxiliary-images.md @@ -14,7 +14,7 @@ description = "Auxiliary images are an alternative approach for supplying a doma - [Auxiliary images](#auxiliary-images) - [Auxiliary volumes and paths](#auxiliary-volumes-and-paths) - [Model in Image paths](#model-in-image-paths) - - [Auxiliary images file loading order](#auxiliary-images-file-loading-order) + - [File merge order](#file-merge-order) - [Sample](#sample) - [Step 1: Prerequisites](#step-1-prerequisites) - [Step 2: Create the auxiliary image](#step-2-create-the-auxiliary-image) @@ -22,17 +22,6 @@ description = "Auxiliary images are an alternative approach for supplying a doma - [Step 4: Invoke the web application](#step-4-invoke-the-web-application) ### Introduction - -{{% notice warning %}} -The auxiliary images feature is a work in progress and is currently unsupported. -Its configuration or behavior may change between releases and it is disabled by default. -If you want to enable this feature, then set your operator's `"featureGates"` -Helm configuration attribute to include `"AuxiliaryImage=true"`. -The `"featureGates"` attribute acknowledges use of an unsupported feature, -will not be required after auxiliary images are fully supported, -defaults to being unset, and accepts a comma-separated list. -{{% /notice %}} - Auxiliary images are an alternative approach for including Model in Image model files, application archive files, WebLogic Deploying Tooling installation files, or other types of files, in your pods. From 1773f93ae161abe79a4842ec80adeecab807f331 Mon Sep 17 00:00:00 2001 From: Anil Kedia Date: Thu, 22 Jul 2021 16:42:12 +0000 Subject: [PATCH 3/8] Minor fix. --- .../userguide/managing-domains/model-in-image/model-files.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/documentation/staging/content/userguide/managing-domains/model-in-image/model-files.md b/documentation/staging/content/userguide/managing-domains/model-in-image/model-files.md index 50b55f59353..844ecba9297 100644 --- a/documentation/staging/content/userguide/managing-domains/model-in-image/model-files.md +++ b/documentation/staging/content/userguide/managing-domains/model-in-image/model-files.md @@ -90,7 +90,7 @@ For a description of model file macro references to secrets and environment vari Refer to this section if you need to control the order in which your model files are loaded. The order is important when two or more model files refer to the same configuration, because the last model that's loaded has the highest precedence. -During domain home creation, model, and property files are first loaded from the `configuration.models.modelHome` directory within the image, which defaults to `/u01/wdt/models`, and are then loaded from the optional WDT ConfigMap, described in [Optional WDT model ConfigMap]({{< relref "/userguide/managing-domains/model-in-image/usage/_index.md#optional-wdt-model-configmap" >}}). If the model, and property files are supplied using [Auxiliary images]({{< relref "/userguide/managing-domains/model-in-image/auxiliary-images.md" >}}), then see [Auxiliary images file loading order]({{< relref "/userguide/managing-domains/model-in-image/auxiliary-images#auxiliary-images-file-loading-order" >}}) for order in which auxiliary images are loaded. +During domain home creation, model, and property files are first loaded from the `configuration.models.modelHome` directory within the image, which defaults to `/u01/wdt/models`, and are then loaded from the optional WDT ConfigMap, described in [Optional WDT model ConfigMap]({{< relref "/userguide/managing-domains/model-in-image/usage/_index.md#optional-wdt-model-configmap" >}}). If the model, and property files are supplied using [Auxiliary images]({{< relref "/userguide/managing-domains/model-in-image/auxiliary-images.md" >}}), then see [File merge order]({{< relref "/userguide/managing-domains/model-in-image/auxiliary-images#file-merge-order" >}}) for the order in which files from auxiliary images are merged. The loading order within each of these locations is first determined using the convention `filename.##.yaml` and `filename.##.properties`, where `##` are digits that specify the desired order when sorted numerically. Additional details: From 59301fedef4620c5d6c4a44c2cfccb8019b4c8d2 Mon Sep 17 00:00:00 2001 From: Tom Barnes Date: Thu, 22 Jul 2021 21:47:11 +0000 Subject: [PATCH 4/8] aux image merge doc edits --- .../model-in-image/auxiliary-images.md | 222 ++++++++++++------ .../model-in-image/model-files.md | 8 +- 2 files changed, 153 insertions(+), 77 deletions(-) diff --git a/documentation/staging/content/userguide/managing-domains/model-in-image/auxiliary-images.md b/documentation/staging/content/userguide/managing-domains/model-in-image/auxiliary-images.md index ad73a867843..26243315a1a 100644 --- a/documentation/staging/content/userguide/managing-domains/model-in-image/auxiliary-images.md +++ b/documentation/staging/content/userguide/managing-domains/model-in-image/auxiliary-images.md @@ -11,17 +11,21 @@ description = "Auxiliary images are an alternative approach for supplying a doma - [Introduction](#introduction) - [References](#references) - [Configuration](#configuration) - - [Auxiliary images](#auxiliary-images) - [Auxiliary volumes and paths](#auxiliary-volumes-and-paths) + - [Auxiliary images](#auxiliary-images) - [Model in Image paths](#model-in-image-paths) - - [File merge order](#file-merge-order) + - [Merge order](#merge-order) + - [Expected merge order](#expected-merge-order) + - [Performing replaces instead of merges](#performing-replaces-instead-of-merges) + - [Merge ordering example](#merge-ordering-example) - [Sample](#sample) - - [Step 1: Prerequisites](#step-1-prerequisites) - - [Step 2: Create the auxiliary image](#step-2-create-the-auxiliary-image) - - [Step 3: Prepare and apply the domain resource](#step-3-prepare-and-apply-the-domain-resource) - - [Step 4: Invoke the web application](#step-4-invoke-the-web-application) + - [Step 1: Prerequisites](#step-1-prerequisites) + - [Step 2: Create the auxiliary image](#step-2-create-the-auxiliary-image) + - [Step 3: Prepare and apply the domain resource](#step-3-prepare-and-apply-the-domain-resource) + - [Step 4: Invoke the web application](#step-4-invoke-the-web-application) ### Introduction + Auxiliary images are an alternative approach for including Model in Image model files, application archive files, WebLogic Deploying Tooling installation files, or other types of files, in your pods. @@ -67,12 +71,49 @@ from additional images. This section describes a typical auxiliary image configuration for the Model in Image use case. +#### Auxiliary volumes and paths + +A domain resource `domain.spec.auxiliaryImageVolumes` +auxiliary image volume defines a `mountPath`, `name`, plus +[additional optional fields](https://github.com/oracle/weblogic-kubernetes-operator/blob/main/documentation/domains/Domain.md#auxiliary-image-volume). +The `mountPath` field is the location of a directory in an auxiliary image, and +is also the location in the main pod container (which will automatically contain +a recursive copy of the auxiliary image directory). The `name` field is +arbitrary, and is in turn referenced by one or more auxiliary images that +are defined separately using +[Auxiliary images](#auxiliary-images) configuration. + +For example: + +``` + spec: + auxiliaryImageVolumes: + - name: auxiliaryImageVolume1 + mountPath: /auxiliary +``` + #### Auxiliary images -One or more auxiliary images can be configured on a domain resource `serverPod`. +One or more auxiliary images can be configured in a domain resource +`serverPod.auxiliaryImage` array. +Each array entry must define an `image` and `volume` +where `image` is the name of an auxiliary image +and the `volume` is the name of an [auxiliary image volume](#auxiliary-volumes-and-paths) +as described above. +You can optionally also specify an `imagePullPolicy`, +which defaults to `Always` if the `image` ends in `:latest` and to `IfNotPresent`, +otherwise. +You can also optionally customize +the command that is used to merge (copy) the auxiliary image's files +into the auxiliary image volume during pod startup (this is rarely +needed, see [Performing replaces instead of merges](#performing-replaces-instead-of-merges) below for an example). +For details +about each field, see the [schema](https://github.com/oracle/weblogic-kubernetes-operator/blob/main/documentation/domains/Domain.md#auxiliary-image). + A `serverPod` can be defined at the domain scope, which applies to every pod in the domain, plus the introspector job's pod, at a specific WebLogic cluster's scope, -or at a specific WebLogic Server pod's scope. Typically, the domain scope is +or at a specific WebLogic Server pod's scope. +Typically, the domain scope is the most applicable for the Model in Image use case; for example: ``` @@ -89,22 +130,6 @@ If image pull secrets are required for pulling auxiliary images, then the secrets must be referenced using `domain.spec.imagePullSecrets`. {{% /notice %}} -#### Auxiliary volumes and paths - -The `serverPod.auxiliaryImages.volume` field refers to the name of an auxiliary -image volume defined in the `domain.spec.auxiliaryImageVolumes` section, and -an auxiliary image volume, in turn, defines a `mountPath`. The `mountPath` -is the location of a directory in an auxiliary image, and -is also the location in the main pod container (which will automatically contain -a recursive copy of the auxiliary image directory). For example: - -``` - spec: - auxiliaryImageVolumes: - - name: auxiliaryImageVolume1 - mountPath: /auxiliary -``` - #### Model in Image paths For the Model In Image auxiliary image use case, you also need to @@ -123,79 +148,126 @@ respectively, and must be changed to specify a directory in wdtInstallHome: "/auxiliary/weblogic-deploy" ``` -### File merge order -Refer to this section if you need to control the order in which files from auxiliary images -are included in the Pod's main container. - -If you specify multiple auxiliary images at a particular scope, then the files from those -images will be included in the order in which images appear under `serverPod.auxiliaryImages`. -If you specify the multiple auxiliary images at the different scopes, then the files from the -auxiliary images specified at the domain scope will be included first, the files from the auxiliary -images at the WebLogic cluster scope will be included next and finally, the files from auxiliary images -at the server scope will be included. -If you have the same files (under the same mountPath) in these auxiliary images, then the files from the -auxiliary image at the WebLogic cluster scope will override the same files from the auxiliary image at the -domain scope. Similarly, files from the auxiliary images at the server scope will -override the same files from the auxiliary image at the WebLogic cluster scope. - -If you have overlapping directories under the `mountPath` of different auxiliary images, -then the directories from the auxiliary images that are loaded last will overwrite the directories -from the previously loaded auxiliary images. If this is not your intention, then you can customize -the `copyCommand` for the auxiliary image. E.g. you can save the directory created from a previous -auxiliary image before performing a recursive copy. To save a previously created directory `mydir` -under `mountPath` with name `mydir_v1`, you can do this: -``` -mv $TARGET_MOUNT_PATH/mydir $TARGET_MOUNT_PATH/mydir_v1; cp -R $COMMON_MOUNT_PATH/mydir/* $TARGET_MOUNT_PATH/mydir -``` +{{% notice warning %}} +If multiple auxiliary images supply different versions of a WebLogic Deploy Tool installation +to the same `wdtInstallHome` path, then it is recommended +to ensure that the newer version completely replaces the older version +instead of merges with it. See [Performing replaces instead of merges](#performing-replaces-instead-of-merges). +{{% /notice %}} + +### Merge order + +Refer to this section if you need to control the merge order of files from +multiple auxiliary images that all reference the same volume, or if +you want to customize the command that is used to copy the +files from an auxiliary image into its volume. You can +use command customization to force "replace" behavior instead +of merge behavior. + +#### Expected merge order + +By default, the files from multiple auxiliary images that share +the same volume are merged. Specifically: -If you have two or more model files that refer to the same configuration provided in the same auxiliary -image or multiple auxiliary images, refer to +- Files from later images in the merge overwrite same named files from earlier images. + +- The contents of overlapping directories from multiple images are combined. + +The expected merge order for auxiliary images that share +the same auxiliary image volume is: + +- If you specify auxiliary images at different `serverPod` scopes, + and they all share the same volume, then the files from the + domain scope will be merged first, the cluster scope second, + and the server scope last. + +- If you specify multiple auxiliary images at the same scope, + and they all share the same volume, then the files + will be merged in the order in which images appear + under `serverPod.auxiliaryImages`. + +__Note:__ If the results of a merge yield two or more +differently named `domain.spec.configuration.model.ModelHome` model files in +an auxilliary image volume, then refer to [Model file naming and loading order]({{< relref "/userguide/managing-domains/model-in-image/model-files#model-file-naming-and-loading-order">}}) -for model files loading order. +for the model files loading order. + +#### Performing replaces instead of merges + +If multiple auxiliary images share the same volume +and you prefer that a particular same named directory from a later +image completely replaces a directory from a previous +image instead of combining the two directories, +then you can customize the command that the second image uses to populate +the shared volume in order to force a replace. -For example, if you have these auxiliary images are defined at the domain, the WebLogic cluster, -and the server scope (myserver is part of the mycluster). +For example, you can customize the +the second image's `serverPod.auxiliaryImage.command` field +to first delete the directory that was already copied from the +earlier image and then have it perform a normal copy: +```shell +... +spec: + ... + auxiliaryImageVolumes: + - name: aivolume + mountPath: /auxiliary + ... + serverPod: + auxiliaryImages: + - image: domain-image-A:v1 + volume: aivolume + - image: domain-image-B:v1 + volume: aivolume + # the following command replaces 'mydir' instead of merging it: + command: 'rm -fr $TARGET_MOUNT_PATH/mydir; cp -R $COMMON_MOUNT_PATH/* $TARGET_MOUNT_PATH' ``` -apiVersion: "weblogic.oracle/v8" -kind: Domain -metadata: - name: sample-domain1 - namespace: sample-domain1-ns - labels: - weblogic.domainUID: sample-domain1 + +#### Merge ordering example + +Assuming you have auxiliary images are defined at the domain, the WebLogic cluster, +and the server scope (myserver is part of the mycluster): + +``` +... spec: + auxiliaryImageVolumes: + - name: aivolume + mountPath: /auxiliary serverPod: auxiliaryImages: - - image: model-in-image:v1 - volume: auxiliaryImageVolume1 - - image: app-image:v1 - volume: auxiliaryImageVolume1 + - image: domain-image-A:v1 + volume: aivolume + - image: domain-image-B:v1 + volume: aivolume cluster: - name: mycluster serverPod: auxiliaryImages: - - image: model-in-image:v2 - volume: auxiliaryImageVolume1 - - image: second-app-image:v1 - volume: auxiliaryImageVolume1 + - image: cl-image-A:v1 + volume: aivolume + - image: cl-image-B:v1 + volume: aivolume managedServers: - serverName: "myserver" serverPod: auxiliaryImages: - - image: app-image:v2 - volume: auxiliaryImageVolume1 + - image: ms-image-A:v1 + volume: aivolume ``` -Then the files from different auxiliary images will be included in the below order. + +Then the files from the images will be merged into their shared `aivolume` volume `/auxiliary` mount path in the following order: ``` -model-in-image:v1 (first) -app-image:v1 -model-in-image:v2 -second-app-image:v1 +domain-image-A:v1 (first) +domain-image-B:v1 +cl-image-A:v1 +cl-image-B:v1 app-image:v2 (last) ``` + ### Sample This sample demonstrates deploying a Model in Image domain that uses diff --git a/documentation/staging/content/userguide/managing-domains/model-in-image/model-files.md b/documentation/staging/content/userguide/managing-domains/model-in-image/model-files.md index 844ecba9297..ac6e084e82f 100644 --- a/documentation/staging/content/userguide/managing-domains/model-in-image/model-files.md +++ b/documentation/staging/content/userguide/managing-domains/model-in-image/model-files.md @@ -90,7 +90,7 @@ For a description of model file macro references to secrets and environment vari Refer to this section if you need to control the order in which your model files are loaded. The order is important when two or more model files refer to the same configuration, because the last model that's loaded has the highest precedence. -During domain home creation, model, and property files are first loaded from the `configuration.models.modelHome` directory within the image, which defaults to `/u01/wdt/models`, and are then loaded from the optional WDT ConfigMap, described in [Optional WDT model ConfigMap]({{< relref "/userguide/managing-domains/model-in-image/usage/_index.md#optional-wdt-model-configmap" >}}). If the model, and property files are supplied using [Auxiliary images]({{< relref "/userguide/managing-domains/model-in-image/auxiliary-images.md" >}}), then see [File merge order]({{< relref "/userguide/managing-domains/model-in-image/auxiliary-images#file-merge-order" >}}) for the order in which files from auxiliary images are merged. +During domain home creation, model and property files are first loaded from the `configuration.models.modelHome` directory within the image, which defaults to `/u01/wdt/models`. After the `modelHome` files are all loaded, the domain home creation then loads files from the optional WDT ConfigMap, described in [Optional WDT model ConfigMap]({{< relref "/userguide/managing-domains/model-in-image/usage/_index.md#optional-wdt-model-configmap" >}}). If a `modelHome` file and ConfigMap file both have the same name, then both files are loaded. The loading order within each of these locations is first determined using the convention `filename.##.yaml` and `filename.##.properties`, where `##` are digits that specify the desired order when sorted numerically. Additional details: @@ -101,7 +101,11 @@ The loading order within each of these locations is first determined using the c * File names that don't include `.##.` sort _before_ other files as if they implicitly have the lowest possible `.##.` * If two files share the same number, the loading order is determined alphabetically as a tie-breaker. -If an image file and ConfigMap file both have the same name, then both files are loaded. +> Note: If `configuration.models.modelHome` files are supplied by combining multiple +[Auxiliary images]({{< relref "/userguide/managing-domains/model-in-image/auxiliary-images.md" >}}), +then the files in this directory are populated according to their +[Auxiliary image merge order]({{< relref "/userguide/managing-domains/model-in-image/auxiliary-images#file-merge-order" >}}) +before the loading order is determined. For example, if you have these files in the model home directory `/u01/wdt/models`: From 42d758b8f7c656589cd9eac828718b54c2b18f4d Mon Sep 17 00:00:00 2001 From: Anil Kedia Date: Thu, 22 Jul 2021 22:17:00 +0000 Subject: [PATCH 5/8] Merge from owls_90955_edits and a minor edit. --- .../model-in-image/auxiliary-images.md | 2 +- .../weblogic/kubernetes/ItParameterizedDomain.java | 12 ++++++++++-- 2 files changed, 11 insertions(+), 3 deletions(-) diff --git a/documentation/staging/content/userguide/managing-domains/model-in-image/auxiliary-images.md b/documentation/staging/content/userguide/managing-domains/model-in-image/auxiliary-images.md index 26243315a1a..10dcac1db97 100644 --- a/documentation/staging/content/userguide/managing-domains/model-in-image/auxiliary-images.md +++ b/documentation/staging/content/userguide/managing-domains/model-in-image/auxiliary-images.md @@ -265,7 +265,7 @@ domain-image-A:v1 (first) domain-image-B:v1 cl-image-A:v1 cl-image-B:v1 -app-image:v2 (last) +ms-image-A:v1 (last) ``` ### Sample diff --git a/integration-tests/src/test/java/oracle/weblogic/kubernetes/ItParameterizedDomain.java b/integration-tests/src/test/java/oracle/weblogic/kubernetes/ItParameterizedDomain.java index 7fa1aae5351..6b26e722909 100644 --- a/integration-tests/src/test/java/oracle/weblogic/kubernetes/ItParameterizedDomain.java +++ b/integration-tests/src/test/java/oracle/weblogic/kubernetes/ItParameterizedDomain.java @@ -206,6 +206,7 @@ class ItParameterizedDomain { private static String encryptionSecretName = "encryptionsecret"; private static Map resourceRequest = new HashMap<>(); private static Map resourceLimit = new HashMap<>(); + private static Map resourceLimit1 = new HashMap<>(); private String curlCmd = null; @@ -268,9 +269,11 @@ public static void initAll(@Namespaces(6) List namespaces) { // set resource request and limit resourceRequest.put("cpu", new Quantity("250m")); - resourceRequest.put("memory", new Quantity("768Mi")); + resourceRequest.put("memory", new Quantity("256Mi")); resourceLimit.put("cpu", new Quantity("2")); resourceLimit.put("memory", new Quantity("2Gi")); + resourceLimit1.put("cpu", new Quantity("2")); + resourceLimit1.put("memory", new Quantity("256Mi")); // create model in image domain with multiple clusters miiDomain = createMiiDomainWithMultiClusters(miiDomainUid, miiDomainNamespace); @@ -905,7 +908,12 @@ private static Domain createMiiDomainWithMultiClusters(String domainUid, String clusterList.add(new Cluster() .clusterName(CLUSTER_NAME_PREFIX + i) .replicas(replicaCount) - .serverStartState("RUNNING")); + .serverStartState("RUNNING") + .serverPod(new ServerPod() + .resources(new V1ResourceRequirements() + .requests(resourceRequest) + .limits(resourceLimit1))) + ); } // create the domain CR From 852f2d743cd4c21be41d4eb2c449c4445b1454a0 Mon Sep 17 00:00:00 2001 From: Anil Kedia Date: Thu, 22 Jul 2021 22:20:07 +0000 Subject: [PATCH 6/8] Revert unintentional change to ItParameterizedDomain.java. --- .../weblogic/kubernetes/ItParameterizedDomain.java | 12 ++---------- 1 file changed, 2 insertions(+), 10 deletions(-) diff --git a/integration-tests/src/test/java/oracle/weblogic/kubernetes/ItParameterizedDomain.java b/integration-tests/src/test/java/oracle/weblogic/kubernetes/ItParameterizedDomain.java index 6b26e722909..7fa1aae5351 100644 --- a/integration-tests/src/test/java/oracle/weblogic/kubernetes/ItParameterizedDomain.java +++ b/integration-tests/src/test/java/oracle/weblogic/kubernetes/ItParameterizedDomain.java @@ -206,7 +206,6 @@ class ItParameterizedDomain { private static String encryptionSecretName = "encryptionsecret"; private static Map resourceRequest = new HashMap<>(); private static Map resourceLimit = new HashMap<>(); - private static Map resourceLimit1 = new HashMap<>(); private String curlCmd = null; @@ -269,11 +268,9 @@ public static void initAll(@Namespaces(6) List namespaces) { // set resource request and limit resourceRequest.put("cpu", new Quantity("250m")); - resourceRequest.put("memory", new Quantity("256Mi")); + resourceRequest.put("memory", new Quantity("768Mi")); resourceLimit.put("cpu", new Quantity("2")); resourceLimit.put("memory", new Quantity("2Gi")); - resourceLimit1.put("cpu", new Quantity("2")); - resourceLimit1.put("memory", new Quantity("256Mi")); // create model in image domain with multiple clusters miiDomain = createMiiDomainWithMultiClusters(miiDomainUid, miiDomainNamespace); @@ -908,12 +905,7 @@ private static Domain createMiiDomainWithMultiClusters(String domainUid, String clusterList.add(new Cluster() .clusterName(CLUSTER_NAME_PREFIX + i) .replicas(replicaCount) - .serverStartState("RUNNING") - .serverPod(new ServerPod() - .resources(new V1ResourceRequirements() - .requests(resourceRequest) - .limits(resourceLimit1))) - ); + .serverStartState("RUNNING")); } // create the domain CR From f76d78d6ca47328a9b1c67b6de6b32515c28aa4e Mon Sep 17 00:00:00 2001 From: Tom Barnes Date: Fri, 23 Jul 2021 14:55:13 +0000 Subject: [PATCH 7/8] minor doc edit --- .../userguide/managing-domains/model-in-image/model-files.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/documentation/staging/content/userguide/managing-domains/model-in-image/model-files.md b/documentation/staging/content/userguide/managing-domains/model-in-image/model-files.md index ac6e084e82f..21e47058bac 100644 --- a/documentation/staging/content/userguide/managing-domains/model-in-image/model-files.md +++ b/documentation/staging/content/userguide/managing-domains/model-in-image/model-files.md @@ -133,6 +133,8 @@ Property files (ending in `.properties`) use the same sorting algorithm, but the ### Model file macros +WDT models can have macros that reference secrets or environment variables. + #### Using secrets in model files You can use WDT model `@@SECRET` macros to reference the WebLogic administrator `username` and `password` keys that are stored in a Kubernetes Secret and to optionally reference additional secrets. Here is the macro pattern for accessing these secrets: From 373bd5827b762850bf927474b4289e2b452ce065 Mon Sep 17 00:00:00 2001 From: Anil Kedia Date: Fri, 23 Jul 2021 15:00:34 +0000 Subject: [PATCH 8/8] Incorporated the edits suggested by Rosemary in pull review. --- .../model-in-image/auxiliary-images.md | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/documentation/staging/content/userguide/managing-domains/model-in-image/auxiliary-images.md b/documentation/staging/content/userguide/managing-domains/model-in-image/auxiliary-images.md index 10dcac1db97..bd4c4bf473d 100644 --- a/documentation/staging/content/userguide/managing-domains/model-in-image/auxiliary-images.md +++ b/documentation/staging/content/userguide/managing-domains/model-in-image/auxiliary-images.md @@ -42,7 +42,7 @@ Instead: and `domain.spec.configuration.model.modelHome` fields are set to reference a directory that contains the files from the smaller images. -The advantages of auxiliary image for Model In Image domains are: +The advantages of auxiliary images for Model In Image domains are: - Use or patch a WebLogic installation image without needing to include a WDT installation, application archive, or model artifacts within the image. @@ -99,14 +99,14 @@ One or more auxiliary images can be configured in a domain resource Each array entry must define an `image` and `volume` where `image` is the name of an auxiliary image and the `volume` is the name of an [auxiliary image volume](#auxiliary-volumes-and-paths) -as described above. -You can optionally also specify an `imagePullPolicy`, +as described previously. +Optionally , you can also specify an `imagePullPolicy`, which defaults to `Always` if the `image` ends in `:latest` and to `IfNotPresent`, otherwise. -You can also optionally customize +Also, optionally, you can customize the command that is used to merge (copy) the auxiliary image's files into the auxiliary image volume during pod startup (this is rarely -needed, see [Performing replaces instead of merges](#performing-replaces-instead-of-merges) below for an example). +needed, see [Performing replaces instead of merges](#performing-replaces-instead-of-merges) for an example). For details about each field, see the [schema](https://github.com/oracle/weblogic-kubernetes-operator/blob/main/documentation/domains/Domain.md#auxiliary-image). @@ -297,7 +297,7 @@ container image. #### Step 2: Create the auxiliary image -Follow these steps to create a auxiliary image containing +Follow these steps to create an auxiliary image containing Model In Image model files, application archives, and the WDT installation files: 1. Create a model ZIP application archive and place it in the same directory @@ -622,7 +622,7 @@ $ kubectl apply -f /tmp/mii-sample/domain-resources/WLS-AI/mii-initial-d1-WLS-AI **Note**: If you are choosing _not_ to use the predefined Domain YAML file and instead created your own Domain YAML file earlier, then substitute your - custom file name in the above command. Previously, we suggested naming it `/tmp/mii-sample/mii-initial.yaml`. + custom file name in the previous command. Previously, we suggested naming it `/tmp/mii-sample/mii-initial.yaml`. Now, if you run `kubectl get pods -n sample-domain1-ns --watch`, then you will see the introspector job run and your WebLogic Server pods start. The output will look something like this: