From 880d1f8f030c261146f5d8db2f4da0c7ead4010b Mon Sep 17 00:00:00 2001 From: Tom Barnes Date: Wed, 14 Dec 2022 06:51:01 +0000 Subject: [PATCH 1/7] Convert MII sample instructions to use aux images, supply 'old way' non-aux instructions in the WL images doc, plus some other aux image related doc/explain tweaks and fixes. --- .../4.0/content/base-images/custom-images.md | 105 +++- .../choosing-a-model/_index.md | 28 +- .../model-in-image/auxiliary-images.md | 553 +++++------------- .../model-in-image/model-files.md | 4 +- .../managing-domains/model-in-image/usage.md | 36 +- .../samples/domains/model-in-image/_index.md | 41 +- .../samples/domains/model-in-image/cleanup.md | 8 +- .../samples/domains/model-in-image/initial.md | 226 +++++-- .../samples/domains/model-in-image/update1.md | 4 +- .../samples/domains/model-in-image/update2.md | 4 +- .../samples/domains/model-in-image/update3.md | 60 +- documentation/domains/Cluster.json | 4 +- documentation/domains/Domain.json | 4 +- documentation/domains/Domain.md | 4 +- kubernetes/crd/domain-crd.yaml | 14 +- .../weblogic/domain/model/Model.java | 8 +- 16 files changed, 518 insertions(+), 585 deletions(-) diff --git a/documentation/4.0/content/base-images/custom-images.md b/documentation/4.0/content/base-images/custom-images.md index 1a59e956664..7492abbeed4 100644 --- a/documentation/4.0/content/base-images/custom-images.md +++ b/documentation/4.0/content/base-images/custom-images.md @@ -506,10 +506,103 @@ to create the domain home in Domain in Image. #### Create a custom image with your model inside the image -In the [Model in Image]({{< relref "/managing-domains/model-in-image/_index.md" >}}) -documentation, you will see a reference to a "base" or `--fromImage` image. You should use an image with -the recommended security patches installed as this base image, where this image could be an OCR image or a custom image. +{{% notice tip %}} +This section describes an option for layering Model in Image model files on an WebLogic image. +The preferred approach for supplying Model in Image files +is to instead use [Auxiliary images]({{< relref "/managing-domains/model-in-image/auxiliary-images.md" >}}). +{{% /notice %}} -See [Obtain images from the Oracle Container Registry]({{< relref "/base-images/ocr-images#obtain-images-from-the-oracle-container-registry" >}}) -or -[Create a custom image with patches applied](#create-a-custom-image-with-patches-applied). +{{% notice warning %}} +The example in this section references base image +`container-registry.oracle.com/middleware/weblogic:12.2.1.4`. +This is an OCR General Availability (GA) image +which **does not include** the latest security patches for WebLogic Server. +GA images are intended for single desktop demonstration and development purposes _only_. +For all other purposes, Oracle strongly recommends using only images with the latest set of recommended patches applied, +such as OCR Critical Patch Updates (CPU) images or custom generated images. +See [Ensure you are using recently patched images]({{< relref "/base-images/ocr-images#ensure-you-are-using-recently-patched-images" >}}). +{{% /notice %}} + +Example steps for creating a custom WebLogic image with a Model in Image file layer +(using files from the Model in Image sample): + +1. Read the [Model in Image User Guide]({{< relref "/managing-domains/model-in-image/_index.md" >}}) + and the [Model in Image Sample]({{< relref "/managing-domains/samples/domains/model-in-image/_index.md" >}}) + to gain an overall understanding of Model in Image domains. + Note that the sample uses the most recommended approach, + auxiliary images, instead of the alternative approach used in this example. + +1. Follow the prerequisite steps in + [Model in Image Sample]({{< relref "/samples/domains/model-in-image/prerequisites.md" >}}) + that describe how to: + + - Download the operator source and its Model in Image sample + (including copying the sample to suggested location `/tmp/mii-sample`). + - Download the latest [WebLogic Deploy Tooling](https://github.com/oracle/weblogic-deploy-tooling/releases) (WDT) + and [WebLogic Image Tool](https://github.com/oracle/weblogic-image-tool/releases) (WIT) installer ZIP files + to your `/tmp/mii-sample/model-images` directory. + Both WDT and WIT are required to create your Model in Image container images. + - Install (unzip) the WebLogic Image Tool and configure its cache to reference your WebLogic Deploy Tool download. + +1. Locate or create a base WebLogic image. + + See [Obtain images from the Oracle Container Registry]({{< relref "/base-images/ocr-images#obtain-images-from-the-oracle-container-registry" >}}) + or [Create a custom image with patches applied](#create-a-custom-image-with-patches-applied). + + In the following step, we use the `container-registry.oracle.com/middleware/weblogic:12.2.1.4` GA image. + +1. Build the final image using WIT while specifying the base image, target image tag, WDT install location, + and WDT model file locations. For example: + + First create a model ZIP file application archive and place it in the same directory + where the sample model YAML file and model properties files are already staged in place: + + ```shell + $ rm -f /tmp/mii-sample/model-images/model-in-image__WLS-v1/archive.zip + $ cd /tmp/mii-sample/archives/archive-v1 + $ zip -r /tmp/mii-sample/model-images/model-in-image__WLS-v1/archive.zip wlsdeploy + ``` + + (The `rm -f` command is included in case there's an + old version of the archive ZIP file from a + previous run of this sample.) + + Second, run the following WIT command: + + ```shell + $ cd /tmp/mii-sample/model-images + ``` + ```shell + $ ./imagetool/bin/imagetool.sh update \ + --tag model-in-image:WLS-v1 \ + --fromImage container-registry.oracle.com/middleware/weblogic:12.2.1.4 \ + --wdtModel ./model-in-image__WLS-v1/model.10.yaml \ + --wdtVariables ./model-in-image__WLS-v1/model.10.properties \ + --wdtArchive ./model-in-image__WLS-v1/archive.zip \ + --wdtModelOnly \ + --wdtDomainType WLS \ + --chown oracle:root + ``` + + __Note__: If using a Fusion Middleware Infrastructure base image, + then specify a `--wdtDomainType` of `JRF` or `RestrictedJRF`, + `JRF-v1` instead of `WLS-v1` for the image tag, + and substitute each occurrence of `model-in-image__WLS-v1` with `model-in-image__JRF-v1`. + +1. For an example Domain YAML file that sets up Model in Image to reference the image, + see `/tmp/mii-sample/domain-resources/WLS/mii-initial-d1-WLS-v1.yaml` + (or `./JRF/mii-initial-d1-JRF-v1.yaml` if using Fusion Middleware Infrastructure `JRF` mode). + + __Notes__: + + - The default values for `domain.spec.configuration.model.wdtInstallHome` and `.modelHome` + reference the location of the WDT install and model files that WIT copied into the image. + + - The domain type specified in `domain.spec.configuration.model.domainType` + must correspond with the `--wdtDomainType` specified on the WIT command line when creating the image. + + - To compare this example with an equivalent auxiliary image domain: + ``` + $ diff /tmp/mii-sample/domain-resources/WLS-AI/mii-initial-d1-WLS-AI-v1.yaml \ + /tmp/mii-sample/domain-resources/WLS/mii-initial-d1-WLS-v1.yaml + ``` diff --git a/documentation/4.0/content/managing-domains/choosing-a-model/_index.md b/documentation/4.0/content/managing-domains/choosing-a-model/_index.md index 61669f97afd..8568d16da7e 100644 --- a/documentation/4.0/content/managing-domains/choosing-a-model/_index.md +++ b/documentation/4.0/content/managing-domains/choosing-a-model/_index.md @@ -13,29 +13,29 @@ This document describes the domain home source types for deploying a domain, and When using the operator to start WebLogic Server instances from a domain, you have the choice of the following WebLogic domain home source types: - - **[Domain in PV]({{< relref "/samples/domains/domain-home-on-pv/_index.md" >}})**: - - Set the domain resource `domain.spec.domainHomeSourceType` attribute to `PersistentVolume`. - - Supply a WebLogic installation in an image and supply WebLogic configuration as a domain home in a persistent volume. - - Supply WebLogic applications in the persistent volume. - - Mutate WebLogic configuration using WLST, the WebLogic Server Administration Console, or [configuration overrides]({{< relref "/managing-domains/configoverrides/_index.md" >}}) supplied in a Kubernetes ConfigMap. - - - **[Domain in Image]({{< relref "/samples/domains/domain-home-in-image/_index.md" >}})**: - - Set the domain resource `domain.spec.domainHomeSourceType` attribute to `Image`. - - Supply a WebLogic installation in an image and supply WebLogic configuration as a domain home layered on this image. - - Supply WebLogic applications layered on the installation image. - - Mutate WebLogic configuration by supplying a new image and rolling, or by configuration overrides supplied in a Kubernetes ConfigMap. - - **[Model in Image]({{< relref "/samples/domains/model-in-image/_index.md" >}})**: - Set the domain resource `domain.spec.domainHomeSourceType` attribute to `FromModel`. - Supply a WebLogic installation in an image and supply WebLogic configuration in one of three ways: - - As WebLogic Deployment Tool (WDT) model YAML file layered on the WebLogic installation image. - As WDT model YAML file supplied in separate [auxiliary images]({{< relref "/managing-domains/model-in-image/auxiliary-images.md" >}}). + - As WebLogic Deployment Tool (WDT) model YAML file layered on the WebLogic installation image. - As WDT model YAML file in a Kubernetes ConfigMap. - Supply WebLogic applications in one of two ways: - - Layered on the installation image. - In auxiliary images. + - Layered on the installation image. - Mutate WebLogic configuration by supplying a new image and rolling, or [model updates]({{< relref "/managing-domains/model-in-image/runtime-updates.md" >}}) supplied in a Kubernetes ConfigMap. + - **[Domain in Image]({{< relref "/samples/domains/domain-home-in-image/_index.md" >}})**: + - Set the domain resource `domain.spec.domainHomeSourceType` attribute to `Image`. + - Supply a WebLogic installation in an image and supply WebLogic configuration as a domain home layered on this image. + - Supply WebLogic applications layered on the installation image. + - Mutate WebLogic configuration by supplying a new image and rolling, or by configuration overrides supplied in a Kubernetes ConfigMap. + + - **[Domain in PV]({{< relref "/samples/domains/domain-home-on-pv/_index.md" >}})**: + - Set the domain resource `domain.spec.domainHomeSourceType` attribute to `PersistentVolume`. + - Supply a WebLogic installation in an image and supply WebLogic configuration as a domain home in a persistent volume. + - Supply WebLogic applications in the persistent volume. + - Mutate WebLogic configuration using WLST, the WebLogic Server Administration Console, or [configuration overrides]({{< relref "/managing-domains/configoverrides/_index.md" >}}) supplied in a Kubernetes ConfigMap. + Note that you can use different domain home types for different domains; there's no restriction on having domains with different domain home types in the same Kubernetes cluster or namespace. There are advantages for each domain home source type where Model in Image is the most popular choice, but sometimes there are also technical limitations of various cloud providers that may make one type better suited to your needs. The following table compares the types: diff --git a/documentation/4.0/content/managing-domains/model-in-image/auxiliary-images.md b/documentation/4.0/content/managing-domains/model-in-image/auxiliary-images.md index 39f5004ed83..55728f4a227 100644 --- a/documentation/4.0/content/managing-domains/model-in-image/auxiliary-images.md +++ b/documentation/4.0/content/managing-domains/model-in-image/auxiliary-images.md @@ -10,7 +10,7 @@ description = "Auxiliary images are an alternative approach for supplying a doma ### Introduction -Auxiliary images are an alternative approach for including Model in Image model files, +Auxiliary images are the top recommended approach for including Model in Image model files, application archive files, and WebLogic Deploy Tooling installation files, in your pods. This feature eliminates the need to provide these files in the image specified in `domain.spec.image`. @@ -64,6 +64,7 @@ and installation files in the auxiliary image using the `sourceModelHome` and `s - For a basic configuration example, see [Configuration example 1](#configuration-example-1-basic-configuration). #### Source locations + Use the optional attributes `configuration.model.auxiliaryImages[].sourceModelHome` and `configuration.model.auxiliaryImages[].sourceWdtInstallHome` to specify non-default locations of WebLogic Deploy Tooling model and installation files in your auxiliary image(s). @@ -86,6 +87,7 @@ and `/aux/weblogic-deploy` directories of the WebLogic Server container in all p For example source locations, see [Configuration example 2](#configuration-example-2-source-locations). #### Multiple auxiliary images + If specifying multiple auxiliary images with model files in their respective `configuration.model.auxiliaryImages[].sourceModelHome` directories, then model files are merged. The operator will merge the model files from multiple auxiliary images in the same order in which images appear under `model.auxiliaryImages`. @@ -94,12 +96,16 @@ Files from later images in the merge overwrite same-named files from earlier ima When specifying multiple auxiliary images, ensure that only one of the images supplies a WDT installation location using `configuration.model.auxiliaryImages[].sourceWDTInstallHome`. {{% notice warning %}} -If you provide more than one WDT install home using `sourceWDTInstallHome`, then the domain deployment will fail. +If you provide more than one WDT install home among multiple auxiliary images, +then the domain deployment will fail. +Set `sourceWDTInstallHome` to `None`, or make sure there are no files in `/auxiliary/weblogic-deploy`, +for all but one of your specified auxililary images. {{% /notice %}} For an example of configuring multiple auxiliary images, see [Configuration example 3](#configuration-example-3-multiple-images). #### Model and WDT install homes + If you are using auxiliary images, typically, it should not be necessary to set `domain.spec.configuration.models.modelHome` and `domain.spec.configuration.models.wdtInstallHome`. The model and WDT install files you supply in the auxiliary image (see [source locations](#source-locations)) are always placed in the `/aux/models` and `/aux/weblogic-deploy` directories, @@ -108,13 +114,15 @@ the default for `modelHome` and `wdtInstallHome` to match. {{% notice warning %}} If you set `modelHome` and `wdtInstallHome` to a non-default value, -then the operator will ignore the WDT model and installation files from the auxiliary image(s). +then the domain will ignore the WDT model and installation files in its auxiliary image(s). {{% /notice %}} ### Configuration examples + The following configuration examples illustrate each of the previously described sections. #### Configuration example 1: Basic configuration + This example specifies the required image parameter for the auxiliary image(s); all other fields are at default values. ``` @@ -126,6 +134,7 @@ spec: ``` #### Configuration example 2: Source locations + This example is same as Example 1 except that it specifies the source locations for the WebLogic Deploy Tooling model and installation files. ``` spec: @@ -138,6 +147,7 @@ spec: ``` #### Configuration example 3: Multiple images + This example is the same as Example 1, except it configures multiple auxiliary images and sets the `sourceWDTInstallHome` for the second image to `None`. In this case, the source location of the WebLogic Deploy Tooling installation from the second image `new-model-in-image:v1` will be ignored. @@ -152,6 +162,125 @@ spec: sourceWDTInstallHome: None ``` +### Sample + +The [Model in Image Sample]({{< relref "/samples/domains/model-in-image/initial.md" >}}) +demonstrates deploying a Model in Image domain that uses +auxiliary images to supply the domain's WDT model files, +application archive ZIP files, and WDT installation in a small, separate +container image. + +### Using Docker to create an auxiliary image + +The [Model in Image Sample initial use case]({{< relref "/samples/domains/model-in-image/initial.md" >}}) +describes using the WebLogic Image Tool as a convenient way to create the auxiliary image, +which is the top recommended approach. You can alternatively "manually" build the image. +For example, the following steps modify the Model in Image sample's initial use case +to use Docker to build its auxiliary image: + +1. Download the Model in Image sample source and WebLogic Deploy Tool by following + the corresponding steps in the + [Model in Image Sample prerequisites]({{< relref "/samples/domains/model-in-image/prerequisites.md" >}}). + +1. Create a `/tmp/mystaging/models` directory as a staging directory and copy the model YAML file, properties, and archive into it: + ```shell + $ mkdir -p /tmp/mystaging/models + $ cp /tmp/mii-sample/model-images/model-in-image__WLS-AI-v1/model.10.yaml ./models + $ cp /tmp/mii-sample/model-images/model-in-image__WLS-AI-v1/model.10.properties ./models + $ cp /tmp/mii-sample/model-images/model-in-image__WLS-AI-v1/archive.zip ./models + ``` + If the `archive.zip` file is missing, then repeat the step to create this file + in the Model in Image sample + [initial use case]({{< relref "/samples/domains/model-in-image/initial.md#staging-a-zip-file-of-the-archive" >}}) + while using `/tmp/mii-sample/model-images/model-in-image__WLS-AI-v1` as the target directory. + +1. Install WDT in the staging directory and remove its `weblogic-deploy/bin/*.cmd` files, + which are not used in UNIX environments: + ```shell + $ cd /tmp/mystaging + $ unzip /tmp/mii-sample/model-images/weblogic-deploy.zip -d . + $ rm ./weblogic-deploy/bin/*.cmd + ``` + If the `weblogic-deploy.zip` file is missing, then repeat the step to download the latest WebLogic Deploy Tooling (WDT) + in the Model in Image sample [prerequisites]({{< relref "/samples/domains/model-in-image/prerequisites.md" >}}). + +1. Run the `docker build` command using `/tmp/mii-sample/ai-docker-file/Dockerfile`. + + ```shell + $ cd /tmp/mystaging + $ docker build -f /tmp/mii-sample/ai-docker-file/Dockerfile \ + --build-arg AUXILIARY_IMAGE_PATH=/auxiliary \ + --tag model-in-image:WLS-AI-v1 . + ``` + + See `./Dockerfile` for an explanation of each build argument. + + {{%expand "Click here to view the Dockerfile." %}} + ``` + # Copyright (c) 2021, 2022, Oracle and/or its affiliates. + # Licensed under the Universal Permissive License v 1.0 as shown at https://oss.oracle.com/licenses/upl. + + # This is a sample Dockerfile for supplying Model in Image model files + # and a WDT installation in a small separate auxiliary image + # image. This is an alternative to supplying the files directly + # in the domain resource `domain.spec.image` image. + + # AUXILIARY_IMAGE_PATH arg: + # Parent location for Model in Image model and WDT installation files. + # The default is '/auxiliary', which matches the parent directory in the default values for + # 'domain.spec.configuration.model.auxiliaryImages.sourceModelHome' and + # 'domain.spec.configuration.model.auxiliaryImages.sourceWDTInstallHome', respectively. + # + + FROM busybox + ARG AUXILIARY_IMAGE_PATH=/auxiliary + ARG USER=oracle + ARG USERID=1000 + ARG GROUP=root + ENV AUXILIARY_IMAGE_PATH=${AUXILIARY_IMAGE_PATH} + RUN adduser -D -u ${USERID} -G $GROUP $USER + # ARG expansion in COPY command's --chown is available in docker version 19.03.1+. + # For older docker versions, change the Dockerfile to use separate COPY and 'RUN chown' commands. + COPY --chown=$USER:$GROUP ./ ${AUXILIARY_IMAGE_PATH}/ + USER $USER + ``` + {{% /expand %}} + +1. If you have successfully created the image, then it should now be in your local machine's Docker repository. For example: + + ``` + $ docker images model-in-image:WLS-AI-v1 + REPOSITORY TAG IMAGE ID CREATED SIZE + model-in-image WLS-AI-v1 eac9030a1f41 1 minute ago 4.04MB + ``` + +1. After the image is created, it should have the WDT executables in + `/auxiliary/weblogic-deploy`, and WDT model, property, and archive + files in `/auxiliary/models`. You can run `ls` in the Docker + image to verify this: + + ```shell + $ docker run -it --rm model-in-image:WLS-AI-v1 ls -l /auxiliary + total 8 + drwxr-xr-x 1 oracle root 4096 Jun 1 21:53 models + drwxr-xr-x 1 oracle root 4096 May 26 22:29 weblogic-deploy + + $ docker run -it --rm model-in-image:WLS-AI-v1 ls -l /auxiliary/models + total 16 + -rw-rw-r-- 1 oracle root 5112 Jun 1 21:52 archive.zip + -rw-rw-r-- 1 oracle root 173 Jun 1 21:59 model.10.properties + -rw-rw-r-- 1 oracle root 1515 Jun 1 21:59 model.10.yaml + + $ docker run -it --rm model-in-image:WLS-AI-v1 ls -l /auxiliary/weblogic-deploy + total 28 + -rw-r----- 1 oracle root 4673 Oct 22 2019 LICENSE.txt + -rw-r----- 1 oracle root 30 May 25 11:40 VERSION.txt + drwxr-x--- 1 oracle root 4096 May 26 22:29 bin + drwxr-x--- 1 oracle root 4096 May 25 11:40 etc + drwxr-x--- 1 oracle root 4096 May 25 11:40 lib + drwxr-x--- 1 oracle root 4096 Jan 22 2019 samples + ``` + ### Automated upgrade of the `weblogic.oracle/v8` schema auxiliary images configuration {{% notice note %}} @@ -216,422 +345,6 @@ spec: ``` ### Domain upgrade tool to manually upgrade the `weblogic.oracle/v8` schema domain resource -To manually upgrade the domain resource from the `weblogic.oracle/v8` schema to the `weblogic.oracle/v9` schema, see [Upgrade the `weblogic.oracle/v8` schema domain resource manually]({{< relref "/managing-domains/upgrade-domain-resource#upgrade-the-weblogicoraclev8-schema-domain-resource-manually" >}}). -### Sample - -This sample demonstrates deploying a Model in Image domain that uses -auxiliary images to supply the domain's WDT model files, -application archive ZIP files, and WDT installation in a small, separate -container image. - -#### Step 1: Prerequisites - -- First, follow all of the steps in the Model in Image - [initial use case sample]({{< relref "/samples/domains/model-in-image/initial.md" >}}). - - This will: - - - Set up the operator and a namespace for the domain. - - Download a WebLogic Deploy Tooling ZIP file installation. - - Deploy a domain _without_ auxiliary images. - -- Second, shut down the domain and wait for its pods to exit. - - You can use the `waitForDomain.sh` sample lifecycle script to wait. - - For example: - ```shell - $ kubectl delete domain sample-domain1 -n sample-domain1-ns - $ cd /tmp/weblogic-kubernetes-operator/kubernetes/samples/scripts/domain-lifecycle - $ ./waitForDomain.sh -n sample-domain1-ns -d sample-domain1 -p 0 - ``` - -#### Step 2: Create the auxiliary image - -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 file application archive and place it in the same directory - where the model YAML file and model properties files are already in place - for the initial use case: - ```shell - $ rm -f /tmp/mii-sample/model-images/model-in-image__WLS-AI-v1/archive.zip - $ cd /tmp/mii-sample/archives/archive-v1 - $ zip -r /tmp/mii-sample/model-images/model-in-image__WLS-AI-v1/archive.zip wlsdeploy - ``` - The `rm -f` command is included in case there's an - old version of the archive ZIP file from a - previous run of this sample. - -1. Create a temporary directory for staging the auxiliary image's files and `cd` to this directory: - ```shell - $ mkdir -p /tmp/mii-sample/ai-image/WLS-AI-v1 - $ cd /tmp/mii-sample/ai-image/WLS-AI-v1 - ``` - We call this directory `WLS-AI-v1` to correspond with the image version tag that we plan to use for the auxiliary image. - -1. Create a `models` directory in the staging directory and copy the model YAML file, properties, and archive into it: - ```shell - $ mkdir ./models - $ cp /tmp/mii-sample/model-images/model-in-image__WLS-AI-v1/model.10.yaml ./models - $ cp /tmp/mii-sample/model-images/model-in-image__WLS-AI-v1/model.10.properties ./models - $ cp /tmp/mii-sample/model-images/model-in-image__WLS-AI-v1/archive.zip ./models - ``` - -1. Use one of the two following options to create the auxiliary image using a small `busybox` image as the base image. - - Option 1 - Use the `createAuxImage` option of the [WebLogic Image Tool](https://oracle.github.io/weblogic-image-tool/userguide/tools/create-aux-image/) (WIT) to create the auxiliary image. Run the following command: - - ```shell - $ /tmp/mii-sample/model-images/imagetool/bin/imagetool.sh createAuxImage \ - --tag model-in-image:WLS-AI-v1 \ - --wdtModel ./models/model.10.yaml \ - --wdtVariables ./models/model.10.properties \ - --wdtArchive ./models/archive.zip - ``` - - If you don't see the `imagetool` directory under `/tmp/mii-sample/model-images` or the WDT installer is not in the Image Tool cache, then repeat the step to set up the WebLogic Image Tool - in the Model in Image sample [prerequisites]({{< relref "/samples/domains/model-in-image/prerequisites.md" >}}). - - When you run this command, the Image Tool will create an auxiliary image with the specified model, variables, and archive files in the - image's `/auxiliary/models` directory. It will also add the latest version of the WDT installation in its `/auxiliary/weblogic-deploy` directory. - See [Create Auxiliary Image](https://oracle.github.io/weblogic-image-tool/userguide/tools/create-aux-image/) for additional Image Tool options. - The operator auxiliary image feature looks for WDT model and WDT install files in these specific directories by default; if you change - the location of these directories, then change the corresponding domain resource auxiliary image [source locations attributes](#source-locations). - - - Option 2 - Alternatively, you can create the auxiliary image manually by following these steps. - - - First, install WDT in the staging directory and remove its `weblogic-deploy/bin/*.cmd` files, which are not used in UNIX environments: - ```shell - $ unzip /tmp/mii-sample/model-images/weblogic-deploy.zip -d . - $ rm ./weblogic-deploy/bin/*.cmd - ``` - If the `weblogic-deploy.zip` file is missing, then repeat the step to download the latest WebLogic Deploy Tooling (WDT) - in the Model in Image sample [prerequisites]({{< relref "/samples/domains/model-in-image/prerequisites.md" >}}). - - - Run the `docker build` command using `/tmp/mii-sample/ai-docker-file/Dockerfile`. - - ```shell - $ docker build -f /tmp/mii-sample/ai-docker-file/Dockerfile \ - --build-arg AUXILIARY_IMAGE_PATH=/auxiliary \ - --tag model-in-image:WLS-AI-v1 . - ``` - - See `./Dockerfile` for an explanation of each build argument. - - {{%expand "Click here to view the Dockerfile." %}} - ``` - # Copyright (c) 2021, 2022, Oracle and/or its affiliates. - # Licensed under the Universal Permissive License v 1.0 as shown at https://oss.oracle.com/licenses/upl. - - # This is a sample Dockerfile for supplying Model in Image model files - # and a WDT installation in a small separate auxiliary image - # image. This is an alternative to supplying the files directly - # in the domain resource `domain.spec.image` image. - - # AUXILIARY_IMAGE_PATH arg: - # Parent location for Model in Image model and WDT installation files. - # The default is '/auxiliary', which matches the parent directory in the default values for - # 'domain.spec.configuration.model.auxiliaryImages.sourceModelHome' and - # 'domain.spec.configuration.model.auxiliaryImages.sourceWDTInstallHome', respectively. - # - - FROM busybox - ARG AUXILIARY_IMAGE_PATH=/auxiliary - ARG USER=oracle - ARG USERID=1000 - ARG GROUP=root - ENV AUXILIARY_IMAGE_PATH=${AUXILIARY_IMAGE_PATH} - RUN adduser -D -u ${USERID} -G $GROUP $USER - # ARG expansion in COPY command's --chown is available in docker version 19.03.1+. - # For older docker versions, change the Dockerfile to use separate COPY and 'RUN chown' commands. - COPY --chown=$USER:$GROUP ./ ${AUXILIARY_IMAGE_PATH}/ - USER $USER - ``` - {{% /expand %}} - -1. If you have successfully created the image, then it should now be in your local machine's Docker repository. For example: - - ``` - $ docker images model-in-image:WLS-AI-v1 - REPOSITORY TAG IMAGE ID CREATED SIZE - model-in-image WLS-AI-v1 eac9030a1f41 1 minute ago 4.04MB - ``` - - -1. After the image is created, it should have the WDT executables in - `/auxiliary/weblogic-deploy`, and WDT model, property, and archive - files in `/auxiliary/models`. You can run `ls` in the Docker - image to verify this: - - ```shell - $ docker run -it --rm model-in-image:WLS-AI-v1 ls -l /auxiliary - total 8 - drwxr-xr-x 1 oracle root 4096 Jun 1 21:53 models - drwxr-xr-x 1 oracle root 4096 May 26 22:29 weblogic-deploy - - $ docker run -it --rm model-in-image:WLS-AI-v1 ls -l /auxiliary/models - total 16 - -rw-rw-r-- 1 oracle root 5112 Jun 1 21:52 archive.zip - -rw-rw-r-- 1 oracle root 173 Jun 1 21:59 model.10.properties - -rw-rw-r-- 1 oracle root 1515 Jun 1 21:59 model.10.yaml - - $ docker run -it --rm model-in-image:WLS-AI-v1 ls -l /auxiliary/weblogic-deploy - total 28 - -rw-r----- 1 oracle root 4673 Oct 22 2019 LICENSE.txt - -rw-r----- 1 oracle root 30 May 25 11:40 VERSION.txt - drwxr-x--- 1 oracle root 4096 May 26 22:29 bin - drwxr-x--- 1 oracle root 4096 May 25 11:40 etc - drwxr-x--- 1 oracle root 4096 May 25 11:40 lib - drwxr-x--- 1 oracle root 4096 Jan 22 2019 samples - - ``` - -#### Step 3: Prepare and apply the domain resource - -Copy the following to a file called `/tmp/mii-sample/mii-initial.yaml` or similar, -or you can directly use the file `/tmp/mii-sample/domain-resources/WLS-AI/mii-initial-d1-WLS-AI-v1.yaml` -that is included in the sample source. - - {{%expand "Click here to view the WLS Domain YAML file using auxiliary images." %}} - ```yaml - # Copyright (c) 2021, 2022, Oracle and/or its affiliates. - # Licensed under the Universal Permissive License v 1.0 as shown at http://oss.oracle.com/licenses/upl. - # - # This is an example of how to define a Domain resource. - # - apiVersion: "weblogic.oracle/v9" - kind: Domain - metadata: - name: sample-domain1 - namespace: sample-domain1-ns - labels: - weblogic.domainUID: sample-domain1 - - spec: - # Set to 'FromModel' to indicate 'Model in Image'. - domainHomeSourceType: FromModel - - # The WebLogic Domain Home, this must be a location within - # the image for 'Model in Image' domains. - domainHome: /u01/domains/sample-domain1 - - # The WebLogic Server image that the Operator uses to start the domain - image: "container-registry.oracle.com/middleware/weblogic:12.2.1.4" - - # Defaults to "Always" if image tag (version) is ':latest' - imagePullPolicy: "IfNotPresent" - - # Identify which Secret contains the credentials for pulling an image - #imagePullSecrets: - #- name: regsecret - - # Identify which Secret contains the WebLogic Admin credentials, - # the secret must contain 'username' and 'password' fields. - webLogicCredentialsSecret: - name: sample-domain1-weblogic-credentials - - # Whether to include the WebLogic Server stdout in the pod's stdout, default is true - includeServerOutInPodLog: true - - # Whether to enable overriding your log file location, see also 'logHome' - #logHomeEnabled: false - - # The location for domain log, server logs, server out, introspector out, and Node Manager log files - # see also 'logHomeEnabled', 'volumes', and 'volumeMounts'. - #logHome: /shared/logs/sample-domain1 - - # Set which WebLogic Servers the Operator will start - # - "Never" will not start any server in the domain - # - "AdminOnly" will start up only the administration server (no managed servers will be started) - # - "IfNeeded" will start all non-clustered servers, including the administration server, and clustered servers up to their replica count. - serverStartPolicy: IfNeeded - - # Settings for all server pods in the domain including the introspector job pod - serverPod: - # Optional new or overridden environment variables for the domain's pods - # - This sample uses CUSTOM_DOMAIN_NAME in its image model file - # to set the WebLogic domain name - env: - - name: CUSTOM_DOMAIN_NAME - value: "domain1" - - name: JAVA_OPTIONS - value: "-Dweblogic.StdoutDebugEnabled=false" - - name: USER_MEM_ARGS - value: "-Djava.security.egd=file:/dev/./urandom -Xms256m -Xmx512m " - resources: - requests: - cpu: "250m" - memory: "768Mi" - - # Optional volumes and mounts for the domain's pods. See also 'logHome'. - #volumes: - #- name: weblogic-domain-storage-volume - # persistentVolumeClaim: - # claimName: sample-domain1-weblogic-sample-pvc - #volumeMounts: - #- mountPath: /shared - # name: weblogic-domain-storage-volume - - # The desired behavior for starting the domain's administration server. - # adminServer: - # Setup a Kubernetes node port for the administration server default channel - #adminService: - # channels: - # - channelName: default - # nodePort: 30701 - - # The number of managed servers to start for unlisted clusters - replicas: 1 - - # The desired behavior for starting a specific cluster's member servers - clusters: - - clusterName: cluster-1 - # The number of managed servers to start for this cluster - replicas: 2 - - # Change the restartVersion to force the introspector job to rerun - # and apply any new model configuration, to also force a subsequent - # roll of your domain's WebLogic Server pods. - restartVersion: '1' - - # Changes to this field cause the operator to repeat its introspection of the - # WebLogic domain configuration. - introspectVersion: '1' - - configuration: - - # Settings for domainHomeSourceType 'FromModel' - model: - # Valid model domain types are 'WLS', 'JRF', and 'RestrictedJRF', default is 'WLS' - domainType: "WLS" - - # Optional auxiliary image(s) containing WDT model, archives, and install. - # Files are copied from `sourceModelHome` in the aux image to the `/aux/models` directory - # in running WebLogic Server pods, and files are copied from `sourceWDTInstallHome` - # to the `/aux/weblogic-deploy` directory. Set `sourceModelHome` and/or `sourceWDTInstallHome` - # to "None" if you want skip such copies. - # `image` - Image location - # `imagePullPolicy` - Pull policy, default `IfNotPresent` - # `sourceModelHome` - Model file directory in image, default `/auxiliary/models`. - # `sourceWDTInstallHome` - WDT install directory in image, default `/auxiliary/weblogic-deploy`. - auxiliaryImages: - - image: "model-in-image:WLS-AI-v1" - #imagePullPolicy: IfNotPresent - #sourceWDTInstallHome: /auxiliary/weblogic-deploy - #sourceModelHome: /auxiliary/models - - # Optional configmap for additional models and variable files - #configMap: sample-domain1-wdt-config-map - - # All 'FromModel' domains require a runtimeEncryptionSecret with a 'password' field - runtimeEncryptionSecret: sample-domain1-runtime-encryption-secret - - # Secrets that are referenced by model yaml macros - # (the model yaml in the optional configMap or in the image) - #secrets: - #- sample-domain1-datasource-secret - ``` - {{% /expand %}} - -You can compare this domain resource YAML file with the domain resource YAML file -from the original initial use case (`/tmp/mii-sample/domain-resources/WLS/mii-initial-d1-WLS-v1.yaml`) -to see the changes required for auxiliary images. For example: - -``` -$ diff /tmp/mii-sample/domain-resources/WLS-AI/mii-initial-d1-WLS-AI-v1.yaml /tmp/mii-sample/domain-resources/WLS/mii-initial-d1-WLS-v1.yaml -1c1 -< # Copyright (c) 2021, 2022, Oracle and/or its affiliates. ---- -> # Copyright (c) 2020, 2021, Oracle and/or its affiliates. -23c23 -< image: "container-registry.oracle.com/middleware/weblogic:12.2.1.4" ---- -> image: "model-in-image:WLS-v1" -131,145d130 -< -< # Optional auxiliary image(s) containing WDT model, archives, and install. -< # Files are copied from `sourceModelHome` in the aux image to the `/aux/models` directory -< # in running WebLogic Server pods, and files are copied from `sourceWDTInstallHome` -< # to the `/aux/weblogic-deploy` directory. Set `sourceModelHome` and/or `sourceWDTInstallHome` -< # to "None" if you want skip such copies. -< # `image` - Image location -< # `imagePullPolicy` - Pull policy, default `IfNotPresent` -< # `sourceModelHome` - Model file directory in image, default `/auxiliary/models`. -< # `sourceWDTInstallHome` - WDT install directory in image, default `/auxiliary/weblogic-deploy`. -< auxiliaryImages: -< - image: "model-in-image:WLS-AI-v1" -< #imagePullPolicy: IfNotPresent -< #sourceWDTInstallHome: /auxiliary/weblogic-deploy -< #sourceModelHome: /auxiliary/models -``` - -Run the following command to deploy the domain custom resource: - -```shell -$ kubectl apply -f /tmp/mii-sample/domain-resources/WLS-AI/mii-initial-d1-WLS-AI-v1.yaml -``` +To manually upgrade the domain resource from the `weblogic.oracle/v8` schema to the `weblogic.oracle/v9` schema, see [Upgrade the `weblogic.oracle/v8` schema domain resource manually]({{< relref "/managing-domains/upgrade-domain-resource#upgrade-the-weblogicoraclev8-schema-domain-resource-manually" >}}). -**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 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: - - {{%expand "Click here to expand." %}} - ```shell - $ kubectl get pods -n sample-domain1-ns --watch - ``` - ```text - NAME READY STATUS RESTARTS AGE - sample-domain1-introspector-z5vmp 0/1 Pending 0 0s - sample-domain1-introspector-z5vmp 0/1 Pending 0 0s - sample-domain1-introspector-z5vmp 0/1 Init:0/1 0 0s - sample-domain1-introspector-z5vmp 0/1 PodInitializing 0 2s - sample-domain1-introspector-z5vmp 1/1 Running 0 3s - sample-domain1-introspector-z5vmp 0/1 Completed 0 71s - sample-domain1-admin-server 0/1 Pending 0 0s - sample-domain1-admin-server 0/1 Pending 0 0s - sample-domain1-admin-server 0/1 Init:0/1 0 0s - sample-domain1-introspector-z5vmp 0/1 Terminating 0 71s - sample-domain1-introspector-z5vmp 0/1 Terminating 0 71s - sample-domain1-admin-server 0/1 PodInitializing 0 2s - sample-domain1-admin-server 0/1 Running 0 3s - sample-domain1-admin-server 1/1 Running 0 41s - sample-domain1-managed-server1 0/1 Pending 0 0s - sample-domain1-managed-server1 0/1 Pending 0 0s - sample-domain1-managed-server1 0/1 Init:0/1 0 0s - sample-domain1-managed-server2 0/1 Pending 0 0s - sample-domain1-managed-server2 0/1 Pending 0 0s - sample-domain1-managed-server2 0/1 Init:0/1 0 0s - sample-domain1-managed-server2 0/1 Init:0/1 0 1s - sample-domain1-managed-server1 0/1 Init:0/1 0 1s - sample-domain1-managed-server1 0/1 PodInitializing 0 2s - sample-domain1-managed-server2 0/1 PodInitializing 0 2s - sample-domain1-managed-server2 0/1 Running 0 3s - sample-domain1-managed-server1 0/1 Running 0 3s - sample-domain1-managed-server2 1/1 Running 0 39s - sample-domain1-managed-server1 1/1 Running 0 43s - ``` - {{% /expand %}} - -For a more detailed view of this activity, -you can use the `waitForDomain.sh` sample lifecycle script. -This script provides useful information about a domain's pods and -optionally waits for its `Completed` status condition to become `True`. -A `Completed` domain indicates that all of its expected -pods have reached a `ready` state -plus their target `restartVersion`, `introspectVersion`, and `image`. -For example: - - ```shell - $ cd /tmp/weblogic-kubernetes-operator/kubernetes/samples/scripts/domain-lifecycle - $ ./waitForDomain.sh -n sample-domain1-ns -d sample-domain1 -p Completed - ``` - -If you see an error, then consult [Domain debugging]({{< relref "/managing-domains/debugging.md" >}}). - -#### Step 4: Invoke the web application - -To invoke the web application, follow the same steps as described in the -[Invoke the web application](/samples/domains/model-in-image/initial/#invoke-the-web-application) -section of the initial use case. diff --git a/documentation/4.0/content/managing-domains/model-in-image/model-files.md b/documentation/4.0/content/managing-domains/model-in-image/model-files.md index 7a109daa1c7..a861365fd7a 100644 --- a/documentation/4.0/content/managing-domains/model-in-image/model-files.md +++ b/documentation/4.0/content/managing-domains/model-in-image/model-files.md @@ -81,7 +81,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`. 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 "/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. +During domain home creation, model and property files are first loaded from the `configuration.models.modelHome` directory within a pod. 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 "/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: @@ -98,7 +98,7 @@ then the files in this directory are populated according to their [Auxiliary image merge order]({{< relref "/managing-domains/model-in-image/auxiliary-images#multiple-auxiliary-images" >}}) before the loading order is determined. -For example, if you have these files in the model home directory `/u01/wdt/models`: +For example, if you have these files in the model home directory: ``` jdbc.20.yaml diff --git a/documentation/4.0/content/managing-domains/model-in-image/usage.md b/documentation/4.0/content/managing-domains/model-in-image/usage.md index 91d02cac061..c31dcd70ee3 100644 --- a/documentation/4.0/content/managing-domains/model-in-image/usage.md +++ b/documentation/4.0/content/managing-domains/model-in-image/usage.md @@ -38,10 +38,16 @@ Model in Image requires an image with a WebLogic Server installation. Model in Image requires the following directory structure in its pods for its (optional) WDT model artifacts and (required) WDT binaries: -| Domain resource attribute | Default directory | Contents | -| -------------------------- | -------------------------- | ------------------------------------- | -| `domain.spec.configuration.model.modelHome` | `/u01/wdt/models` | Zero or more model `.yaml`, `.properties`, and/or archive `.zip` files.| -| `domain.spec.configuration.model.wdtInstallHome` | `/u01/wdt/weblogic-deploy` | Unzipped WDT installation binaries (required). | +| Domain resource attribute | Contents | Default directory | +| -------------------------- | ------------------------------------- | ----------------- | +| `domain.spec.configuration.model.modelHome` | Zero or more model `.yaml`, `.properties`, and/or archive `.zip` files. | Optional. Location of the WDT model home, which can include model YAML files, `.properties` files, and application `.zip` archives. Defaults to `/u01/wdt/models` if no [Auxiliary Images]({{}}) are configured, and to `/aux/models` otherwise.| +| `domain.spec.configuration.model.wdtInstallHome` | Unzipped WDT installation binaries (required). | Optional. Location of the WDT installation. Defaults to `/u01/wdt/weblogic-deploy` if no [Auxiliary Images]({{}}) are configured, and to `/aux/weblogic-deploy` otherwise.| + +{{% notice warning %}} +If you set `modelHome` and `wdtInstallHome` to a non-default value, +then the operator will ignore WDT model and installation files +that are copied from [Auxiliary Images]({{}}). +{{% /notice %}} ### Supplying initial model files and WDT @@ -62,6 +68,14 @@ to: There are multiple methods for supplying Model in Image WDT artifacts: + - __Use auxiliary images__: + Use [auxiliary images]({{< relref "/managing-domains/model-in-image/auxiliary-images.md" >}}) + to create one or more small images that contain the desired files. + + This is the top recommended approach. It automatically copies files + from each of the small images into the `/aux/models` and `/aux/weblogic-deploy` directories + in each pod's file system so that the introspection job can find them. + - __Include in main image__: You can include the artifacts in your domain resource `domain.spec.image` in its `domain.spec.configuration.model.modelHome` @@ -75,13 +89,7 @@ There are multiple methods for supplying Model in Image WDT artifacts: on top of your base image into a new image. - The _WebLogic Image Tool_ (WIT) has built-in options for layering WDT model files, WDT binaries, WebLogic Server binaries, and WebLogic Server patches in an image. - The [Model in Image]({{< relref "/samples/domains/model-in-image/_index.md" >}}) sample uses the WIT approach. - - - __Use auxiliary images__: - Use [auxiliary images]({{< relref "/managing-domains/model-in-image/auxiliary-images.md" >}}) - to create one or more small images that contain the desired files. This automatically copies files - from each of the small images into the `/aux/models` and `/aux/weblogic-deploy` directories - in each pod's file system so that the introspection job can find them. + See [Create a custom image with your model inside the image]({{< relref "/base-images/custom-images#create-a-custom-image-with-your-model-inside-the-image" >}}). - __Use a Persistent Volume Claim (PVC)__: This method is for advanced use cases only. Supply WDT model YAML, variable, or archive files @@ -167,6 +175,12 @@ The following Domain fields are specific to Model in Image domains. | `configuration.model.modelHome` | Optional. Location of the WDT model home, which can include model YAML files, `.properties` files, and application `.zip` archives. Defaults to `/u01/wdt/models` if no [Auxiliary Images]({{}}) are configured, and to `/aux/models` otherwise.| | `configuration.model.wdtInstallHome` | Optional. Location of the WDT installation. Defaults to `/u01/wdt/weblogic-deploy` if no [Auxiliary Images]({{}}) are configured, and to `/aux/weblogic-deploy` otherwise.| +{{% notice warning %}} +If you set `modelHome` and `wdtInstallHome` to a non-default value, +then the operator will ignore WDT model and installation files +that are copied from [Auxiliary Images]({{}}). +{{% /notice %}} + **Notes**: - There are additional attributes that are common to all domain home source types, such as the `image` field. See the Domain Resource [schema](https://github.com/oracle/weblogic-kubernetes-operator/blob/{{< latestMinorVersion >}}/documentation/domains/Domain.md) and [documentation]({{< relref "/managing-domains/domain-resource.md" >}}) for a full list of Domain fields. diff --git a/documentation/4.0/content/samples/domains/model-in-image/_index.md b/documentation/4.0/content/samples/domains/model-in-image/_index.md index c6674c45d76..a1a0904256e 100644 --- a/documentation/4.0/content/samples/domains/model-in-image/_index.md +++ b/documentation/4.0/content/samples/domains/model-in-image/_index.md @@ -9,10 +9,19 @@ description: "Sample for supplying a WebLogic Deploy Tooling (WDT) model that th ### Introduction -This sample demonstrates deploying a Model in Image [domain home source type]({{< relref "/managing-domains/choosing-a-model/_index.md" >}}). Unlike Domain in PV and Domain in Image, Model in Image eliminates the need to pre-create your WebLogic domain home prior to deploying your Domain YAML file. Instead, Model in Image uses a WebLogic Deploy Tooling (WDT) model to specify your WebLogic configuration. +This sample demonstrates deploying a Model in Image +[domain home source type]({{< relref "/managing-domains/choosing-a-model/_index.md" >}}) + with [Auxiliary images]({{< relref "/managing-domains/model-in-image/auxiliary-images.md" >}}). +Unlike Domain in PV and Domain in Image, Model in Image eliminates the need to pre-create +your WebLogic domain home prior to deploying your Domain YAML file. +Instead, Model in Image uses +WebLogic Deploy Tooling (WDT) model to specify your WebLogic configuration. WDT models are a convenient and simple alternative to WebLogic Scripting Tool (WLST) configuration scripts and templates. They compactly define a WebLogic domain using YAML files and support including application archives in a ZIP file. The WDT model format is described in the open source, [WebLogic Deploy Tooling](https://oracle.github.io/weblogic-deploy-tooling/) GitHub project, and the required directory structure for a WDT archive is specifically discussed [here](https://oracle.github.io/weblogic-deploy-tooling/concepts/archive/). +The Model in Image auxiliary image option furthermore allows you to supply your WDT artifacts +in a small separate image separate from your WebLogic image. + For more information on Model in Image, see the [Model in Image user guide]({{< relref "/managing-domains/model-in-image/_index.md" >}}). For a comparison of Model in Image to other domain home source types, see [Choose a domain home source type]({{< relref "/managing-domains/choosing-a-model/_index.md" >}}). #### Model in Image domain types (WLS, JRF, and Restricted JRF) @@ -27,39 +36,35 @@ This sample demonstrates five Model in Image use cases: - [Initial]({{< relref "/samples/domains/model-in-image/initial.md" >}}): An initial WebLogic domain with the following characteristics: - - Image `model-in-image:WLS-v1` with: - - A WebLogic installation + - Auxiliary image `model-in-image:WLS-AI-v1` with: - A WebLogic Deploy Tooling (WDT) installation - A WDT archive with version `v1` of an exploded Java EE web application - A WDT model with: - A WebLogic Administration Server - A WebLogic cluster - A reference to the web application + - A WebLogic image with a WebLogic and java installation. - Kubernetes Secrets: - WebLogic credentials - Required WDT runtime password - A Domain with: - `metadata.name` and `weblogic.domainUID` label set to `sample-domain1` - `spec.domainHomeSourceType: FromModel` - - `spec.image: model-in-image:WLS-v1` + - `spec.image` set to a WebLogic image with a WebLogic and java installation. - References to the secrets -- [Update 1]({{< relref "/samples/domains/model-in-image/update1.md" >}}): Demonstrates updating the initial domain by dynamically adding a data source using a model ConfigMap and then restarting (rolling) the domain to propagate the change. +- [Update 1]({{< relref "/samples/domains/model-in-image/update1.md" >}}): Demonstrates updating the initial domain by dynamically adding a data source using a model ConfigMap and then restarting (rolling) the domain to propagate the change. Updates: - - Image `model-in-image:WLS-v1`: - - Same image as Initial use case - Kubernetes Secrets: - Same as Initial use case, plus secrets for data source credentials and URL - Kubernetes ConfigMap with: - A WDT model for a data source targeted to the cluster - - A Domain, same as Initial use case, plus: + - Domain, same as Initial use case, plus: - `spec.model.configMap` referencing the ConfigMap - References to data source secrets -- [Update 2]({{< relref "/samples/domains/model-in-image/update2.md" >}}): Demonstrates deploying a second domain (similar to the Update 1 use case domain). +- [Update 2]({{< relref "/samples/domains/model-in-image/update2.md" >}}): Demonstrates deploying a second domain (similar to the Update 1 use case domain). Updates: - - Image `model-in-image:WLS-v1`: - - Same image as the Initial and Update 1 use cases - Kubernetes Secrets and ConfigMap: - Similar to the Update 1 use case, except names and labels are decorated with a new domain UID - A Domain, similar to Update 1 use case, except: @@ -67,20 +72,16 @@ This sample demonstrates five Model in Image use cases: - Its secret/ConfigMap references are decorated with `sample-domain2` instead of `sample-domain1` - Has a changed `env` variable that sets a new domain name -- [Update 3]({{< relref "/samples/domains/model-in-image/update3.md" >}}): Demonstrates deploying an updated image with an updated application to the Update 1 use case domain and then restarting (rolling) its domain to propagate the change. +- [Update 3]({{< relref "/samples/domains/model-in-image/update3.md" >}}): Demonstrates deploying an updated auxiliary image with an updated application to the Update 1 use case domain and then restarting (rolling) its domain to propagate the change. Updates: - - Image `model-in-image:WLS-v2`, similar to `model-in-image:WLS-v1` image with: + - Auxiliary image `model-in-image:WLS-AI-v2`, similar to `model-in-image:WLS-AI-v1` image with: - An updated web application `v2` at the `myapp-v2` directory path instead of `myapp-v1` - An updated model that points to the new web application path - - Kubernetes Secrets and ConfigMap: - - Same as the Update 1 use case - - A Domain: - - Same as the Update 1 use case, except `spec.image` is `model-in-image:WLS-v2` + - Domain: + - Same as the Update 1 use case, except `spec.image` is `model-in-image:WLS-AI-v2` -- [Update 4]({{< relref "/samples/domains/model-in-image/update4.md" >}}): Demonstrates dynamically updating the running Update 1 or Update 3 WebLogic domain configuration without requiring a domain restart (roll). +- [Update 4]({{< relref "/samples/domains/model-in-image/update4.md" >}}): Demonstrates dynamically updating the running Update 1 or Update 3 WebLogic domain configuration without requiring a domain restart (roll). Updates: - - Image `model-in-image:WLS-v1` or `model-in-image:WLS-v2`: - - Same image as Update 1 or Update 3 use cases - Kubernetes ConfigMap with: - A WDT model for Work Manager minimum and maximum threads constraints, plus the same data source as the Update 1 use case - Kubernetes Secrets: diff --git a/documentation/4.0/content/samples/domains/model-in-image/cleanup.md b/documentation/4.0/content/samples/domains/model-in-image/cleanup.md index 2a2fa4f4e28..08193a45448 100644 --- a/documentation/4.0/content/samples/domains/model-in-image/cleanup.md +++ b/documentation/4.0/content/samples/domains/model-in-image/cleanup.md @@ -49,14 +49,14 @@ To remove the resources you have created in these samples: 7. Delete the images you may have created in this sample: ```shell - $ docker image rm model-in-image:WLS-v1 + $ docker image rm model-in-image:WLS-AI-v1 ``` ```shell - $ docker image rm model-in-image:WLS-v2 + $ docker image rm model-in-image:WLS-AI-v2 ``` ```shell - $ docker image rm model-in-image:JRF-v1 + $ docker image rm model-in-image:JRF-AI-v1 ``` ```shell - $ docker image rm model-in-image:JRF-v2 + $ docker image rm model-in-image:JRF-AI-v2 ``` diff --git a/documentation/4.0/content/samples/domains/model-in-image/initial.md b/documentation/4.0/content/samples/domains/model-in-image/initial.md index 7e5b38a9652..aa9e7efbbe5 100644 --- a/documentation/4.0/content/samples/domains/model-in-image/initial.md +++ b/documentation/4.0/content/samples/domains/model-in-image/initial.md @@ -22,26 +22,34 @@ weight: 2 In this use case, you set up an initial WebLogic domain. This involves: - - A WDT archive ZIP file that contains your applications. - - A WDT model that describes your WebLogic configuration. - - A container image that contains your WDT model files and archive. + - Creating an auxiliary image with: + - A WDT archive ZIP file that contains your applications. + - A WDT model that describes your WebLogic configuration. + - A WDT install that contains the binaries for running WDT. - Creating secrets for the domain. - - Creating a Domain YAML file for the domain that references your Secrets and image. + - Creating a Domain YAML file for the domain that references your Secrets, auxiliary image, and a WebLogic image. After the Domain is deployed, the operator starts an 'introspector job' that converts your models into a WebLogic configuration, and then passes this configuration to each WebLogic Server in the domain. {{% notice note %}} Perform the steps in [Prerequisites for all domain types]({{< relref "/samples/domains/model-in-image/prerequisites.md" >}}) before performing the steps in this use case. -If you are taking the `JRF` path through the sample, then substitute `JRF` for `WLS` in your image names and directory paths. Also note that the JRF-v1 model YAML file differs from the WLS-v1 YAML file (it contains an additional `domainInfo -> RCUDbInfo` stanza). +If you are taking the `JRF` path through the sample, then substitute `JRF` for `WLS` in your image names and directory paths. Also note that the JRF-AI-v1 model YAML file differs from the WLS-AI-v1 YAML file (it contains an additional `domainInfo -> RCUDbInfo` stanza). {{% /notice %}} #### Image creation - Introduction -The goal of the initial use case 'image creation' is to demonstrate using the WebLogic Image Tool to create an image named `model-in-image:WLS-v1` from files that you will stage to `/tmp/mii-sample/model-images/model-in-image:WLS-v1/`. The staged files will contain a web application in a WDT archive, and WDT model configuration for a WebLogic Administration Server called `admin-server` and a WebLogic cluster called `cluster-1`. +The goal of the initial use case 'image creation' step is to demonstrate using the WebLogic Image Tool to create an auxiliary image named `model-in-image:WLS-AI-v1` from files that you will stage to `/tmp/mii-sample/model-images/model-in-image__WLS-AI-v1/`. The staged files will contain a web application in a WDT archive, and WDT model configuration for a WebLogic Administration Server called `admin-server` and a WebLogic cluster called `cluster-1`. -Overall, a Model in Image image must contain a WebLogic installation and a WebLogic Deploy Tooling installation in its `/u01/wdt/weblogic-deploy` directory. In addition, if you have WDT model archive files, then the image must also contain these files in its `/u01/wdt/models` directory. Finally, an image optionally may also contain your WDT model YAML file and properties files in the same `/u01/wdt/models` directory. If you do not specify a WDT model YAML file in your `/u01/wdt/models` directory, then the model YAML file must be supplied dynamically using a Kubernetes ConfigMap that is referenced by your Domain `spec.model.configMap` field. We provide an example of using a model ConfigMap later in this sample. +A Model in Image domain usually supplies one or more auxiliary images with: +- A WebLogic Deploy Tooling installation (expected in an image's `/auxiliary/weblogic-deploy` directory by default). +- WDT model YAML, property, and archive files (expected in directory `/auxiliary/models` by default). -Here are the steps for creating the image `model-in-image:WLS-v1`: +If you do not specify a WDT model YAML file in an auxiliary image, +then the model YAML file can alternately be supplied dynamically using a Kubernetes ConfigMap +that is referenced by your Domain `spec.model.configMap` field. +We provide an example of using a model ConfigMap later in this sample. + +Here are the steps for creating the image `model-in-image:WLS-AI-v1`: - [Understanding your first archive](#understanding-your-first-archive) - [Staging a ZIP file of the archive](#staging-a-zip-file-of-the-archive) @@ -157,7 +165,7 @@ The application displays important details about the WebLogic Server instance th #### Staging a ZIP file of the archive -When you create the image, you will use the files in the staging directory, `/tmp/mii-sample/model-images/model-in-image__WLS-v1`. In preparation, you need it to contain a ZIP file of the WDT application archive. +When you create the image, you will use the files in the staging directory, `/tmp/mii-sample/model-images/model-in-image__WLS-AI-v1`. In preparation, you need it to contain a ZIP file of the WDT application archive. Run the following commands to create your application archive ZIP file and put it in the expected directory: @@ -165,7 +173,7 @@ Run the following commands to create your application archive ZIP file and put i # Delete existing archive.zip in case we have an old leftover version ``` ```shell -$ rm -f /tmp/mii-sample/model-images/model-in-image__WLS-v1/archive.zip +$ rm -f /tmp/mii-sample/model-images/model-in-image__WLS-AI-v1/archive.zip ``` ``` # Move to the directory which contains the source files for our archive @@ -177,12 +185,12 @@ $ cd /tmp/mii-sample/archives/archive-v1 # Zip the archive to the location will later use when we run the WebLogic Image Tool ``` ```shell -$ zip -r /tmp/mii-sample/model-images/model-in-image__WLS-v1/archive.zip wlsdeploy +$ zip -r /tmp/mii-sample/model-images/model-in-image__WLS-AI-v1/archive.zip wlsdeploy ``` #### Staging model files -In this step, you explore the staged WDT model YAML file and properties in the `/tmp/mii-sample/model-images/model-in-image__WLS-v1` directory. The model in this directory references the web application in your archive, configures a WebLogic Server Administration Server, and configures a WebLogic cluster. It consists of only two files, `model.10.properties`, a file with a single property, and, `model.10.yaml`, a YAML file with your WebLogic configuration `model.10.yaml`. +In this step, you explore the staged WDT model YAML file and properties in the `/tmp/mii-sample/model-images/model-in-image__WLS-AI-v1` directory. The model in this directory references the web application in your archive, configures a WebLogic Server Administration Server, and configures a WebLogic cluster. It consists of only two files, `model.10.properties`, a file with a single property, and, `model.10.yaml`, a YAML file with your WebLogic configuration `model.10.yaml`. ``` CLUSTER_SIZE=5 @@ -320,42 +328,37 @@ A Model in Image image can contain multiple properties files, archive ZIP files, #### Creating the image with WIT -**Note**: If you are using JRF in this sample, substitute `JRF` for each occurrence of `WLS` in the following `imagetool` command line, plus substitute `container-registry.oracle.com/middleware/fmw-infrastructure:12.2.1.4` for the `--fromImage` value. +**Note**: If you are using JRF in this sample, substitute `JRF` for each occurrence of `WLS` in the following `imagetool` command line. -At this point, you have staged all of the files needed for image `model-in-image:WLS-v1`; they include: +At this point, you have staged all of the files needed for image `model-in-image:WLS-AI-v1`; they include: - `/tmp/mii-sample/model-images/weblogic-deploy.zip` - - `/tmp/mii-sample/model-images/model-in-image__WLS-v1/model.10.yaml` - - `/tmp/mii-sample/model-images/model-in-image__WLS-v1/model.10.properties` - - `/tmp/mii-sample/model-images/model-in-image__WLS-v1/archive.zip` + - `/tmp/mii-sample/model-images/model-in-image__WLS-AI-v1/model.10.yaml` + - `/tmp/mii-sample/model-images/model-in-image__WLS-AI-v1/model.10.properties` + - `/tmp/mii-sample/model-images/model-in-image__WLS-AI-v1/archive.zip` If you don't see the `weblogic-deploy.zip` file, then you missed a step in the [prerequisites]({{< relref "/samples/domains/model-in-image/prerequisites.md" >}}). -Now, you use the Image Tool to create an image named `model-in-image:WLS-v1` that's layered on a base WebLogic image. You've already set up this tool during the prerequisite steps. - -Run the following commands to create the model image and verify that it worked: +Now, you use the Image Tool to create an auxiliary image named `model-in-image:WLS-AI-v1`. You've already set up this tool during the prerequisite steps. +Run the following commands to create the image and verify that it worked: ```shell - $ cd /tmp/mii-sample/model-images + $ cd /tmp/mii-sample/model-images/model-in-image__WLS-AI-v1 ``` ```shell - $ ./imagetool/bin/imagetool.sh update \ - --tag model-in-image:WLS-v1 \ - --fromImage container-registry.oracle.com/middleware/weblogic:12.2.1.4 \ - --wdtModel ./model-in-image__WLS-v1/model.10.yaml \ - --wdtVariables ./model-in-image__WLS-v1/model.10.properties \ - --wdtArchive ./model-in-image__WLS-v1/archive.zip \ - --wdtModelOnly \ - --wdtDomainType WLS \ - --chown oracle:root + $ /tmp/mii-sample/model-images/imagetool/bin/imagetool.sh createAuxImage \ + --tag model-in-image:WLS-AI-v1 \ + --wdtModel ./model.10.yaml \ + --wdtVariables ./model.10.properties \ + --wdtArchive ./archive.zip ``` If you don't see the `imagetool` directory, then you missed a step in the [prerequisites]({{< relref "/samples/domains/model-in-image/prerequisites.md" >}}). This command runs the WebLogic Image Tool in its Model in Image mode, and does the following: - - Builds the final container image as a layer on the `container-registry.oracle.com/middleware/weblogic:12.2.1.4` base image. + - Builds the final container image as a layer on a small `busybox` base image. - Copies the WDT ZIP file that's referenced in the WIT cache into the image. - Note that you cached WDT in WIT using the keyword `latest` when you set up the cache during the sample prerequisites steps. - This lets WIT implicitly assume it's the desired WDT version and removes the need to pass a `-wdtVersion` flag. @@ -363,11 +366,38 @@ This command runs the WebLogic Image Tool in its Model in Image mode, and does t When the command succeeds, it should end with output like the following: - ``` - [INFO ] Build successful. Build time=36s. Image tag=model-in-image:WLS-v1 - ``` +``` +[INFO ] Build successful. Build time=36s. Image tag=model-in-image:WLS-AI-v1 +``` + +Also, if you run the `docker images` command, then you will see an image named `model-in-image:WLS-AI-v1`. + +After the image is created, it should have the WDT executables in +`/auxiliary/weblogic-deploy`, and WDT model, property, and archive +files in `/auxiliary/models`. You can run `ls` in the Docker +image to verify this: -Also, if you run the `docker images` command, then you will see an image named `model-in-image:WLS-v1`. +```shell +$ docker run -it --rm model-in-image:WLS-AI-v1 ls -l /auxiliary + total 8 + drwxr-xr-x 1 oracle root 4096 Jun 1 21:53 models + drwxr-xr-x 1 oracle root 4096 May 26 22:29 weblogic-deploy + +$ docker run -it --rm model-in-image:WLS-AI-v1 ls -l /auxiliary/models + total 16 + -rw-rw-r-- 1 oracle root 5112 Jun 1 21:52 archive.zip + -rw-rw-r-- 1 oracle root 173 Jun 1 21:59 model.10.properties + -rw-rw-r-- 1 oracle root 1515 Jun 1 21:59 model.10.yaml + +$ docker run -it --rm model-in-image:WLS-AI-v1 ls -l /auxiliary/weblogic-deploy + total 28 + -rw-r----- 1 oracle root 4673 Oct 22 2019 LICENSE.txt + -rw-r----- 1 oracle root 30 May 25 11:40 VERSION.txt + drwxr-x--- 1 oracle root 4096 May 26 22:29 bin + drwxr-x--- 1 oracle root 4096 May 25 11:40 etc + drwxr-x--- 1 oracle root 4096 May 25 11:40 lib + drwxr-x--- 1 oracle root 4096 Jan 22 2019 samples +``` **NOTE**: If you have Kubernetes cluster worker nodes that are remote to your local machine, then you need to put the image in a location that these nodes can access. See [Ensuring your Kubernetes cluster can access images]({{< relref "/samples/domains/model-in-image/_index.md#ensuring-your-kubernetes-cluster-can-access-images" >}}). @@ -486,11 +516,11 @@ Run the following `kubectl` commands to deploy the required secrets: Now, you create a Domain YAML file. A Domain is the key resource that tells the operator how to deploy a WebLogic domain. -Copy the following to a file called `/tmp/mii-sample/mii-initial.yaml` or similar, or use the file `/tmp/mii-sample/domain-resources/WLS/mii-initial-d1-WLS-v1.yaml` that is included in the sample source. +Copy the following to a file called `/tmp/mii-sample/mii-initial.yaml` or similar, or use the file `/tmp/mii-sample/domain-resources/WLS-AI/mii-initial-d1-WLS-AI-v1.yaml` that is included in the sample source. {{%expand "Click here to view the WLS Domain YAML file." %}} ```yaml -# Copyright (c) 2020, 2022, Oracle and/or its affiliates. +# Copyright (c) 2021, 2022, Oracle and/or its affiliates. # Licensed under the Universal Permissive License v 1.0 as shown at http://oss.oracle.com/licenses/upl. # # This is an example of how to define a Domain resource. @@ -512,7 +542,14 @@ spec: domainHome: /u01/domains/sample-domain1 # The WebLogic Server image that the Operator uses to start the domain - image: "model-in-image:WLS-v1" + # **NOTE**: + # This sample uses General Availability (GA) images. GA images are suitable for demonstration and + # development purposes only where the environments are not available from the public Internet; + # they are not acceptable for production use. In production, you should always use CPU (patched) + # images from OCR or create your images using the WebLogic Image Tool. + # Please refer to the `OCR` and `WebLogic Images` pages in the WebLogic Kubernetes Operator + # documentation for details. + image: "container-registry.oracle.com/middleware/weblogic:12.2.1.4" # Defaults to "Always" if image tag (version) is ':latest' imagePullPolicy: IfNotPresent @@ -520,10 +557,11 @@ spec: # Identify which Secret contains the credentials for pulling an image #imagePullSecrets: #- name: regsecret - + #- name: regsecret2 + # Identify which Secret contains the WebLogic Admin credentials, # the secret must contain 'username' and 'password' fields. - webLogicCredentialsSecret: + webLogicCredentialsSecret: name: sample-domain1-weblogic-credentials # Whether to include the WebLogic Server stdout in the pod's stdout, default is true @@ -531,11 +569,11 @@ spec: # Whether to enable overriding your log file location, see also 'logHome' #logHomeEnabled: false - + # The location for domain log, server logs, server out, introspector out, and Node Manager log files # see also 'logHomeEnabled', 'volumes', and 'volumeMounts'. #logHome: /shared/logs/sample-domain1 - + # Set which WebLogic Servers the Operator will start # - "Never" will not start any server in the domain # - "AdminOnly" will start up only the administration server (no managed servers will be started) @@ -545,7 +583,7 @@ spec: # Settings for all server pods in the domain including the introspector job pod serverPod: # Optional new or overridden environment variables for the domain's pods - # - This sample uses CUSTOM_DOMAIN_NAME in its image model file + # - This sample uses CUSTOM_DOMAIN_NAME in its image model file # to set the WebLogic domain name env: - name: CUSTOM_DOMAIN_NAME @@ -575,15 +613,13 @@ spec: # channels: # - channelName: default # nodePort: 30701 - + # The number of managed servers to start for unlisted clusters replicas: 1 - # The desired behavior for starting a specific cluster's member servers + # The name of each Cluster resource clusters: - - clusterName: cluster-1 - # The number of managed servers to start for this cluster - replicas: 2 + - name: sample-domain1-cluster-1 # Change the restartVersion to force the introspector job to rerun # and apply any new model configuration, to also force a subsequent @@ -601,6 +637,21 @@ spec: # Valid model domain types are 'WLS', 'JRF', and 'RestrictedJRF', default is 'WLS' domainType: WLS + # Optional auxiliary image(s) containing WDT model, archives, and install. + # Files are copied from `sourceModelHome` in the aux image to the `/aux/models` directory + # in running WebLogic Server pods, and files are copied from `sourceWDTInstallHome` + # to the `/aux/weblogic-deploy` directory. Set `sourceModelHome` and/or `sourceWDTInstallHome` + # to "None" if you want skip such copies. + # `image` - Image location + # `imagePullPolicy` - Pull policy, default `IfNotPresent` + # `sourceModelHome` - Model file directory in image, default `/auxiliary/models`. + # `sourceWDTInstallHome` - WDT install directory in image, default `/auxiliary/weblogic-deploy`. + auxiliaryImages: + - image: "model-in-image:WLS-AI-v1" + #imagePullPolicy: IfNotPresent + #sourceWDTInstallHome: /auxiliary/weblogic-deploy + #sourceModelHome: /auxiliary/models + # Optional configmap for additional models and variable files #configMap: sample-domain1-wdt-config-map @@ -611,6 +662,23 @@ spec: # (the model yaml in the optional configMap or in the image) #secrets: #- sample-domain1-datasource-secret + +--- + +apiVersion: "weblogic.oracle/v1" +kind: Cluster +metadata: + name: sample-domain1-cluster-1 + # Update this with the namespace your domain will run in: + namespace: sample-domain1-ns + labels: + # Update this with the `domainUID` of your domain: + weblogic.domainUID: sample-domain1 +spec: + # This must match a cluster name that is specified in the WebLogic configuration + clusterName: cluster-1 + # The number of managed servers to start for this cluster + replicas: 2 ``` {{% /expand %}} @@ -638,7 +706,14 @@ spec: domainHome: /u01/domains/sample-domain1 # The WebLogic Server image that the Operator uses to start the domain - image: "model-in-image:JRF-v1" + # **NOTE**: + # This sample uses General Availability (GA) images. GA images are suitable for demonstration and + # development purposes only where the environments are not available from the public Internet; + # they are not acceptable for production use. In production, you should always use CPU (patched) + # images from OCR or create your images using the WebLogic Image Tool. + # Please refer to the `OCR` and `Manage FMW infrastructure domains` pages in the WebLogic + # Kubernetes Operator documentation for details. + image: "container-registry.oracle.com/middleware/fmw-infrastructure:12.2.1.4" # Defaults to "Always" if image tag (version) is ':latest' imagePullPolicy: IfNotPresent @@ -646,10 +721,11 @@ spec: # Identify which Secret contains the credentials for pulling an image #imagePullSecrets: #- name: regsecret - + #- name: regsecret2 + # Identify which Secret contains the WebLogic Admin credentials, # the secret must contain 'username' and 'password' fields. - webLogicCredentialsSecret: + webLogicCredentialsSecret: name: sample-domain1-weblogic-credentials # Whether to include the WebLogic Server stdout in the pod's stdout, default is true @@ -657,11 +733,11 @@ spec: # Whether to enable overriding your log file location, see also 'logHome' #logHomeEnabled: false - + # The location for domain log, server logs, server out, introspector out, and Node Manager log files # see also 'logHomeEnabled', 'volumes', and 'volumeMounts'. #logHome: /shared/logs/sample-domain1 - + # Set which WebLogic Servers the Operator will start # - "Never" will not start any server in the domain # - "AdminOnly" will start up only the administration server (no managed servers will be started) @@ -671,7 +747,7 @@ spec: # Settings for all server pods in the domain including the introspector job pod serverPod: # Optional new or overridden environment variables for the domain's pods - # - This sample uses CUSTOM_DOMAIN_NAME in its image model file + # - This sample uses CUSTOM_DOMAIN_NAME in its image model file # to set the WebLogic domain name env: - name: CUSTOM_DOMAIN_NAME @@ -706,15 +782,13 @@ spec: env: - name: USER_MEM_ARGS value: "-Djava.security.egd=file:/dev/./urandom -Xms512m -Xmx1024m " - + # The number of managed servers to start for unlisted clusters replicas: 1 - # The desired behavior for starting a specific cluster's member servers + # The name of each Cluster resource clusters: - - clusterName: cluster-1 - # The number of managed servers to start for this cluster - replicas: 2 + - name: sample-domain1-cluster-1 # Change the restartVersion to force the introspector job to rerun # and apply any new model configuration, to also force a subsequent @@ -732,6 +806,21 @@ spec: # Valid model domain types are 'WLS', 'JRF', and 'RestrictedJRF', default is 'WLS' domainType: JRF + # Optional auxiliary image(s) containing WDT model, archives, and install. + # Files are copied from `sourceModelHome` in the aux image to the `/aux/models` directory + # in running WebLogic Server pods, and files are copied from `sourceWDTInstallHome` + # to the `/aux/weblogic-deploy` directory. Set `sourceModelHome` and/or `sourceWDTInstallHome` + # to "None" if you want skip such copies. + # `image` - Image location + # `imagePullPolicy` - Pull policy, default `IfNotPresent` + # `sourceModelHome` - Model file directory in image, default `/auxiliary/models`. + # `sourceWDTInstallHome` - WDT install directory in image, default `/auxiliary/weblogic-deploy`. + auxiliaryImages: + - image: "model-in-image:JRF-AI-v1" + #imagePullPolicy: IfNotPresent + #sourceWDTInstallHome: /auxiliary/weblogic-deploy + #sourceModelHome: /auxiliary/models + # Optional configmap for additional models and variable files #configMap: sample-domain1-wdt-config-map @@ -754,6 +843,23 @@ spec: # Name of secret with walletFile containing base64 encoded opss wallet, used for JRF domains #walletFileSecret: sample-domain1-opss-walletfile-secret + +--- + +apiVersion: "weblogic.oracle/v1" +kind: Cluster +metadata: + name: sample-domain1-cluster-1 + # Update this with the namespace your domain will run in: + namespace: sample-domain1-ns + labels: + # Update this with the `domainUID` of your domain: + weblogic.domainUID: sample-domain1 +spec: + # This must match a cluster name that is specified in the WebLogic configuration + clusterName: cluster-1 + # The number of managed servers to start for this cluster + replicas: 2 ``` {{% /expand %}} @@ -762,7 +868,7 @@ spec: Run the following command to create the domain custom resource: ```shell - $ kubectl apply -f /tmp/mii-sample/domain-resources/WLS/mii-initial-d1-WLS-v1.yaml + $ kubectl apply -f /tmp/mii-sample/domain-resources/WLS-AI/mii-initial-d1-WLS-AI-v1.yaml ``` **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 previous command. Previously, we suggested naming it `/tmp/mii-sample/mii-initial.yaml`. diff --git a/documentation/4.0/content/samples/domains/model-in-image/update1.md b/documentation/4.0/content/samples/domains/model-in-image/update1.md index 586bb14a49a..29ba2f1b833 100644 --- a/documentation/4.0/content/samples/domains/model-in-image/update1.md +++ b/documentation/4.0/content/samples/domains/model-in-image/update1.md @@ -114,7 +114,7 @@ Here are the steps: - Option 1: Update a copy of your Domain YAML file from the Initial use case. - - In the [Initial]({{< relref "/samples/domains/model-in-image/initial.md" >}}) use case, we suggested creating a Domain YAML file named `/tmp/mii-sample/mii-initial.yaml` or using the `/tmp/mii-sample/domain-resources/WLS/mii-initial-d1-WLS-v1.yaml` file that is supplied with the sample. + - In the [Initial]({{< relref "/samples/domains/model-in-image/initial.md" >}}) use case, we suggested creating a Domain YAML file named `/tmp/mii-sample/mii-initial.yaml` or using the `/tmp/mii-sample/domain-resources/WLS-AI/mii-initial-d1-WLS-AI-v1.yaml` file that is supplied with the sample. - We suggest copying the original Domain YAML file and naming the copy `/tmp/mii-sample/mii-update1.yaml` before making any changes. - Working on a copy is not strictly necessary, but it helps keep track of your work for the different use cases in this sample and provides you a backup of your previous work. @@ -156,7 +156,7 @@ Here are the steps: **NOTE**: Before you deploy the domain custom resource, determine if you have Kubernetes cluster worker nodes that are remote to your local machine. If so, then you need to put the Domain YAML file's image in a location that these nodes can access and you may also need to modify your Domain YAML file to reference the new location. See [Ensuring your Kubernetes cluster can access images]({{< relref "/samples/domains/model-in-image/_index.md#ensuring-your-kubernetes-cluster-can-access-images" >}}). ```shell - $ kubectl apply -f /tmp/miisample/domain-resources/WLS/mii-update1-d1-WLS-v1-ds.yaml + $ kubectl apply -f /tmp/mii-sample/domain-resources/WLS-AI/mii-update1-d1-WLS-AI-v1-ds.yaml ``` 1. Restart ('roll') the domain. diff --git a/documentation/4.0/content/samples/domains/model-in-image/update2.md b/documentation/4.0/content/samples/domains/model-in-image/update2.md index 27a506520ea..7cffef33405 100644 --- a/documentation/4.0/content/samples/domains/model-in-image/update2.md +++ b/documentation/4.0/content/samples/domains/model-in-image/update2.md @@ -163,7 +163,7 @@ Here are the steps for this use case: - Option 1: Update a copy of your Domain YAML file from the Update 1 use case. - - In the [Update 1]({{< relref "/samples/domains/model-in-image/update1.md" >}}) use case, we suggested creating a file named `/tmp/mii-sample/mii-update1.yaml` or using the `/tmp/mii-sample/domain-resources/WLS/mii-update1-d1-WLS-v1-ds.yaml` file that is supplied with the sample. + - In the [Update 1]({{< relref "/samples/domains/model-in-image/update1.md" >}}) use case, we suggested creating a file named `/tmp/mii-sample/mii-update1.yaml` or using the `/tmp/mii-sample/domain-resources/WLS-AI/mii-update1-d1-WLS-AI-v1-ds.yaml` file that is supplied with the sample. - We suggest copying this Domain YAML file and naming the copy `/tmp/mii-sample/mii-update2.yaml` before making any changes. - Working on a copy is not strictly necessary, but it helps keep track of your work for the different use cases in this sample and provides you a backup of your previous work. @@ -341,7 +341,7 @@ Here are the steps for this use case: **NOTE**: Before you deploy the Domain YAML file, determine if you have Kubernetes cluster worker nodes that are remote to your local machine. If so, you need to put the Domain's image in a location that these nodes can access and you may also need to modify your Domain YAML file to reference the new location. See [Ensuring your Kubernetes cluster can access images]({{< relref "/samples/domains/model-in-image/_index.md#ensuring-your-kubernetes-cluster-can-access-images" >}}). ```shell - $ kubectl apply -f /tmp/miisample/domain-resources/WLS/mii-update2-d2-WLS-v1-ds.yaml + $ kubectl apply -f /tmp/mii-sample/domain-resources/WLS-AI/mii-update2-d2-WLS-AI-v1-ds.yaml ``` 1. Wait for `sample-domain2` to start. diff --git a/documentation/4.0/content/samples/domains/model-in-image/update3.md b/documentation/4.0/content/samples/domains/model-in-image/update3.md index d947c400946..3d1ec0f9954 100644 --- a/documentation/4.0/content/samples/domains/model-in-image/update3.md +++ b/documentation/4.0/content/samples/domains/model-in-image/update3.md @@ -8,7 +8,7 @@ The Update 3 use case demonstrates deploying an updated WebLogic application to In the use case, you will: - - Create an image `model-in-image:WLS-v2` that is similar to the currently active `model-in-image:WLS-v1` image, but with the following updates: + - Create an image `model-in-image:WLS-AI-v2` that is similar to the currently active `model-in-image:WLS-AI-v1` image, but with the following updates: - An updated web application `v2` at the `myapp-v2` directory path within the WDT application archive instead of `myapp-v1`. - An updated model YAML file within the image that points to the new web application path. - Apply an updated Domain YAML file that references the new image while still referencing the original [Update 1]({{< relref "/samples/domains/model-in-image/update1.md" >}}) use case secrets and model ConfigMap. @@ -27,9 +27,9 @@ Here are the steps for this use case: 1. Make sure you have deployed the domain from the [Update 1]({{< relref "/samples/domains/model-in-image/update1.md" >}}) use case. -2. Create an updated image. +2. Create an updated auxiliary image. - Recall that a goal of the [Initial]({{< relref "/samples/domains/model-in-image/initial.md" >}}) use case was to demonstrate using the WebLogic Image Tool to create an image named `model-in-image:WLS-v1` from files that were staged in `/tmp/mii-sample/model-images/model-in-image:WLS-v1/`. The staged files included a web application in a WDT ZIP archive, and WDT model configuration for a WebLogic Administration Server called `admin-server` and a WebLogic cluster called `cluster-1`. The final image was called `model-in-image:WLS-v1` and, in addition to having a copy of the staged files in its `/u01/wdt/models` directory, also contained a WebLogic installation and a WebLogic Deploy Tooling installation. + Recall that a goal of the [Initial]({{< relref "/samples/domains/model-in-image/initial.md" >}}) use case was to demonstrate using the WebLogic Image Tool to create an auxiliary image named `model-in-image:WLS-AI-v1` from files that were staged in `/tmp/mii-sample/model-images/model-in-image__WLS-AI-v1/`. The staged files included a web application in a WDT ZIP archive, and WDT model configuration for a WebLogic Administration Server called `admin-server` and a WebLogic cluster called `cluster-1`. The final image was called `model-in-image:WLS-AI-v1` and, in addition to having a copy of the staged files in its `/auxiliary/models` directory, also contained a WebLogic Deploy Tooling installation in its `/auxiliary/weblogic-deploy` directory. In this use case, you will follow similar steps to the [Initial]({{< relref "/samples/domains/model-in-image/initial.md" >}}) use case to create a new image with an updated application and model, plus deploy the updated model and application to the running [Update 1]({{< relref "/samples/domains/model-in-image/update1.md" >}}) use case domain. @@ -45,7 +45,7 @@ Here are the steps for this use case: **NOTE**: If you are using JRF in this sample, substitute `JRF` for each occurrence of `WLS` in the following paths. - When you create your updated image, you will use the files in staging directory `/tmp/mii-sample/model-in-image__WLS-v2`. In preparation, you need it to contain a ZIP file of the new WDT application archive. + When you create your updated image, you will use the files in staging directory `/tmp/mii-sample/model-in-image__WLS-AI-v2`. In preparation, you need it to contain a ZIP file of the new WDT application archive. Run the following commands to create your application archive ZIP file and put it in the expected directory: @@ -53,7 +53,7 @@ Here are the steps for this use case: # Delete existing archive.zip in case we have an old leftover version ``` ```shell - $ rm -f /tmp/mii-sample/model-images/model-in-image__WLS-v2/archive.zip + $ rm -f /tmp/mii-sample/model-images/model-in-image__WLS-AI-v2/archive.zip ``` ``` # Move to the directory which contains the source files for our new archive @@ -65,12 +65,12 @@ Here are the steps for this use case: # Zip the archive to the location will later use when we run the WebLogic Image Tool ``` ```shell - $ zip -r /tmp/mii-sample/model-images/model-in-image__WLS-v2/archive.zip wlsdeploy + $ zip -r /tmp/mii-sample/model-images/model-in-image__WLS-AI-v2/archive.zip wlsdeploy ``` - Understanding your staged model files. - The WDT model YAML file and properties for this use case have already been staged for you to directory `/tmp/mii-sample/model-in-image__WLS-v2`. + The WDT model YAML file and properties for this use case have already been staged for you to directory `/tmp/mii-sample/model-in-image__WLS-AI-v2`. The `model.10.yaml` file in this directory has an updated path `wlsdeploy/applications/myapp-v2` that references the updated web application in your archive, but is otherwise identical to the model staged for the original image. The final related YAML file stanza looks like this: @@ -85,54 +85,50 @@ Here are the steps for this use case: If you would like to review the entire original model before this change, see [Staging model files]({{< relref "/samples/domains/model-in-image/initial#staging-model-files" >}}) in the Initial use case. - - Create a new image from your staged model files using WIT. + - Create a new auxiliary image from your staged model files using WIT. **Note**: If you are using JRF in this sample, substitute `JRF` for each occurrence of `WLS` in the following `imagetool` command line, plus substitute `container-registry.oracle.com/middleware/fmw-infrastructure:12.2.1.4` for the `--fromImage` value. - At this point, you have staged all of the files needed for image `model-in-image:WLS-v2`; they include: + At this point, you have staged all of the files needed for image `model-in-image:WLS-AI-v2`; they include: - `/tmp/mii-sample/model-images/weblogic-deploy.zip` - - `/tmp/mii-sample/model-images/model-in-image__WLS-v2/model.10.yaml` - - `/tmp/mii-sample/model-images/model-in-image__WLS-v2/model.10.properties` - - `/tmp/mii-sample/model-images/model-in-image__WLS-v2/archive.zip` + - `/tmp/mii-sample/model-images/model-in-image__WLS-AI-v2/model.10.yaml` + - `/tmp/mii-sample/model-images/model-in-image__WLS-AI-v2/model.10.properties` + - `/tmp/mii-sample/model-images/model-in-image__WLS-AI-v2/archive.zip` If you don't see the `weblogic-deploy.zip` file, then you missed a step in the [prerequisites]({{< relref "/samples/domains/model-in-image/prerequisites.md" >}}). - Now, you use the Image Tool to create an image named `model-in-image:WLS-v2` that's layered on a base WebLogic image. You've already set up this tool during the prerequisite steps. + Now, you use the Image Tool to create an auxiliary image named `model-in-image:WLS-AI-v2`. You've already set up this tool during the prerequisite steps. - Run the following commands to create the model image and verify that it worked: + Run the following commands to create the auxiliary image and verify that it worked: ```shell - $ cd /tmp/mii-sample/model-images + $ cd /tmp/mii-sample/model-images/model-in-image__WLS-AI-v2 ``` ```shell - $ ./imagetool/bin/imagetool.sh update \ - --tag model-in-image:WLS-v2 \ - --fromImage container-registry.oracle.com/middleware/weblogic:12.2.1.4 \ - --wdtModel ./model-in-image__WLS-v2/model.10.yaml \ - --wdtVariables ./model-in-image__WLS-v2/model.10.properties \ - --wdtArchive ./model-in-image__WLS-v2/archive.zip \ - --wdtModelOnly \ - --wdtDomainType WLS \ - --chown oracle:root + $ /tmp/mii-sample/model-images/imagetool/bin/imagetool.sh createAuxImage \ + --tag model-in-image:WLS-AI-v2 \ + --wdtModel ./model.10.yaml \ + --wdtVariables ./model.10.properties \ + --wdtArchive ./archive.zip ``` If you don't see the `imagetool` directory, then you missed a step in the [prerequisites]({{< relref "/samples/domains/model-in-image/prerequisites.md" >}}). This command runs the WebLogic Image Tool in its Model in Image mode, and does the following: - - Builds the final container image as a layer on the `container-registry.oracle.com/middleware/weblogic:12.2.1.4` base image. + - Builds the final auxiliary image as a layer on a small `busybox` base image. - Copies the WDT ZIP file that's referenced in the WIT cache into the image. - Note that you cached WDT in WIT using the keyword `latest` when you set up the cache during the sample prerequisites steps. - This lets WIT implicitly assume it's the desired WDT version and removes the need to pass a `-wdtVersion` flag. - - Copies the specified WDT model, properties, and application archives to image location `/u01/wdt/models`. + - Copies the specified WDT model, properties, and application archives to image location `/auxiliary/models`. When the command succeeds, it will end with output like the following: ``` - [INFO ] Build successful. Build time=36s. Image tag=model-in-image:WLS-v2 + [INFO ] Build successful. Build time=36s. Image tag=model-in-image:WLS-AI-v2 ``` - Also, if you run the `docker images` command, then you will see an image named `model-in-image:WLS-v2`. + Also, if you run the `docker images` command, then you will see an image named `model-in-image:WLS-AI-v2`. **Note**: If you have Kubernetes cluster worker nodes that are remote to your local machine, then you need to put the image in a location that these nodes can access. See [Ensuring your Kubernetes cluster can access images]({{< relref "/samples/domains/model-in-image/_index.md#ensuring-your-kubernetes-cluster-can-access-images" >}}). @@ -144,13 +140,13 @@ Here are the steps for this use case: - Option 1: Update a copy of your Domain YAML file from the Update 1 use case. - - In the [Update 1]({{< relref "/samples/domains/model-in-image/update1.md" >}}) use case, we suggested creating a file named `/tmp/mii-sample/mii-update1.yaml` or using the `/tmp/mii-sample/domain-resources/WLS/mii-update1-d1-WLS-v1-ds.yaml` file that is supplied with the sample. + - In the [Update 1]({{< relref "/samples/domains/model-in-image/update1.md" >}}) use case, we suggested creating a file named `/tmp/mii-sample/mii-update1.yaml` or using the `/tmp/mii-sample/domain-resources/WLS-AI/mii-update1-d1-WLS-AI-v1-ds.yaml` file that is supplied with the sample. - We suggest copying this Domain YAML file and naming the copy `/tmp/mii-sample/mii-update3.yaml` before making any changes. - Working on a copy is not strictly necessary, but it helps keep track of your work for the different use cases in this sample and provides you a backup of your previous work. - - Change the `/tmp/mii-sample/mii-update3.yaml` Domain YAML file's `image` field to reference `model-in-image:WLS-v2` instead of `model-in-image:WLS-v1`. + - Change the `/tmp/mii-sample/mii-update3.yaml` Domain YAML file's `image` field to reference `model-in-image:WLS-AI-v2` instead of `model-in-image:WLS-AI-v1`. The final result will look something like this: @@ -158,7 +154,7 @@ Here are the steps for this use case: ... spec: ... - image: "model-in-image:WLS-v2" + image: "model-in-image:WLS-AI-v2" ``` - Apply your changed Domain YAML file: @@ -174,7 +170,7 @@ Here are the steps for this use case: **NOTE**: Before you deploy the Domain YAML file, determine if you have Kubernetes cluster worker nodes that are remote to your local machine. If so, you need to put the Domain YAML file's image in a location that these nodes can access and you may also need to modify your Domain YAML file to reference the new location. See [Ensuring your Kubernetes cluster can access images]({{< relref "/samples/domains/model-in-image/_index.md#ensuring-your-kubernetes-cluster-can-access-images" >}}). ```shell - $ kubectl apply -f /tmp/miisample/domain-resources/WLS/mii-update3-d1-WLS-v2-ds.yaml + $ kubectl apply -f /tmp/mii-sample/domain-resources/WLS-AI/mii-update3-d1-WLS-AI-v2-ds.yaml ``` diff --git a/documentation/domains/Cluster.json b/documentation/domains/Cluster.json index 263063fcd9f..42e6812d5bc 100644 --- a/documentation/domains/Cluster.json +++ b/documentation/domains/Cluster.json @@ -705,11 +705,11 @@ "type": "string" }, "modelHome": { - "description": "Location of the WebLogic Deploy Tooling model home. Defaults to `/u01/wdt/models` if no `spec.configuration.model.AuxiliaryImages` are specified, and to `/aux/models` otherwise.", + "description": "Location of the WebLogic Deploy Tooling model home. Defaults to `/u01/wdt/models` if no `spec.configuration.model.AuxiliaryImages` are specified, and to `/aux/models` otherwise. WARNING: if `modelHome` is set to a non-default value, then model files in all specified `spec.configuration.model.AuxiliaryImages` are ignored.", "type": "string" }, "wdtInstallHome": { - "description": "Location of the WebLogic Deploy Tooling installation. Defaults to `/u01/wdt/weblogic-deploy` if no `spec.configuration.model.AuxiliaryImages` are specified, and to `/aux/weblogic-deploy` otherwise.", + "description": "Location of the WebLogic Deploy Tooling installation. Defaults to `/u01/wdt/weblogic-deploy` if no `spec.configuration.model.AuxiliaryImages` are specified, and to `/aux/weblogic-deploy` otherwise. WARNING: if `wdtInstallHome` is set to a non-default value, then the WDT install in any specified `spec.configuration.model.AuxiliaryImages` is ignored.", "type": "string" }, "auxiliaryImageVolumeMedium": { diff --git a/documentation/domains/Domain.json b/documentation/domains/Domain.json index 6c282051a2a..95180803f4e 100644 --- a/documentation/domains/Domain.json +++ b/documentation/domains/Domain.json @@ -624,11 +624,11 @@ "type": "string" }, "modelHome": { - "description": "Location of the WebLogic Deploy Tooling model home. Defaults to `/u01/wdt/models` if no `spec.configuration.model.AuxiliaryImages` are specified, and to `/aux/models` otherwise.", + "description": "Location of the WebLogic Deploy Tooling model home. Defaults to `/u01/wdt/models` if no `spec.configuration.model.AuxiliaryImages` are specified, and to `/aux/models` otherwise. WARNING: if `modelHome` is set to a non-default value, then model files in all specified `spec.configuration.model.AuxiliaryImages` are ignored.", "type": "string" }, "wdtInstallHome": { - "description": "Location of the WebLogic Deploy Tooling installation. Defaults to `/u01/wdt/weblogic-deploy` if no `spec.configuration.model.AuxiliaryImages` are specified, and to `/aux/weblogic-deploy` otherwise.", + "description": "Location of the WebLogic Deploy Tooling installation. Defaults to `/u01/wdt/weblogic-deploy` if no `spec.configuration.model.AuxiliaryImages` are specified, and to `/aux/weblogic-deploy` otherwise. WARNING: if `wdtInstallHome` is set to a non-default value, then the WDT install in any specified `spec.configuration.model.AuxiliaryImages` is ignored.", "type": "string" }, "auxiliaryImageVolumeMedium": { diff --git a/documentation/domains/Domain.md b/documentation/domains/Domain.md index 5272a571ddd..d24b740a8cf 100644 --- a/documentation/domains/Domain.md +++ b/documentation/domains/Domain.md @@ -217,10 +217,10 @@ The current status of the operation of the WebLogic domain. Updated automaticall | `auxiliaryImageVolumeSizeLimit` | string | The emptyDir volume size limit. This is an advanced setting that rarely needs to be configured. Defaults to unset. | | `configMap` | string | Name of a ConfigMap containing the WebLogic Deploy Tooling model. | | `domainType` | string | WebLogic Deploy Tooling domain type. Legal values: WLS, RestrictedJRF, JRF. Defaults to WLS. | -| `modelHome` | string | Location of the WebLogic Deploy Tooling model home. Defaults to `/u01/wdt/models` if no `spec.configuration.model.AuxiliaryImages` are specified, and to `/aux/models` otherwise. | +| `modelHome` | string | Location of the WebLogic Deploy Tooling model home. Defaults to `/u01/wdt/models` if no `spec.configuration.model.AuxiliaryImages` are specified, and to `/aux/models` otherwise. WARNING: if `modelHome` is set to a non-default value, then model files in all specified `spec.configuration.model.AuxiliaryImages` are ignored. | | `onlineUpdate` | [Online Update](#online-update) | Online update option for Model In Image dynamic update. | | `runtimeEncryptionSecret` | string | Runtime encryption secret. Required when `domainHomeSourceType` is set to FromModel. | -| `wdtInstallHome` | string | Location of the WebLogic Deploy Tooling installation. Defaults to `/u01/wdt/weblogic-deploy` if no `spec.configuration.model.AuxiliaryImages` are specified, and to `/aux/weblogic-deploy` otherwise. | +| `wdtInstallHome` | string | Location of the WebLogic Deploy Tooling installation. Defaults to `/u01/wdt/weblogic-deploy` if no `spec.configuration.model.AuxiliaryImages` are specified, and to `/aux/weblogic-deploy` otherwise. WARNING: if `wdtInstallHome` is set to a non-default value, then the WDT install in any specified `spec.configuration.model.AuxiliaryImages` is ignored. | ### Opss diff --git a/kubernetes/crd/domain-crd.yaml b/kubernetes/crd/domain-crd.yaml index 61c5f8af0db..171d5c6f909 100644 --- a/kubernetes/crd/domain-crd.yaml +++ b/kubernetes/crd/domain-crd.yaml @@ -5,7 +5,7 @@ apiVersion: apiextensions.k8s.io/v1 kind: CustomResourceDefinition metadata: annotations: - weblogic.sha256: 3a81ece5d88c85957a5d5e4a1b6c068cdca4355afd80a5a6598cbfade313871f + weblogic.sha256: 382a990ad97e781f72144dce441904f51117f2bfdaa220a50c108afdf7604164 name: domains.weblogic.oracle spec: group: weblogic.oracle @@ -281,14 +281,20 @@ spec: locations. type: string modelHome: - description: Location of the WebLogic Deploy Tooling model + description: 'Location of the WebLogic Deploy Tooling model home. Defaults to `/u01/wdt/models` if no `spec.configuration.model.AuxiliaryImages` - are specified, and to `/aux/models` otherwise. + are specified, and to `/aux/models` otherwise. WARNING: + if `modelHome` is set to a non-default value, then model + files in all specified `spec.configuration.model.AuxiliaryImages` + are ignored.' type: string wdtInstallHome: - description: Location of the WebLogic Deploy Tooling installation. + description: 'Location of the WebLogic Deploy Tooling installation. Defaults to `/u01/wdt/weblogic-deploy` if no `spec.configuration.model.AuxiliaryImages` are specified, and to `/aux/weblogic-deploy` otherwise. + WARNING: if `wdtInstallHome` is set to a non-default value, + then the WDT install in any specified `spec.configuration.model.AuxiliaryImages` + is ignored.' type: string auxiliaryImageVolumeMedium: description: The emptyDir volume medium. This is an advanced diff --git a/operator/src/main/java/oracle/kubernetes/weblogic/domain/model/Model.java b/operator/src/main/java/oracle/kubernetes/weblogic/domain/model/Model.java index bbab40102af..e0f0fb546bb 100644 --- a/operator/src/main/java/oracle/kubernetes/weblogic/domain/model/Model.java +++ b/operator/src/main/java/oracle/kubernetes/weblogic/domain/model/Model.java @@ -28,11 +28,15 @@ public class Model { private String configMap; @Description("Location of the WebLogic Deploy Tooling model home. Defaults to `/u01/wdt/models` if no " - + "`spec.configuration.model.AuxiliaryImages` are specified, and to `/aux/models` otherwise.") + + "`spec.configuration.model.AuxiliaryImages` are specified, and to `/aux/models` otherwise. " + + "WARNING: if `modelHome` is set to a non-default value, " + + "then model files in all specified `spec.configuration.model.AuxiliaryImages` are ignored.") private String modelHome; @Description("Location of the WebLogic Deploy Tooling installation. Defaults to `/u01/wdt/weblogic-deploy` if no " - + "`spec.configuration.model.AuxiliaryImages` are specified, and to `/aux/weblogic-deploy` otherwise.") + + "`spec.configuration.model.AuxiliaryImages` are specified, and to `/aux/weblogic-deploy` otherwise. " + + "WARNING: if `wdtInstallHome` is set to a non-default value, " + + "then the WDT install in any specified `spec.configuration.model.AuxiliaryImages` is ignored.") private String wdtInstallHome; @Description("Online update option for Model In Image dynamic update.") From 761d397da7ffc30af93847a7290838a8cb8262bf Mon Sep 17 00:00:00 2001 From: Tom Barnes Date: Wed, 14 Dec 2022 18:11:17 +0000 Subject: [PATCH 2/7] Address editorial feedback. --- .../4.0/content/base-images/custom-images.md | 26 +++++++++---------- .../accessing-the-domain/status-conditions.md | 2 +- .../choosing-a-model/_index.md | 22 +++++++++++----- .../model-in-image/auxiliary-images.md | 22 ++++++++-------- .../model-in-image/model-files.md | 4 +-- .../model-in-image/overview.md | 2 +- .../model-in-image/runtime-updates.md | 2 +- .../managing-domains/model-in-image/usage.md | 14 +++++----- .../samples/domains/model-in-image/initial.md | 2 +- .../samples/domains/model-in-image/update3.md | 4 +-- documentation/domains/Cluster.json | 4 +-- documentation/domains/Domain.json | 4 +-- documentation/domains/Domain.md | 4 +-- kubernetes/crd/domain-crd.yaml | 10 +++---- .../weblogic/domain/model/Model.java | 4 +-- 15 files changed, 67 insertions(+), 59 deletions(-) diff --git a/documentation/4.0/content/base-images/custom-images.md b/documentation/4.0/content/base-images/custom-images.md index 7492abbeed4..42844357b2b 100644 --- a/documentation/4.0/content/base-images/custom-images.md +++ b/documentation/4.0/content/base-images/custom-images.md @@ -509,11 +509,11 @@ to create the domain home in Domain in Image. {{% notice tip %}} This section describes an option for layering Model in Image model files on an WebLogic image. The preferred approach for supplying Model in Image files -is to instead use [Auxiliary images]({{< relref "/managing-domains/model-in-image/auxiliary-images.md" >}}). +is to use [Auxiliary images]({{< relref "/managing-domains/model-in-image/auxiliary-images.md" >}}) instead. {{% /notice %}} {{% notice warning %}} -The example in this section references base image +The example in this section references a base image, `container-registry.oracle.com/middleware/weblogic:12.2.1.4`. This is an OCR General Availability (GA) image which **does not include** the latest security patches for WebLogic Server. @@ -526,36 +526,36 @@ See [Ensure you are using recently patched images]({{< relref "/base-images/ocr- Example steps for creating a custom WebLogic image with a Model in Image file layer (using files from the Model in Image sample): -1. Read the [Model in Image User Guide]({{< relref "/managing-domains/model-in-image/_index.md" >}}) - and the [Model in Image Sample]({{< relref "/managing-domains/samples/domains/model-in-image/_index.md" >}}) - to gain an overall understanding of Model in Image domains. +1. To gain an overall understanding of Model in Image domains, + read the [Model in Image User Guide]({{< relref "/managing-domains/model-in-image/_index.md" >}}) + and the [Model in Image Sample]({{< relref "/managing-domains/samples/domains/model-in-image/_index.md" >}}). Note that the sample uses the most recommended approach, auxiliary images, instead of the alternative approach used in this example. -1. Follow the prerequisite steps in +1. Follow the prerequisite steps in the [Model in Image Sample]({{< relref "/samples/domains/model-in-image/prerequisites.md" >}}) that describe how to: - Download the operator source and its Model in Image sample - (including copying the sample to suggested location `/tmp/mii-sample`). + (including copying the sample to the suggested location, `/tmp/mii-sample`). - Download the latest [WebLogic Deploy Tooling](https://github.com/oracle/weblogic-deploy-tooling/releases) (WDT) and [WebLogic Image Tool](https://github.com/oracle/weblogic-image-tool/releases) (WIT) installer ZIP files to your `/tmp/mii-sample/model-images` directory. Both WDT and WIT are required to create your Model in Image container images. - - Install (unzip) the WebLogic Image Tool and configure its cache to reference your WebLogic Deploy Tool download. + - Install (unzip) the WebLogic Image Tool and configure its cache to reference your WebLogic Deploy Tooling download. 1. Locate or create a base WebLogic image. See [Obtain images from the Oracle Container Registry]({{< relref "/base-images/ocr-images#obtain-images-from-the-oracle-container-registry" >}}) or [Create a custom image with patches applied](#create-a-custom-image-with-patches-applied). - In the following step, we use the `container-registry.oracle.com/middleware/weblogic:12.2.1.4` GA image. + In the following step, you will use the `container-registry.oracle.com/middleware/weblogic:12.2.1.4` GA image. -1. Build the final image using WIT while specifying the base image, target image tag, WDT install location, +1. Build the final image using WIT while specifying the base image, target image tag, WDT installation location, and WDT model file locations. For example: - First create a model ZIP file application archive and place it in the same directory - where the sample model YAML file and model properties files are already staged in place: + First, create a model ZIP file application archive and place it in the same directory + where the sample model YAML file and model properties files are already staged: ```shell $ rm -f /tmp/mii-sample/model-images/model-in-image__WLS-v1/archive.zip @@ -596,7 +596,7 @@ Example steps for creating a custom WebLogic image with a Model in Image file la __Notes__: - The default values for `domain.spec.configuration.model.wdtInstallHome` and `.modelHome` - reference the location of the WDT install and model files that WIT copied into the image. + reference the location of the WDT installation and model files that WIT copied into the image. - The domain type specified in `domain.spec.configuration.model.domainType` must correspond with the `--wdtDomainType` specified on the WIT command line when creating the image. diff --git a/documentation/4.0/content/managing-domains/accessing-the-domain/status-conditions.md b/documentation/4.0/content/managing-domains/accessing-the-domain/status-conditions.md index 353627a5bbb..644805e6bce 100644 --- a/documentation/4.0/content/managing-domains/accessing-the-domain/status-conditions.md +++ b/documentation/4.0/content/managing-domains/accessing-the-domain/status-conditions.md @@ -143,7 +143,7 @@ Status: #### `ConfigChangesPendingRestart` - This condition tracks the progress of [runtime updates]({{< relref "managing-domains/model-in-image/runtime-updates">}}) - to the WebLogic Deploy Tool model of a Model in Image domain home source type. + to the WebLogic Deploy Tooling model of a Model in Image domain home source type. - The `status` attribute is `True` if all of the following are true: * The Domain resource attribute `domain.spec.configuration.model.onlineUpdate.onNonDynamicChanges` is `CommitUpdateOnly`. diff --git a/documentation/4.0/content/managing-domains/choosing-a-model/_index.md b/documentation/4.0/content/managing-domains/choosing-a-model/_index.md index 8568d16da7e..a86a188d715 100644 --- a/documentation/4.0/content/managing-domains/choosing-a-model/_index.md +++ b/documentation/4.0/content/managing-domains/choosing-a-model/_index.md @@ -15,26 +15,34 @@ When using the operator to start WebLogic Server instances from a domain, you ha - **[Model in Image]({{< relref "/samples/domains/model-in-image/_index.md" >}})**: - Set the domain resource `domain.spec.domainHomeSourceType` attribute to `FromModel`. - - Supply a WebLogic installation in an image and supply WebLogic configuration in one of three ways: - - As WDT model YAML file supplied in separate [auxiliary images]({{< relref "/managing-domains/model-in-image/auxiliary-images.md" >}}). + - Supply a WebLogic installation in an image and supply a WebLogic configuration in one of three ways: + - As WDT model YAML file supplied in separate + [auxiliary images]({{< relref "/managing-domains/model-in-image/auxiliary-images.md" >}}). - As WebLogic Deployment Tool (WDT) model YAML file layered on the WebLogic installation image. - As WDT model YAML file in a Kubernetes ConfigMap. - Supply WebLogic applications in one of two ways: - In auxiliary images. - Layered on the installation image. - - Mutate WebLogic configuration by supplying a new image and rolling, or [model updates]({{< relref "/managing-domains/model-in-image/runtime-updates.md" >}}) supplied in a Kubernetes ConfigMap. + - Mutate the WebLogic configuration by supplying a new image and rolling, + or [model updates]({{< relref "/managing-domains/model-in-image/runtime-updates.md" >}}) + supplied in a Kubernetes ConfigMap. - **[Domain in Image]({{< relref "/samples/domains/domain-home-in-image/_index.md" >}})**: - Set the domain resource `domain.spec.domainHomeSourceType` attribute to `Image`. - - Supply a WebLogic installation in an image and supply WebLogic configuration as a domain home layered on this image. + - Supply a WebLogic installation in an image and supply a WebLogic configuration as a domain home layered on this image. - Supply WebLogic applications layered on the installation image. - - Mutate WebLogic configuration by supplying a new image and rolling, or by configuration overrides supplied in a Kubernetes ConfigMap. + - Mutate the WebLogic configuration by supplying a new image and rolling, + or by [configuration overrides]({{< relref "/managing-domains/configoverrides/_index.md" >}}) + supplied in a Kubernetes ConfigMap. - **[Domain in PV]({{< relref "/samples/domains/domain-home-on-pv/_index.md" >}})**: - Set the domain resource `domain.spec.domainHomeSourceType` attribute to `PersistentVolume`. - - Supply a WebLogic installation in an image and supply WebLogic configuration as a domain home in a persistent volume. + - Supply a WebLogic installation in an image and supply a WebLogic configuration as a domain home in a persistent volume. - Supply WebLogic applications in the persistent volume. - - Mutate WebLogic configuration using WLST, the WebLogic Server Administration Console, or [configuration overrides]({{< relref "/managing-domains/configoverrides/_index.md" >}}) supplied in a Kubernetes ConfigMap. + - Mutate the WebLogic configuration using WLST, + the WebLogic Server Administration Console, + or [configuration overrides]({{< relref "/managing-domains/configoverrides/_index.md" >}}) + supplied in a Kubernetes ConfigMap. Note that you can use different domain home types for different domains; there's no restriction on having domains with different domain home types in the same Kubernetes cluster or namespace. diff --git a/documentation/4.0/content/managing-domains/model-in-image/auxiliary-images.md b/documentation/4.0/content/managing-domains/model-in-image/auxiliary-images.md index 55728f4a227..ae6a6f128ca 100644 --- a/documentation/4.0/content/managing-domains/model-in-image/auxiliary-images.md +++ b/documentation/4.0/content/managing-domains/model-in-image/auxiliary-images.md @@ -10,7 +10,7 @@ description = "Auxiliary images are an alternative approach for supplying a doma ### Introduction -Auxiliary images are the top recommended approach for including Model in Image model files, +Auxiliary images are the recommended best approach for including Model in Image model files, application archive files, and WebLogic Deploy Tooling installation files, in your pods. This feature eliminates the need to provide these files in the image specified in `domain.spec.image`. @@ -61,7 +61,7 @@ and installation files in the auxiliary image using the `sourceModelHome` and `s - For details about each field, see the [schema](https://github.com/oracle/weblogic-kubernetes-operator/blob/{{< latestMinorVersion >}}/documentation/domains/Domain.md#auxiliary-image). -- For a basic configuration example, see [Configuration example 1](#configuration-example-1-basic-configuration). +- For a basic configuration example, see [Configuration example 1](#example-1-basic-configuration). #### Source locations @@ -84,7 +84,7 @@ then the domain deployment will fail. The files in `sourceModelHome` and `sourceWDTInstallHome` directories will be made available in `/aux/models` and `/aux/weblogic-deploy` directories of the WebLogic Server container in all pods, respectively. -For example source locations, see [Configuration example 2](#configuration-example-2-source-locations). +For example source locations, see [Configuration example 2](#example-2-source-locations). #### Multiple auxiliary images @@ -96,15 +96,15 @@ Files from later images in the merge overwrite same-named files from earlier ima When specifying multiple auxiliary images, ensure that only one of the images supplies a WDT installation location using `configuration.model.auxiliaryImages[].sourceWDTInstallHome`. {{% notice warning %}} -If you provide more than one WDT install home among multiple auxiliary images, +If you provide more than one WDT installation home among multiple auxiliary images, then the domain deployment will fail. Set `sourceWDTInstallHome` to `None`, or make sure there are no files in `/auxiliary/weblogic-deploy`, for all but one of your specified auxililary images. {{% /notice %}} -For an example of configuring multiple auxiliary images, see [Configuration example 3](#configuration-example-3-multiple-images). +For an example of configuring multiple auxiliary images, see [Configuration example 3](#example-3-multiple-images). -#### Model and WDT install homes +#### Model and WDT installation homes If you are using auxiliary images, typically, it should not be necessary to set `domain.spec.configuration.models.modelHome` and `domain.spec.configuration.models.wdtInstallHome`. The model and WDT install files you supply in the auxiliary image @@ -121,7 +121,7 @@ then the domain will ignore the WDT model and installation files in its auxiliar The following configuration examples illustrate each of the previously described sections. -#### Configuration example 1: Basic configuration +#### Example 1: Basic configuration This example specifies the required image parameter for the auxiliary image(s); all other fields are at default values. @@ -133,7 +133,7 @@ spec: - image: model-in-image:v1 ``` -#### Configuration example 2: Source locations +#### Example 2: Source locations This example is same as Example 1 except that it specifies the source locations for the WebLogic Deploy Tooling model and installation files. ``` @@ -146,7 +146,7 @@ spec: sourceWDTInstallHome: /bar/weblogic-deploy ``` -#### Configuration example 3: Multiple images +#### Example 3: Multiple images This example is the same as Example 1, except it configures multiple auxiliary images and sets the `sourceWDTInstallHome` for the second image to `None`. @@ -174,11 +174,11 @@ container image. The [Model in Image Sample initial use case]({{< relref "/samples/domains/model-in-image/initial.md" >}}) describes using the WebLogic Image Tool as a convenient way to create the auxiliary image, -which is the top recommended approach. You can alternatively "manually" build the image. +which is the recommended best approach. Alternatively, you can "manually" build the image. For example, the following steps modify the Model in Image sample's initial use case to use Docker to build its auxiliary image: -1. Download the Model in Image sample source and WebLogic Deploy Tool by following +1. Download the Model in Image sample source and WebLogic Deploy Tooling by following the corresponding steps in the [Model in Image Sample prerequisites]({{< relref "/samples/domains/model-in-image/prerequisites.md" >}}). diff --git a/documentation/4.0/content/managing-domains/model-in-image/model-files.md b/documentation/4.0/content/managing-domains/model-in-image/model-files.md index a861365fd7a..fad040238cc 100644 --- a/documentation/4.0/content/managing-domains/model-in-image/model-files.md +++ b/documentation/4.0/content/managing-domains/model-in-image/model-files.md @@ -10,7 +10,7 @@ description = "Model file requirements, macros, and loading order." ### Introduction -This document describes basic Model in Image model file syntax, naming, and macros. For additional information, see the [WebLogic Deploy Tool](https://oracle.github.io/weblogic-deploy-tooling/) documentation. +This document describes basic Model in Image model file syntax, naming, and macros. For additional information, see the [WebLogic Deploy Tooling](https://oracle.github.io/weblogic-deploy-tooling/) documentation. {{% notice tip %}} The WDT [Discover Domain Tool](https://oracle.github.io/weblogic-deploy-tooling/userguide/tools/discover/) is particularly useful for generating model files from an existing domain home. {{% /notice %}} @@ -120,7 +120,7 @@ Then the combined model files list is passed to WebLogic Deploy Tooling as: y.yaml,main-model.10.yaml,my-model.10.yaml,jdbc.20.yaml,z.yaml,jdbc-dev-urlprops.10.yaml ``` -Property files (ending in `.properties`) use the same sorting algorithm, but they are appended together into a single file prior to passing them to the WebLogic Deploy Tool. +Property files (ending in `.properties`) use the same sorting algorithm, but they are appended together into a single file prior to passing them to the WebLogic Deploy Tooling. ### Model file macros diff --git a/documentation/4.0/content/managing-domains/model-in-image/overview.md b/documentation/4.0/content/managing-domains/model-in-image/overview.md index 97893b7ca4a..af45666f96d 100644 --- a/documentation/4.0/content/managing-domains/model-in-image/overview.md +++ b/documentation/4.0/content/managing-domains/model-in-image/overview.md @@ -40,7 +40,7 @@ and its integration with Model in Image, see [Usage]({{< relref "/managing-domains/model-in-image/usage.md" >}}) and [Model files]({{< relref "/managing-domains/model-in-image/model-files.md" >}}). The WDT model format is fully described in the open source, -[WebLogic Deploy Tool](https://oracle.github.io/weblogic-deploy-tooling/) GitHub project. +[WebLogic Deploy Tooling](https://oracle.github.io/weblogic-deploy-tooling/) GitHub project. ### Runtime behavior diff --git a/documentation/4.0/content/managing-domains/model-in-image/runtime-updates.md b/documentation/4.0/content/managing-domains/model-in-image/runtime-updates.md index 726b58bfa00..8499b49cee9 100644 --- a/documentation/4.0/content/managing-domains/model-in-image/runtime-updates.md +++ b/documentation/4.0/content/managing-domains/model-in-image/runtime-updates.md @@ -104,7 +104,7 @@ plus, an offline update, if there are any accompanying model changes. Model updates can include additions, changes, and deletions. For help generating model changes: - For a description of model file syntax, see the - [WebLogic Deploy Tool](https://oracle.github.io/weblogic-deploy-tooling/) documentation + [WebLogic Deploy Tooling](https://oracle.github.io/weblogic-deploy-tooling/) documentation and Model in Image [Model files]({{< relref "/managing-domains/model-in-image/model-files.md" >}}) documentation. - For a description of helper tooling that you can use to generate model change YAML, diff --git a/documentation/4.0/content/managing-domains/model-in-image/usage.md b/documentation/4.0/content/managing-domains/model-in-image/usage.md index c31dcd70ee3..d467d1cd106 100644 --- a/documentation/4.0/content/managing-domains/model-in-image/usage.md +++ b/documentation/4.0/content/managing-domains/model-in-image/usage.md @@ -43,7 +43,7 @@ its (optional) WDT model artifacts and (required) WDT binaries: | `domain.spec.configuration.model.modelHome` | Zero or more model `.yaml`, `.properties`, and/or archive `.zip` files. | Optional. Location of the WDT model home, which can include model YAML files, `.properties` files, and application `.zip` archives. Defaults to `/u01/wdt/models` if no [Auxiliary Images]({{}}) are configured, and to `/aux/models` otherwise.| | `domain.spec.configuration.model.wdtInstallHome` | Unzipped WDT installation binaries (required). | Optional. Location of the WDT installation. Defaults to `/u01/wdt/weblogic-deploy` if no [Auxiliary Images]({{}}) are configured, and to `/aux/weblogic-deploy` otherwise.| -{{% notice warning %}} +{{% notice note %}} If you set `modelHome` and `wdtInstallHome` to a non-default value, then the operator will ignore WDT model and installation files that are copied from [Auxiliary Images]({{}}). @@ -68,15 +68,15 @@ to: There are multiple methods for supplying Model in Image WDT artifacts: - - __Use auxiliary images__: + - Use auxiliary images: Use [auxiliary images]({{< relref "/managing-domains/model-in-image/auxiliary-images.md" >}}) to create one or more small images that contain the desired files. - This is the top recommended approach. It automatically copies files + This is the recommended best approach. It automatically copies files from each of the small images into the `/aux/models` and `/aux/weblogic-deploy` directories in each pod's file system so that the introspection job can find them. - - __Include in main image__: + - Include in main image: You can include the artifacts in your domain resource `domain.spec.image` in its `domain.spec.configuration.model.modelHome` and `domain.spec.configuration.model.wdtInstallHome` directories as @@ -91,13 +91,13 @@ There are multiple methods for supplying Model in Image WDT artifacts: WDT binaries, WebLogic Server binaries, and WebLogic Server patches in an image. See [Create a custom image with your model inside the image]({{< relref "/base-images/custom-images#create-a-custom-image-with-your-model-inside-the-image" >}}). - - __Use a Persistent Volume Claim (PVC)__: + - Use a Persistent Volume Claim (PVC): This method is for advanced use cases only. Supply WDT model YAML, variable, or archive files in a [Persistent Volume Claim]({{< relref "/managing-domains/persistent-storage/volumes.md" >}}) and modify `configuration.model.modelHome` and `configuration.model.wdtInstallHome` to the corresponding directory within the PVC's mount location. - - __Use a WDT model ConfigMap__: + - Use a WDT model ConfigMap: Use the [Optional WDT model ConfigMap](#optional-wdt-model-configmap) for WDT model YAML and `.properties` files. This can be combined with any of the previously mentioned methods and is most often used to facilitate runtime @@ -175,7 +175,7 @@ The following Domain fields are specific to Model in Image domains. | `configuration.model.modelHome` | Optional. Location of the WDT model home, which can include model YAML files, `.properties` files, and application `.zip` archives. Defaults to `/u01/wdt/models` if no [Auxiliary Images]({{}}) are configured, and to `/aux/models` otherwise.| | `configuration.model.wdtInstallHome` | Optional. Location of the WDT installation. Defaults to `/u01/wdt/weblogic-deploy` if no [Auxiliary Images]({{}}) are configured, and to `/aux/weblogic-deploy` otherwise.| -{{% notice warning %}} +{{% notice note %}} If you set `modelHome` and `wdtInstallHome` to a non-default value, then the operator will ignore WDT model and installation files that are copied from [Auxiliary Images]({{}}). diff --git a/documentation/4.0/content/samples/domains/model-in-image/initial.md b/documentation/4.0/content/samples/domains/model-in-image/initial.md index aa9e7efbbe5..06907ee63c8 100644 --- a/documentation/4.0/content/samples/domains/model-in-image/initial.md +++ b/documentation/4.0/content/samples/domains/model-in-image/initial.md @@ -190,7 +190,7 @@ $ zip -r /tmp/mii-sample/model-images/model-in-image__WLS-AI-v1/archive.zip wlsd #### Staging model files -In this step, you explore the staged WDT model YAML file and properties in the `/tmp/mii-sample/model-images/model-in-image__WLS-AI-v1` directory. The model in this directory references the web application in your archive, configures a WebLogic Server Administration Server, and configures a WebLogic cluster. It consists of only two files, `model.10.properties`, a file with a single property, and, `model.10.yaml`, a YAML file with your WebLogic configuration `model.10.yaml`. +In this step, you explore the staged WDT model YAML file and properties in the `/tmp/mii-sample/model-images/model-in-image__WLS-AI-v1` directory. The model in this directory references the web application in your archive, configures a WebLogic Server Administration Server, and configures a WebLogic cluster. It consists of two files only, `model.10.properties`, a file with a single property, and, `model.10.yaml`, a YAML file with your WebLogic configuration `model.10.yaml`. ``` CLUSTER_SIZE=5 diff --git a/documentation/4.0/content/samples/domains/model-in-image/update3.md b/documentation/4.0/content/samples/domains/model-in-image/update3.md index 3d1ec0f9954..c3efe2fc132 100644 --- a/documentation/4.0/content/samples/domains/model-in-image/update3.md +++ b/documentation/4.0/content/samples/domains/model-in-image/update3.md @@ -29,7 +29,7 @@ Here are the steps for this use case: 2. Create an updated auxiliary image. - Recall that a goal of the [Initial]({{< relref "/samples/domains/model-in-image/initial.md" >}}) use case was to demonstrate using the WebLogic Image Tool to create an auxiliary image named `model-in-image:WLS-AI-v1` from files that were staged in `/tmp/mii-sample/model-images/model-in-image__WLS-AI-v1/`. The staged files included a web application in a WDT ZIP archive, and WDT model configuration for a WebLogic Administration Server called `admin-server` and a WebLogic cluster called `cluster-1`. The final image was called `model-in-image:WLS-AI-v1` and, in addition to having a copy of the staged files in its `/auxiliary/models` directory, also contained a WebLogic Deploy Tooling installation in its `/auxiliary/weblogic-deploy` directory. + Recall that a goal of the [Initial]({{< relref "/samples/domains/model-in-image/initial.md" >}}) use case was to demonstrate using the WebLogic Image Tool to create an auxiliary image named `model-in-image:WLS-AI-v1` from files that were staged in `/tmp/mii-sample/model-images/model-in-image__WLS-AI-v1/`. The staged files included a web application in a WDT ZIP archive, and WDT model configuration for a WebLogic Server Administration Server called `admin-server` and a WebLogic cluster called `cluster-1`. The final image was called `model-in-image:WLS-AI-v1` and, in addition to having a copy of the staged files in its `/auxiliary/models` directory, also contained a WebLogic Deploy Tooling installation in its `/auxiliary/weblogic-deploy` directory. In this use case, you will follow similar steps to the [Initial]({{< relref "/samples/domains/model-in-image/initial.md" >}}) use case to create a new image with an updated application and model, plus deploy the updated model and application to the running [Update 1]({{< relref "/samples/domains/model-in-image/update1.md" >}}) use case domain. @@ -45,7 +45,7 @@ Here are the steps for this use case: **NOTE**: If you are using JRF in this sample, substitute `JRF` for each occurrence of `WLS` in the following paths. - When you create your updated image, you will use the files in staging directory `/tmp/mii-sample/model-in-image__WLS-AI-v2`. In preparation, you need it to contain a ZIP file of the new WDT application archive. + When you create your updated image, you will use the files in the staging directory `/tmp/mii-sample/model-in-image__WLS-AI-v2`. In preparation, you need it to contain a ZIP file of the new WDT application archive. Run the following commands to create your application archive ZIP file and put it in the expected directory: diff --git a/documentation/domains/Cluster.json b/documentation/domains/Cluster.json index 42e6812d5bc..ff673e964ad 100644 --- a/documentation/domains/Cluster.json +++ b/documentation/domains/Cluster.json @@ -705,11 +705,11 @@ "type": "string" }, "modelHome": { - "description": "Location of the WebLogic Deploy Tooling model home. Defaults to `/u01/wdt/models` if no `spec.configuration.model.AuxiliaryImages` are specified, and to `/aux/models` otherwise. WARNING: if `modelHome` is set to a non-default value, then model files in all specified `spec.configuration.model.AuxiliaryImages` are ignored.", + "description": "Location of the WebLogic Deploy Tooling model home. Defaults to `/u01/wdt/models` if no `spec.configuration.model.AuxiliaryImages` are specified, and to `/aux/models` otherwise. NOTE: if `modelHome` is set to a non-default value, then model files in all specified `spec.configuration.model.AuxiliaryImages` are ignored.", "type": "string" }, "wdtInstallHome": { - "description": "Location of the WebLogic Deploy Tooling installation. Defaults to `/u01/wdt/weblogic-deploy` if no `spec.configuration.model.AuxiliaryImages` are specified, and to `/aux/weblogic-deploy` otherwise. WARNING: if `wdtInstallHome` is set to a non-default value, then the WDT install in any specified `spec.configuration.model.AuxiliaryImages` is ignored.", + "description": "Location of the WebLogic Deploy Tooling installation. Defaults to `/u01/wdt/weblogic-deploy` if no `spec.configuration.model.AuxiliaryImages` are specified, and to `/aux/weblogic-deploy` otherwise. NOTE: if `wdtInstallHome` is set to a non-default value, then the WDT install in any specified `spec.configuration.model.AuxiliaryImages` is ignored.", "type": "string" }, "auxiliaryImageVolumeMedium": { diff --git a/documentation/domains/Domain.json b/documentation/domains/Domain.json index 95180803f4e..7f1458ff5d2 100644 --- a/documentation/domains/Domain.json +++ b/documentation/domains/Domain.json @@ -624,11 +624,11 @@ "type": "string" }, "modelHome": { - "description": "Location of the WebLogic Deploy Tooling model home. Defaults to `/u01/wdt/models` if no `spec.configuration.model.AuxiliaryImages` are specified, and to `/aux/models` otherwise. WARNING: if `modelHome` is set to a non-default value, then model files in all specified `spec.configuration.model.AuxiliaryImages` are ignored.", + "description": "Location of the WebLogic Deploy Tooling model home. Defaults to `/u01/wdt/models` if no `spec.configuration.model.AuxiliaryImages` are specified, and to `/aux/models` otherwise. NOTE: if `modelHome` is set to a non-default value, then model files in all specified `spec.configuration.model.AuxiliaryImages` are ignored.", "type": "string" }, "wdtInstallHome": { - "description": "Location of the WebLogic Deploy Tooling installation. Defaults to `/u01/wdt/weblogic-deploy` if no `spec.configuration.model.AuxiliaryImages` are specified, and to `/aux/weblogic-deploy` otherwise. WARNING: if `wdtInstallHome` is set to a non-default value, then the WDT install in any specified `spec.configuration.model.AuxiliaryImages` is ignored.", + "description": "Location of the WebLogic Deploy Tooling installation. Defaults to `/u01/wdt/weblogic-deploy` if no `spec.configuration.model.AuxiliaryImages` are specified, and to `/aux/weblogic-deploy` otherwise. NOTE: if `wdtInstallHome` is set to a non-default value, then the WDT install in any specified `spec.configuration.model.AuxiliaryImages` is ignored.", "type": "string" }, "auxiliaryImageVolumeMedium": { diff --git a/documentation/domains/Domain.md b/documentation/domains/Domain.md index d24b740a8cf..ce965a5a7ad 100644 --- a/documentation/domains/Domain.md +++ b/documentation/domains/Domain.md @@ -217,10 +217,10 @@ The current status of the operation of the WebLogic domain. Updated automaticall | `auxiliaryImageVolumeSizeLimit` | string | The emptyDir volume size limit. This is an advanced setting that rarely needs to be configured. Defaults to unset. | | `configMap` | string | Name of a ConfigMap containing the WebLogic Deploy Tooling model. | | `domainType` | string | WebLogic Deploy Tooling domain type. Legal values: WLS, RestrictedJRF, JRF. Defaults to WLS. | -| `modelHome` | string | Location of the WebLogic Deploy Tooling model home. Defaults to `/u01/wdt/models` if no `spec.configuration.model.AuxiliaryImages` are specified, and to `/aux/models` otherwise. WARNING: if `modelHome` is set to a non-default value, then model files in all specified `spec.configuration.model.AuxiliaryImages` are ignored. | +| `modelHome` | string | Location of the WebLogic Deploy Tooling model home. Defaults to `/u01/wdt/models` if no `spec.configuration.model.AuxiliaryImages` are specified, and to `/aux/models` otherwise. NOTE: if `modelHome` is set to a non-default value, then model files in all specified `spec.configuration.model.AuxiliaryImages` are ignored. | | `onlineUpdate` | [Online Update](#online-update) | Online update option for Model In Image dynamic update. | | `runtimeEncryptionSecret` | string | Runtime encryption secret. Required when `domainHomeSourceType` is set to FromModel. | -| `wdtInstallHome` | string | Location of the WebLogic Deploy Tooling installation. Defaults to `/u01/wdt/weblogic-deploy` if no `spec.configuration.model.AuxiliaryImages` are specified, and to `/aux/weblogic-deploy` otherwise. WARNING: if `wdtInstallHome` is set to a non-default value, then the WDT install in any specified `spec.configuration.model.AuxiliaryImages` is ignored. | +| `wdtInstallHome` | string | Location of the WebLogic Deploy Tooling installation. Defaults to `/u01/wdt/weblogic-deploy` if no `spec.configuration.model.AuxiliaryImages` are specified, and to `/aux/weblogic-deploy` otherwise. NOTE: if `wdtInstallHome` is set to a non-default value, then the WDT install in any specified `spec.configuration.model.AuxiliaryImages` is ignored. | ### Opss diff --git a/kubernetes/crd/domain-crd.yaml b/kubernetes/crd/domain-crd.yaml index b471789bd24..f89b07eee23 100644 --- a/kubernetes/crd/domain-crd.yaml +++ b/kubernetes/crd/domain-crd.yaml @@ -5,7 +5,7 @@ apiVersion: apiextensions.k8s.io/v1 kind: CustomResourceDefinition metadata: annotations: - weblogic.sha256: f490830e21b8b9ab7821100eba7d983f6aa7696f620cac0d4d1909602ad8553f + weblogic.sha256: 6f7939492c78279f5f6f00e0a4669953fc7509e587842cd609f8600a409ba9f0 name: domains.weblogic.oracle spec: group: weblogic.oracle @@ -283,16 +283,16 @@ spec: modelHome: description: 'Location of the WebLogic Deploy Tooling model home. Defaults to `/u01/wdt/models` if no `spec.configuration.model.AuxiliaryImages` - are specified, and to `/aux/models` otherwise. WARNING: - if `modelHome` is set to a non-default value, then model - files in all specified `spec.configuration.model.AuxiliaryImages` + are specified, and to `/aux/models` otherwise. NOTE: if + `modelHome` is set to a non-default value, then model files + in all specified `spec.configuration.model.AuxiliaryImages` are ignored.' type: string wdtInstallHome: description: 'Location of the WebLogic Deploy Tooling installation. Defaults to `/u01/wdt/weblogic-deploy` if no `spec.configuration.model.AuxiliaryImages` are specified, and to `/aux/weblogic-deploy` otherwise. - WARNING: if `wdtInstallHome` is set to a non-default value, + NOTE: if `wdtInstallHome` is set to a non-default value, then the WDT install in any specified `spec.configuration.model.AuxiliaryImages` is ignored.' type: string diff --git a/operator/src/main/java/oracle/kubernetes/weblogic/domain/model/Model.java b/operator/src/main/java/oracle/kubernetes/weblogic/domain/model/Model.java index e0f0fb546bb..b230a91ecbd 100644 --- a/operator/src/main/java/oracle/kubernetes/weblogic/domain/model/Model.java +++ b/operator/src/main/java/oracle/kubernetes/weblogic/domain/model/Model.java @@ -29,13 +29,13 @@ public class Model { @Description("Location of the WebLogic Deploy Tooling model home. Defaults to `/u01/wdt/models` if no " + "`spec.configuration.model.AuxiliaryImages` are specified, and to `/aux/models` otherwise. " - + "WARNING: if `modelHome` is set to a non-default value, " + + "NOTE: if `modelHome` is set to a non-default value, " + "then model files in all specified `spec.configuration.model.AuxiliaryImages` are ignored.") private String modelHome; @Description("Location of the WebLogic Deploy Tooling installation. Defaults to `/u01/wdt/weblogic-deploy` if no " + "`spec.configuration.model.AuxiliaryImages` are specified, and to `/aux/weblogic-deploy` otherwise. " - + "WARNING: if `wdtInstallHome` is set to a non-default value, " + + "NOTE: if `wdtInstallHome` is set to a non-default value, " + "then the WDT install in any specified `spec.configuration.model.AuxiliaryImages` is ignored.") private String wdtInstallHome; From 7b691e6fa0602575b7d42fa60c1895c68e1ff3f4 Mon Sep 17 00:00:00 2001 From: Tom Barnes Date: Wed, 14 Dec 2022 18:19:05 +0000 Subject: [PATCH 3/7] Address editorial feedback. --- documentation/4.0/content/base-images/custom-images.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/documentation/4.0/content/base-images/custom-images.md b/documentation/4.0/content/base-images/custom-images.md index 42844357b2b..b316f558f6f 100644 --- a/documentation/4.0/content/base-images/custom-images.md +++ b/documentation/4.0/content/base-images/custom-images.md @@ -529,8 +529,8 @@ Example steps for creating a custom WebLogic image with a Model in Image file la 1. To gain an overall understanding of Model in Image domains, read the [Model in Image User Guide]({{< relref "/managing-domains/model-in-image/_index.md" >}}) and the [Model in Image Sample]({{< relref "/managing-domains/samples/domains/model-in-image/_index.md" >}}). - Note that the sample uses the most recommended approach, - auxiliary images, instead of the alternative approach used in this example. + Note that the sample uses the recommended best approach, + auxiliary images, instead of the alternative approach which is used in this example. 1. Follow the prerequisite steps in the [Model in Image Sample]({{< relref "/samples/domains/model-in-image/prerequisites.md" >}}) From d7f08ff3a7fbe4d67717c0b7a602887d8193e554 Mon Sep 17 00:00:00 2001 From: Tom Barnes Date: Wed, 14 Dec 2022 18:31:40 +0000 Subject: [PATCH 4/7] Address editorial feedback. --- .../4.0/content/samples/domains/model-in-image/_index.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/documentation/4.0/content/samples/domains/model-in-image/_index.md b/documentation/4.0/content/samples/domains/model-in-image/_index.md index a1a0904256e..2a0eae89fc7 100644 --- a/documentation/4.0/content/samples/domains/model-in-image/_index.md +++ b/documentation/4.0/content/samples/domains/model-in-image/_index.md @@ -14,7 +14,7 @@ This sample demonstrates deploying a Model in Image with [Auxiliary images]({{< relref "/managing-domains/model-in-image/auxiliary-images.md" >}}). Unlike Domain in PV and Domain in Image, Model in Image eliminates the need to pre-create your WebLogic domain home prior to deploying your Domain YAML file. -Instead, Model in Image uses +Instead, Model in Image uses a WebLogic Deploy Tooling (WDT) model to specify your WebLogic configuration. WDT models are a convenient and simple alternative to WebLogic Scripting Tool (WLST) configuration scripts and templates. They compactly define a WebLogic domain using YAML files and support including application archives in a ZIP file. The WDT model format is described in the open source, [WebLogic Deploy Tooling](https://oracle.github.io/weblogic-deploy-tooling/) GitHub project, and the required directory structure for a WDT archive is specifically discussed [here](https://oracle.github.io/weblogic-deploy-tooling/concepts/archive/). From 83a039447dbf05700531972252ed188a090b3eaf Mon Sep 17 00:00:00 2001 From: Tom Barnes Date: Wed, 14 Dec 2022 18:40:21 +0000 Subject: [PATCH 5/7] Address editorial feedback. --- .../4.0/content/samples/domains/model-in-image/_index.md | 6 +++--- .../4.0/content/samples/domains/model-in-image/initial.md | 8 ++++---- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/documentation/4.0/content/samples/domains/model-in-image/_index.md b/documentation/4.0/content/samples/domains/model-in-image/_index.md index 2a0eae89fc7..e05e1d2bfd8 100644 --- a/documentation/4.0/content/samples/domains/model-in-image/_index.md +++ b/documentation/4.0/content/samples/domains/model-in-image/_index.md @@ -19,7 +19,7 @@ WebLogic Deploy Tooling (WDT) model to specify your WebLogic configuration. WDT models are a convenient and simple alternative to WebLogic Scripting Tool (WLST) configuration scripts and templates. They compactly define a WebLogic domain using YAML files and support including application archives in a ZIP file. The WDT model format is described in the open source, [WebLogic Deploy Tooling](https://oracle.github.io/weblogic-deploy-tooling/) GitHub project, and the required directory structure for a WDT archive is specifically discussed [here](https://oracle.github.io/weblogic-deploy-tooling/concepts/archive/). -The Model in Image auxiliary image option furthermore allows you to supply your WDT artifacts +Furthermore, the Model in Image auxiliary image option allows you to supply your WDT artifacts in a small separate image separate from your WebLogic image. For more information on Model in Image, see the [Model in Image user guide]({{< relref "/managing-domains/model-in-image/_index.md" >}}). For a comparison of Model in Image to other domain home source types, see [Choose a domain home source type]({{< relref "/managing-domains/choosing-a-model/_index.md" >}}). @@ -43,14 +43,14 @@ This sample demonstrates five Model in Image use cases: - A WebLogic Administration Server - A WebLogic cluster - A reference to the web application - - A WebLogic image with a WebLogic and java installation. + - A WebLogic image with a WebLogic and Java installation. - Kubernetes Secrets: - WebLogic credentials - Required WDT runtime password - A Domain with: - `metadata.name` and `weblogic.domainUID` label set to `sample-domain1` - `spec.domainHomeSourceType: FromModel` - - `spec.image` set to a WebLogic image with a WebLogic and java installation. + - `spec.image` set to a WebLogic image with a WebLogic and Java installation. - References to the secrets - [Update 1]({{< relref "/samples/domains/model-in-image/update1.md" >}}): Demonstrates updating the initial domain by dynamically adding a data source using a model ConfigMap and then restarting (rolling) the domain to propagate the change. Updates: diff --git a/documentation/4.0/content/samples/domains/model-in-image/initial.md b/documentation/4.0/content/samples/domains/model-in-image/initial.md index 06907ee63c8..951f0bc198f 100644 --- a/documentation/4.0/content/samples/domains/model-in-image/initial.md +++ b/documentation/4.0/content/samples/domains/model-in-image/initial.md @@ -25,7 +25,7 @@ In this use case, you set up an initial WebLogic domain. This involves: - Creating an auxiliary image with: - A WDT archive ZIP file that contains your applications. - A WDT model that describes your WebLogic configuration. - - A WDT install that contains the binaries for running WDT. + - A WDT installation that contains the binaries for running WDT. - Creating secrets for the domain. - Creating a Domain YAML file for the domain that references your Secrets, auxiliary image, and a WebLogic image. @@ -38,14 +38,14 @@ If you are taking the `JRF` path through the sample, then substitute `JRF` for ` #### Image creation - Introduction -The goal of the initial use case 'image creation' step is to demonstrate using the WebLogic Image Tool to create an auxiliary image named `model-in-image:WLS-AI-v1` from files that you will stage to `/tmp/mii-sample/model-images/model-in-image__WLS-AI-v1/`. The staged files will contain a web application in a WDT archive, and WDT model configuration for a WebLogic Administration Server called `admin-server` and a WebLogic cluster called `cluster-1`. +The goal of the initial use case 'image creation' step is to demonstrate using the WebLogic Image Tool to create an auxiliary image named `model-in-image:WLS-AI-v1` from files that you will stage to `/tmp/mii-sample/model-images/model-in-image__WLS-AI-v1/`. The staged files will contain a web application in a WDT archive, and WDT model configuration for a WebLogic Server Administration Server called `admin-server` and a WebLogic cluster called `cluster-1`. -A Model in Image domain usually supplies one or more auxiliary images with: +A Model in Image domain typically supplies one or more auxiliary images with: - A WebLogic Deploy Tooling installation (expected in an image's `/auxiliary/weblogic-deploy` directory by default). - WDT model YAML, property, and archive files (expected in directory `/auxiliary/models` by default). If you do not specify a WDT model YAML file in an auxiliary image, -then the model YAML file can alternately be supplied dynamically using a Kubernetes ConfigMap +then the model YAML file alternately can be supplied dynamically using a Kubernetes ConfigMap that is referenced by your Domain `spec.model.configMap` field. We provide an example of using a model ConfigMap later in this sample. From 8930ab9da442f6dac388e709e26b8972a7e37705 Mon Sep 17 00:00:00 2001 From: Tom Barnes Date: Wed, 14 Dec 2022 18:53:36 +0000 Subject: [PATCH 6/7] Address editorial feedback. --- documentation/4.0/content/base-images/custom-images.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/documentation/4.0/content/base-images/custom-images.md b/documentation/4.0/content/base-images/custom-images.md index b316f558f6f..8a987c963b8 100644 --- a/documentation/4.0/content/base-images/custom-images.md +++ b/documentation/4.0/content/base-images/custom-images.md @@ -530,7 +530,7 @@ Example steps for creating a custom WebLogic image with a Model in Image file la read the [Model in Image User Guide]({{< relref "/managing-domains/model-in-image/_index.md" >}}) and the [Model in Image Sample]({{< relref "/managing-domains/samples/domains/model-in-image/_index.md" >}}). Note that the sample uses the recommended best approach, - auxiliary images, instead of the alternative approach which is used in this example. + auxiliary images, instead of the alternative approach, which is used in this example. 1. Follow the prerequisite steps in the [Model in Image Sample]({{< relref "/samples/domains/model-in-image/prerequisites.md" >}}) From 6f0f993c6d7b0d3166d2807e2e0fb4463cfad4bf Mon Sep 17 00:00:00 2001 From: Tom Barnes Date: Wed, 14 Dec 2022 21:00:41 +0000 Subject: [PATCH 7/7] Address editorial feedback. --- documentation/4.0/content/base-images/custom-images.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/documentation/4.0/content/base-images/custom-images.md b/documentation/4.0/content/base-images/custom-images.md index 8a987c963b8..0d0d219d217 100644 --- a/documentation/4.0/content/base-images/custom-images.md +++ b/documentation/4.0/content/base-images/custom-images.md @@ -507,7 +507,7 @@ to create the domain home in Domain in Image. #### Create a custom image with your model inside the image {{% notice tip %}} -This section describes an option for layering Model in Image model files on an WebLogic image. +This section describes an option for layering Model in Image model files on a WebLogic image. The preferred approach for supplying Model in Image files is to use [Auxiliary images]({{< relref "/managing-domains/model-in-image/auxiliary-images.md" >}}) instead. {{% /notice %}}