Skip to content

Commit 3b29df1

Browse files
authored
Merge pull request #742 from oracle/quickstart-sample-updates
Quickstart doc and sample updates (based on internal early accepters experience)
2 parents 558f25e + 3d12b53 commit 3b29df1

File tree

5 files changed

+48
-26
lines changed

5 files changed

+48
-26
lines changed

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

Lines changed: 14 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -30,9 +30,10 @@ The script will perform the following steps:
3030
* Clone the weblogic docker-images project into the current directory using `git clone https://github.com/oracle/docker-images.git`.
3131
* Replace the built-in user name and password in the `properties/docker-build/domain_security.properties` file with the `username` and `password` that are supplied on the command line using the `-u` and `-p` options. These credentials need to match the WebLogic domain admin credentials in the secret that is specified via the `weblogicCredentialsSecretName` property in the `create-domain-inputs.yaml` file.
3232
* Build a Docker image based on the Docker sample, [Example Image with a WebLogic Server Domain using the Oracle WebLogic Deploy Tooling (WDT)](https://github.com/oracle/docker-images/tree/master/OracleWebLogic/samples/12213-domain-home-in-image-wdt) and [Example Image with a WebLogic Server Domain using WLST](https://github.com/oracle/docker-images/tree/master/OracleWebLogic/samples/12213-domain-home-in-image). It will create a sample WebLogic Server domain in the Docker image. Also, you can run the Docker sample, [Example Image with a WebLogic Server Domain](https://github.com/oracle/docker-images/tree/master/OracleWebLogic/samples/12213-domain-home-in-image), manually with the generated `domain.properties` to create a domain home image. **Note**: Oracle recommends keeping the domain home image private in the local repository.
33+
* Create a tag that refers to the generated Docker image.
3334
* Create a Kubernetes domain YAML file, `domain.yaml`, in the directory that is created above. This YAML file can be used to create the Kubernetes resource using the `kubectl create -f` or `kubectl apply -f` command.
3435
```
35-
kubectl apply -f /path/to/output-directory/weblogic-domains/<domainUID>/domain.yaml
36+
$ kubectl apply -f /path/to/output-directory/weblogic-domains/<domainUID>/domain.yaml
3637
```
3738

3839
As a convenience, using the `-e` option, the script can optionally create the domain object, which in turn results in the creation of the corresponding WebLogic Server pods and services. This option should only be used in a single node Kubernetes cluster.
@@ -60,12 +61,21 @@ If you copy the sample scripts to a different location, make sure that you copy
6061
The default domain created by the script has the following characteristics:
6162

6263
* An Administration Server named `admin-server` listening on port `7001`.
63-
* A dynamic cluster named `cluster-1` of size 2.
64+
* A dynamic cluster named `cluster-1` of size 5.
6465
* Two Managed Servers, named `managed-server1` and `managed-server2`, listening on port `8001`.
6566
* No applications deployed.
66-
* A Derby data source.
6767
* A T3 channel.
6868

69+
If you run the sample from a machine that is remote to the Kubernetes cluster, and you need to push the new image to a registry that is local to the cluster, you need to do the following (also see the `image` property in the table in the next section):
70+
* Set the `image` property in the inputs file to the target image name (including the registry hostname/port and the tag if needed).
71+
* Run the `create-domain.sh` script without the `-e` option.
72+
* Push the `image` to the target registry.
73+
* Run the following command to create the domain.
74+
75+
```
76+
$ kubectl apply -f /path/to/output-directory/weblogic-domains/<domainUID>/domain.yaml
77+
```
78+
6979
The domain creation inputs can be customized by editing `create-domain-inputs.yaml`.
7080

7181
### Configuration parameters
@@ -84,7 +94,7 @@ The following parameters can be provided in the inputs file.
8494
| `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` |
8595
| `exposeAdminNodePort` | Boolean indicating if the Administration Server is exposed outside of the Kubernetes cluster. | `false` |
8696
| `exposeAdminT3Channel` | Boolean indicating if the T3 administrative channel is exposed outside the Kubernetes cluster. | `false` |
87-
| `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, the sample uses the internally generated image name, either "domain-home-in-image:latest" or "domain-home-in-image-wdt:latest". | |
97+
| `image` | WebLogic Docker image that the domain resource will pull if needed. You only need to specify this if you are going to tag the generated image to a different name. If you run the sample script from a machine that is remote to the Kubernetes cluster, you need to specify this to point to an image in a registry local to the cluster, and then push the generate image to that registry before starting the domain. If not specified, the sample uses the internally generated image name, either "domain-home-in-image:latest" or "domain-home-in-image-wdt:latest". | |
8898
| `imagePullPolicy` | WebLogic Docker image pull policy. Legal values are "IfNotPresent", "Always", or "Never" | `IfNotPresent` |
8999
| `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 | |
90100
| `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: 19 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,8 @@ adminPort: 7001
1111
adminServerName: admin-server
1212

1313
# Unique ID identifying a domain.
14-
# This ID must not contain an underscope ("_"), and must be lowercase and unique across all domains in a Kubernetes cluster.
14+
# This ID must not contain an underscope ("_"), and must be lowercase and unique across all domains
15+
# in a Kubernetes cluster.
1516
domainUID: domain1
1617

1718
# Type of WebLogic Cluster
@@ -41,11 +42,18 @@ managedServerPort: 8001
4142
productionModeEnabled: true
4243

4344
# 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, the sample uses the internally generated image name, either "domain-home-in-image:latest"
47-
# or "domain-home-in-image-wdt:latest".
48-
# image:
45+
#
46+
# You only need to specify this if you want to tag the generated image to a different name.
47+
#
48+
# If you are running the sample script from a machine that is remote to the Kubernetes cluster,
49+
# you need to specify this to point to an image in a registry local to the cluster. You
50+
# then need to push the generate image to that registry before starting the domain.
51+
#
52+
# If not specified, the sample uses the internally generated image name,
53+
# either "domain-home-in-image-wdt:latest" or "domain-home-in-image-wlst:latest".
54+
#
55+
# See README.md for more help.
56+
#image:
4957

5058
# Image pull policy
5159
# Legal values are "IfNotPresent", "Always", or "Never"
@@ -89,13 +97,14 @@ namespace: default
8997
javaOptions: -Dweblogic.StdoutDebugEnabled=false
9098

9199
# Base 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:
100+
# The operator requires WebLogic Server 12.2.1.3.0 with patch 28076014 applied.
101+
# See README.md for more help.
102+
#domainHomeImageBase:
94103

95104
# Location of the WebLogic "domain home in image" Docker image sample in the
96105
# `https://github.com/oracle/docker-images.git` project.
97106
# 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.
107+
# Another possible value is "./docker-images/OracleWebLogic/samples/12213-domain-home-in-image",
108+
# which uses a WLST script, instead of WDT, to generate the domain configuration.
100109
domainHomeImageBuildPath: ./docker-images/OracleWebLogic/samples/12213-domain-home-in-image-wdt
101110

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

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -289,6 +289,8 @@ function createDomainHome {
289289
# if use the default images, we tag it to a more generic name (without the release version numbers)
290290
if [ -z $image ]; then
291291
docker tag $imageNameOrigin:latest $imageName:latest
292+
else
293+
docker tag $imageNameOrigin:latest $image
292294
fi
293295

294296
if [ "$?" != "0" ]; then

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

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -15,14 +15,3 @@ CLUSTER_TYPE=%CLUSTER_TYPE%
1515
JAVA_OPTIONS=%JAVA_OPTIONS%
1616
T3_CHANNEL_PORT=%T3_CHANNEL_PORT%
1717
T3_PUBLIC_ADDRESS=%T3_PUBLIC_ADDRESS%
18-
#Derby Data Source parameters
19-
dsname=DockerDS
20-
dsdbname=DerbyDB;create=true
21-
dsjndiname=/DockerDS
22-
dsdriver=org.apache.derby.jdbc.ClientXADataSource
23-
dsurl=jdbc:derby://localhost:1527/DerbyDB;ServerName=localhost;databaseName=DerbyDB;create=true
24-
dsusername=dbuser
25-
dspassword=dbpassword
26-
dstestquery=SQL SELECT 1 FROM SYS.SYSTABLES
27-
dsinitalcapacity=0
28-
dsmaxcapacity=15

site/quickstart.md

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -162,7 +162,9 @@ domain namespace (`sample-domain1-ns`) and the `domainHomeImageBase` (`oracle/we
162162

163163
* Setting `weblogicCredentialsSecretName` to the name of the secret containing the WebLogic credentials.
164164
By convention, the secret will be named`domainUID-weblogic-credentials` (where `domainUID` is replaced with the
165-
actual `domainUID` value).
165+
actual `domainUID` value).
166+
167+
* Leaving the `image` empty unless you need to tag the new image that the script builds to a different name.
166168

167169
For example, assuming you named your copy `my-inputs.yaml`:
168170
```
@@ -175,6 +177,16 @@ respectively, as shown in the example. If you specify the `-e` option, the scri
175177
Kubernetes YAML files *and* apply them to your cluster. If you omit the `-e` option, the
176178
script will just generate the YAML files, but will not take any action on your cluster.
177179

180+
If you run the sample from a machine that is remote to the Kubernetes cluster, and you need to push the new image to a registry that is local to the cluster, you need to do the following:
181+
* Set the `image` property in the inputs file to the target image name (including the registry hostname/port, and the tag if needed).
182+
* Run the `create-domain.sh` script without the `-e` option.
183+
* Push the `image` to the registry.
184+
* Run the following command to create the domain.
185+
186+
```
187+
$ kubectl apply -f /some/output/directory/weblogic-domains/sample-domain1/domain.yaml
188+
```
189+
178190
c. Confirm that the operator started the servers for the domain:
179191
* Use `kubectl` to show that the domain resource was created:
180192
```

0 commit comments

Comments
 (0)