Skip to content

Commit 9f56d20

Browse files
committed
Change domain-home-in-image inputs property names and fix changes to required image property
Signed-off-by: doxiao <[email protected]>
1 parent d204689 commit 9f56d20

File tree

4 files changed

+39
-29
lines changed

4 files changed

+39
-29
lines changed

kubernetes/samples/scripts/create-weblogic-domain/domain-home-in-image/README.md

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -6,10 +6,9 @@ The sample scripts demonstrate the creation of a WebLogic domain home in a Docke
66

77
The following prerequisites must be handled prior to running the create domain script:
88
* Make sure the WebLogic operator is running.
9-
* The operator requires WebLogic Server 12.2.1.3.0 with patch 28076014 applied. Refer to [Weblogic docker images](../../../../../site/weblogic-docker-images.md) for details on how to create one.
9+
* The operator requires WebLogic Server 12.2.1.3.0 with patch 28076014 applied. Refer to [Weblogic Docker images](../../../../../site/weblogic-docker-images.md) for details on how to create one. If a different `domainHomeImageBase` (see Configuration table below) is specified, the specified image needs to be built locally or pulled from a repository.
1010
* Create a Kubernetes namespace for the domain unless the intention is to use the default namespace.
1111
* Create the Kubernetes secrets `username` and `password` of the admin account in the same Kubernetes namespace as the domain.
12-
* Build the Oracle WebLogic image `oracle/weblogic:12.2.1.3-developer`. Refer to [Oracle WebLogic Server on Docker](https://github.com/oracle/docker-images/tree/master/OracleWebLogic/dockerfiles/12.2.1.3). If a different `baseImage` (see Configuration table below) is specified, the specified image needs to be built locally or pulled from a repository.
1312

1413
## Use the script to create a domain
1514

@@ -71,15 +70,15 @@ The following parameters can be provided in the inputs file.
7170
| `adminPort` | Port number for the Administration Server inside the Kubernetes cluster. | `7001` |
7271
| `adminNodePort` | Port number of the Administration Server outside the Kubernetes cluster. | `30701` |
7372
| `adminServerName` | Name of the Administration Server. | `admin-server` |
74-
| `baseImage` | The image that is used to build the domain-home-in-image Docker image. If not specified, use the built-in base image `oracle/weblogic:12.2.1.3-developer`. The image specified here needs to be built locally or pulled from a repository before the `create-domain.sh` script is executed. | `oracle/weblogic:12.2.1.3-developer` |
7573
| `clusterName` | Name of the WebLogic cluster instance to generate for the domain. | `cluster-1` |
7674
| `clusterType` | Type of the WebLogic Cluster. Legal values are `CONFIGURED` or `DYNAMIC`. | `DYNAMIC` |
7775
| `configuredManagedServerCount` | Number of Managed Server instances to generate for the domain. | `2` |
76+
| `domainHomeImageBase` | WebLogic binary image used to build the WebLogic domain image. The operator requires WebLogic Server 12.2.1.3.0 with patch 28076014 applied. Refer to [Weblogic Docker images](../../../../../site/weblogic-docker-images.md) for details on how to create one. If a different `domainHomeImageBase` (see Configuration table below) is specified, the specified image needs to be built locally or pulled from a repository before the `create-domain.sh` script is executed. | |
77+
| `domainHomeImageBuildPath` | Location of the WebLogic "domain home in image" Docker image in `https://github.com/oracle/docker-images.git` project. If not specified, use "./docker-images/OracleWebLogic/samples/12213-domain-home-in-image-wdt". Another possible value is "./docker-images/OracleWebLogic/samples/12213-domain-home-in-image" whichuses WLST script, instead of WDT, to generate the domain configuration. | `./docker-images/OracleWebLogic/samples/12213-domain-home-in-image-wdt` |
7878
| `domainUID` | Unique ID that will be used to identify this particular domain. Used as the name of the generated WebLogic domain as well as the name of the Kubernetes domain resource. This ID must be unique across all domains in a Kubernetes cluster. This ID cannot contain any character that is not valid in a Kubernetes service name. | `domain1` |
7979
| `exposeAdminNodePort` | Boolean indicating if the Administration Server is exposed outside of the Kubernetes cluster. | `false` |
8080
| `exposeAdminT3Channel` | Boolean indicating if the T3 administrative channel is exposed outside the Kubernetes cluster. | `false` |
81-
| `image` | WebLogic Docker image that the domain resource will use. If not specified, the value is the name of the generated Docker image. | `12213-domain-home-in-image-wdt` |
82-
| `imagePath` | The relative directory of the WebLogic domain home in image Docker image in `https://github.com/oracle/docker-images.git` project under the `docker-images/OracleWebLogic/samples` directory. | `12213-domain-home-in-image-wdt` |
81+
| `image` | WebLogic Docker image that the domain resource will pull if needed. You only need to specify this if you are going to push the generated image from the local Docker repository to another Docker repository. If not specified, will use the internally generated image name, say "domain-home-in-image-wlst:latest" or "domain-home-in-image-wdt:latest". | |
8382
| `imagePullPolicy` | WebLogic Docker image pull policy. Legal values are "IfNotPresent", "Always", or "Never" | `IfNotPresent` |
8483
| `imagePullSecretName` | Name of the Kubernetes secret to access the Docker Store to pull the WebLogic Server Docker image. The presence of the secret will be validated when this parameter is specified | |
8584
| `includeServerOutInPodLog` | Boolean indicating whether to include server .out to the pod's stdout. | `true` |

kubernetes/samples/scripts/create-weblogic-domain/domain-home-in-image/create-domain-inputs.yaml

Lines changed: 16 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -40,9 +40,12 @@ managedServerPort: 8001
4040
# Boolean indicating if production mode is enabled for the domain
4141
productionModeEnabled: true
4242

43-
# WebLogic Docker image.
44-
# The operator requires WebLogic Server 12.2.1.3.0 with patch 28076014 applied. See README.md for more help.
45-
#image:
43+
# WebLogic Docker image that the domain resource will pull if needed.
44+
# You only need to specify this if you are going to push the generated image from the local Docker repository
45+
# to another Docker repository.
46+
# If not specified, will use the internally generated image name, say "domain-home-in-image-wlst:latest"
47+
# or "domain-home-in-image-wdt:latest".
48+
# image:
4649

4750
# Image pull policy
4851
# Legal values are "IfNotPresent", "Always", or "Never"
@@ -85,14 +88,14 @@ namespace: default
8588
# Java Option for Weblogic Server
8689
javaOptions: -Dweblogic.StdoutDebugEnabled=false
8790

88-
# Base image used to build the domain home in image Docker image
89-
# If not specified, use the built-in base image oracle/weblogic:12.2.1.3-developer
90-
baseImage: oracle/weblogic:12.2.1.3-developer
91-
92-
# The relative directory of the WebLogic domain home in image Docker image in the i
93-
# `https://github.com/oracle/docker-images.git` project under the `docker-images/OracleWebLogic/samples` directory.
94-
# If not specified, use 12213-domain-home-in-image-wdt.
95-
# Another possible value is 12213-domain-home-in-image which uses WLST script instead of WDT to
96-
# generate the domain home.
97-
imagePath: 12213-domain-home-in-image-wdt
91+
# WebLogic binary image used to build the WebLogic domain image
92+
# The operator requires WebLogic Server 12.2.1.3.0 with patch 28076014 applied. See README.md for more help.
93+
# domainHomeImageBase:
94+
95+
# Location of the WebLogic "domain home in image" Docker image sample in the
96+
# `https://github.com/oracle/docker-images.git` project.
97+
# If not specified, use "./docker-images/OracleWebLogic/samples/12213-domain-home-in-image-wdt".
98+
# Another possible value is "./docker-images/OracleWebLogic/samples/12213-domain-home-in-image" which
99+
# uses WLST script, instead of WDT, to generate the domain configuration.
100+
domainHomeImageBuildPath: ./docker-images/OracleWebLogic/samples/12213-domain-home-in-image-wdt
98101

kubernetes/samples/scripts/create-weblogic-domain/domain-home-in-image/create-domain.sh

Lines changed: 17 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -174,8 +174,8 @@ function createFiles {
174174
enabledPrefix="" # uncomment the feature
175175
disabledPrefix="# " # comment out the feature
176176

177-
if [ -z "${image}" ]; then
178-
fail "Please specify image in your input YAML"
177+
if [ -z "${domainHomeImageBase}" ]; then
178+
fail "Please specify domainHomeImageBase in your input YAML"
179179
fi
180180

181181
domainName=${domainUID}
@@ -238,11 +238,13 @@ function createFiles {
238238
sed -i -e "s:%WEBLOGIC_IMAGE_PULL_POLICY%:${imagePullPolicy}:g" ${dcrOutput}
239239
sed -i -e "s:%WEBLOGIC_IMAGE_PULL_SECRET_NAME%:${imagePullSecretName}:g" ${dcrOutput}
240240
sed -i -e "s:%WEBLOGIC_IMAGE_PULL_SECRET_PREFIX%:${imagePullSecretPrefix}:g" ${dcrOutput}
241-
242-
if [ -z $imagePath ]; then
243-
imagePath="12213-domain-home-in-image-wdt"
241+
242+
domainHomeImageBuildPathDefault="./docker-images/OracleWebLogic/samples/docker-images/OracleWebLogic/samples/12213-domain-home-in-image-wdt"
243+
if [ -z $domainHomeImageBuildPath ]; then
244+
domainHomeImageBuildPath=${domainHomeImageBuildPathDefault}
244245
fi
245-
imageName="${imagePath}:latest"
246+
247+
imageName="`basename ${domainHomeImageBuildPath} | sed 's/^[0-9]*-//'`"
246248

247249
# now we know which image to use, update the domain yaml file
248250
if [ -z $image ]; then
@@ -259,7 +261,7 @@ function createFiles {
259261
# Function to build docker image and create WebLogic domain home
260262
#
261263
function createDomainHome {
262-
dockerDir=${scriptDir}/docker-images/OracleWebLogic/samples/${imagePath}
264+
dockerDir=${scriptDir}/${domainHomeImageBuildPath}
263265
dockerPropsDir=${dockerDir}/properties
264266
cp ${domainPropertiesOutput} ${dockerPropsDir}/docker-build
265267

@@ -276,11 +278,17 @@ function createDomainHome {
276278
sed -i -e "s|myuser|${username}|g" $usernameFile
277279
sed -i -e "s|mypassword1|${password}|g" $passwordFile
278280

279-
if [ ! -z $baseImage ]; then
280-
sed -i -e "s|\(FROM \).*|\1 ${baseImage}|g" ${dockerDir}/Dockerfile
281+
if [ ! -z $domainHomeImageBase ]; then
282+
sed -i -e "s|\(FROM \).*|\1 ${domainHomeImageBase}|g" ${dockerDir}/Dockerfile
281283
fi
282284

283285
sh ${dockerDir}/build.sh
286+
imageNameOrigin="`basename ${domainHomeImageBuildPath}`"
287+
288+
# if use the default images, we tag it to a more generic name (without the release version numbers)
289+
if [ -z $image ]; then
290+
docker tag $imageNameOrigin:latest $imageName:latest
291+
fi
284292

285293
if [ "$?" != "0" ]; then
286294
fail "Create domain ${domainName} failed."

kubernetes/samples/scripts/create-weblogic-domain/domain-home-on-pv/README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ Before you begin, read this guide, [Domain Resource](../../../../../site/domain-
88

99
The following prerequisites must be handled prior to running the create domain script:
1010
* Make sure the WebLogic operator is running.
11-
* The operator requires WebLogic Server 12.2.1.3.0 with patch 28076014 applied. Refer to [Weblogic docker images](../../../../../site/weblogic-docker-images.md) for details on how to create one.
11+
* The operator requires WebLogic Server 12.2.1.3.0 with patch 28076014 applied. Refer to [Weblogic Docker images](../../../../../site/weblogic-docker-images.md) for details on how to create one.
1212
* Create a Kubernetes namespace for the domain unless the intention is to use the default namespace.
1313
* In the same Kubernetes namespace, create the Kubernetes persistent volume where the domain home will be hosted, and the Kubernetes persistent volume claim for the domain. For samples to create a PV and PVC, see [Create sample PV and PVC](../../create-weblogic-domain-pv-pvc/README.md).
1414
* Create the Kubernetes secrets `username` and `password` of the admin account in the same Kubernetes namespace as the domain.
@@ -83,7 +83,7 @@ The following parameters can be provided in the inputs file.
8383
| `domainUID` | Unique ID that will be used to identify this particular domain. Used as the name of the generated WebLogic domain as well as the name of the Kubernetes domain resource. This ID must be unique across all domains in a Kubernetes cluster. This ID cannot contain any character that is not valid in a Kubernetes service name. | `domain1` |
8484
| `exposeAdminNodePort` | Boolean indicating if the Administration Server is exposed outside of the Kubernetes cluster. | `false` |
8585
| `exposeAdminT3Channel` | Boolean indicating if the T3 administrative channel is exposed outside the Kubernetes cluster. | `false` |
86-
| `image` | WebLogic Docker image. | `store/oracle/weblogic:12.2.1.3` |
86+
| `image` | WebLogic Docker image. The operator requires WebLogic Server 12.2.1.3.0 with patch 28076014 applied. Refer to [Weblogic Docker images](../../../../../site/weblogic-docker-images.md) for details on how to create one. | |
8787
| `imagePullPolicy` | WebLogic Docker image pull policy. Legal values are "IfNotPresent", "Always", or "Never" | `IfNotPresent` |
8888
| `imagePullSecretName` | Name of the Kubernetes secret to access the Docker Store to pull the WebLogic Server Docker image. The presence of the secret will be validated when this parameter is specified | |
8989
| `includeServerOutInPodLog` | Boolean indicating whether to include server .out to the pod's stdout. | `true` |

0 commit comments

Comments
 (0)