This sample demonstrates deploying a Model in Image domain home source type with Auxiliary images. 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.
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 GitHub project, and the required directory structure for a WDT archive is specifically discussed here.
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. For a comparison of Model in Image to other domain home source types, see Choose a domain home source type.
There are three types of domains supported by Model in Image: a standard WLS
domain, an Oracle Fusion Middleware Infrastructure Java Required Files (JRF
) domain, and a RestrictedJRF
domain. This sample demonstrates the WLS
and JRF
types.
The JRF
domain path through the sample includes additional steps required for JRF: deploying an infrastructure database, initializing the database using the Repository Creation Utility (RCU) tool, referencing the infrastructure database from the WebLogic configuration, setting an Oracle Platform Security Services (OPSS) wallet password, and exporting/importing an OPSS wallet file. JRF
domains may be used by Oracle products that layer on top of WebLogic Server, such as SOA and OSB. Similarly, RestrictedJRF
domains may be used by Oracle layered products, such as Oracle Communications products.
This sample demonstrates five Model in Image use cases:
Initial: An initial WebLogic domain with the following characteristics:
model-in-image:WLS-AI-v1
with:
v1
of an exploded Java EE web applicationmetadata.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.Update 1: 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:
spec.model.configMap
referencing the ConfigMapUpdate 2: Demonstrates deploying a second domain (similar to the Update 1 use case domain). Updates:
metadata.name
and weblogic.domainUid
label become sample-domain2
instead of sample-domain1
sample-domain2
instead of sample-domain1
env
variable that sets a new domain nameUpdate 3: 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:
model-in-image:WLS-AI-v2
, similar to model-in-image:WLS-AI-v1
image with:
v2
at the myapp-v2
directory path instead of myapp-v1
spec.image
is model-in-image:WLS-AI-v2
Update 4: Demonstrates dynamically updating the running Update 1 or Update 3 WebLogic domain configuration without requiring a domain restart (roll). Updates:
spec.configuration.model.onlineUpdate
set to enabled: true
The sample contains the following files and directories:
Location | Description |
---|---|
domain-resources |
JRF and WLS Domain YAML files. |
archives |
Source code location for WebLogic Deploy Tooling application ZIP archives. |
model-images |
Staging for each model image’s WDT YAML files, WDT properties, and WDT archive ZIP files. The directories in model images are named for their respective images. |
model-configmaps/datasource |
Staging files for a model ConfigMap that configures a data source. |
model-configmaps/workmanager |
Staging files for a model ConfigMap that configures the Work Manager threads constraints. |
ingresses |
Ingress resources. |
utils/patch-introspect-version.sh |
Utility script for updating a running domain spec.introspectVersion field (which causes it to ’re-instrospect’ and ‘roll’ only if non-dynamic attributes are updated). |
utils/patch-restart-version.sh |
Utility script for updating a running domain spec.restartVersion field (which causes it to ’re-instrospect’ and ‘roll’). |
utils/patch-enable-online-update.sh |
Utility script for updating a running domain spec.configuration.model.onlineUpdate field to enabled: true (which enables the online update feature). |
utils/opss-wallet.sh |
Utility script for exporting or importing a JRF domain OPSS wallet file. |
In addition, this sample makes use of the waitForDomain.sh
sample lifecycle script
that is located in the operator source kubernetes/samples/scripts/domain-lifecycle
directory.
This is a utility script that optionally waits for the pods in a domain
to reach their expected restartVersion
, introspectVersion
, Completed
, image
, and ready
state.
If you run the sample from a machine that is remote to one or more of your Kubernetes cluster worker nodes, then you need to ensure that the images you create can be accessed from any node in the cluster.
For example, if you have permission to put the image in a container registry that the cluster can also access, then:
docker tag
the image with a target image name (including the registry host name, port, repository name, and the tag, if needed).docker push
the tagged image to the target repository.image:
value to match the image tag for the image in the repository.docker secret
to the same namespace that the Domain will use, and modify the Domain YAML file’s imagePullSecrets:
to reference this secret.Alternatively, if you have access to the local image cache on each worker node in the cluster, then you can use a Docker command to save the image to a file, copy the image file to each worker node, and use a docker
command to load the image file into the node’s image cache.
For more information, see the Cannot pull image FAQ.
For references to the relevant user documentation, see: