Skip to content

Commit aeeb8d7

Browse files
committed
Address review comments
1 parent 7e8e521 commit aeeb8d7

File tree

5 files changed

+29
-22
lines changed

5 files changed

+29
-22
lines changed

kubernetes/samples/scripts/create-weblogic-domain-pv-pvc/create-pv-pvc-inputs.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ weblogicDomainStorageType: HOST_PATH
2626

2727
# Physical path of the persistent storage.
2828
# The following line must be uncomment and customized:
29-
#weblogicDomainStoragePath: /scratch/k8s_dir
29+
weblogicDomainStoragePath: /scratch/k8s_dir
3030

3131
# Reclaim policy of the persistent storage
3232
# The valid values are: 'Retain', 'Delete', and 'Recycle'

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

Lines changed: 16 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
11
# WebLogic Sample Domain Home in Docker Image
22

3-
The sample scripts demonstrate the creation of a WebLogic domain home in docker image. The scripts also generate the domain custom resource YAML file, which can then be used to start the Kubernetes artifacts of the corresponding domain. Optionally, the scripts start up the domain custom resource, and WebLogic Server pods and services.
3+
The sample scripts demonstrate the creation of a WebLogic domain home in docker image. The scripts also generate the domain YAML file, which can then be used to start the Kubernetes artifacts of the corresponding domain. Optionally, the scripts start up the domain, and WebLogic Server pods and services.
44

55
## Prerequisites
66

77
The following prerequisites must be handled prior to running the create domain script:
88
* Make sure the WebLogic Operator is running.
9-
* Create a Kubernetes namespace for the domain custom resource unless the intention is to use the default namespace.
10-
* Create the Kubernetes secrets `username` and `password` of the admin account in the same Kubernetes namespace as the domain custom resource.
9+
* Create a Kubernetes namespace for the domain unless the intention is to use the default namespace.
10+
* Create the Kubernetes secrets `username` and `password` of the admin account in the same Kubernetes namespace as the domain.
1111
* 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).
1212

1313
## Using the script to create a domain
@@ -22,12 +22,12 @@ Make a copy of the `create-domain-inputs.yaml` file, and run the create script,
2222

2323
The script will perform the following steps:
2424

25-
* Create a directory for the generated properties and Kubernetes YAML files for this domain. The pathname is `/path/to/weblogic-operator-output-directory/weblogic-domains/<domainUID>`.
25+
* Create a directory for the generated properties and Kubernetes YAML files for this domain if it does not already exist. The pathname is `/path/to/weblogic-operator-output-directory/weblogic-domains/<domainUID>`. Note that the script fails if the directory is not empty when the `create-domain.sh` script is executed.
2626
* Create a proerties file, `domain.properties`, in the directory that is created above. This properties file will be used to create a sample WebLogic Server domain.
2727
* Build Docker image based on Docker sample [Example Image with a WebLogic Server Domain](https://github.com/oracle/docker-images/tree/master/OracleWebLogic/samples/12213-domain-home-in-image). It will create a sample WebLogic Server domain into the Docker image. You can also 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 domain home image. Note: Oracle recommend keeping the domain home image private in the local repository.
28-
* Create a Kubernetes domain custom resource 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.
28+
* 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.
2929

30-
As a convenience, using the `-e` option, the script can optionally create the domain custom resource object, which in turn results in the creation of the corresponding WebLogic Server pods and services as well.
30+
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 as well.
3131

3232
The usage of the create script is as follows:
3333

@@ -63,9 +63,9 @@ The following parameters can be provided in the inputs file.
6363
| `adminNodePort` | Port number of the Administration Server outside the Kubernetes cluster. | `30701` |
6464
| `adminServerName` | Name of the Administration Server. | `admin-server` |
6565
| `clusterName` | Name of the WebLogic cluster instance to generate for the domain. | `cluster-1` |
66-
| `clusterType` | Type of the WebLogic cluster instance to generate for the domain. Legal values are `CONFIGURED` or `DYNAMIC`. | `DYNAMIC` |
66+
| `clusterType` | Type of the WebLogic Cluster. Legal values are `CONFIGURED` or `DYNAMIC`. | `DYNAMIC` |
6767
| `configuredManagedServerCount` | Number of Managed Server instances to generate for the domain. | `2` |
68-
| `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 custom 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` |
68+
| `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` |
6969
| `exposeAdminNodePort` | Boolean indicating if the Administration Server is exposed outside of the Kubernetes cluster. | `false` |
7070
| `exposeAdminT3Channel` | Boolean indicating if the T3 administrative channel is exposed outside the Kubernetes cluster. | `false` |
7171
| `initialManagedServerReplicas` | Number of Managed Servers to initially start for the domain. | `2` |
@@ -78,11 +78,11 @@ The following parameters can be provided in the inputs file.
7878
| `t3ChannelPort` | Port for the T3 channel of the NetworkAccessPoint. | `30012` |
7979
| `t3PublicAddress` | Public address for the T3 channel. | `kubernetes` |
8080
| `weblogicCredentialsSecretName` | Name of the Kubernetes secret for the Administration Server's username and password. | `domain1-weblogic-credentials` |
81-
| `includeServerOutInPodLog` | Whether to include server .out to the pod's stdout. | `true` |
81+
| `includeServerOutInPodLog` | Boolean indicating whether to include server .out to the pod's stdout. | `true` |
8282

8383
Note that the names of the Kubernetes resources in the generated YAML files may be formed with the value of some of the properties specified in the `create-inputs.yaml` file. Those properties include the `adminServerName`, `clusterName` and `managedServerNameBase`. If those values contain any characters that are invalid in a Kubernetes service name, those characters are converted to valid values in the generated YAML files. For example, an uppercase letter is converted to a lowercase letter and an underscore `("_")` is converted to a hyphen `("-")`.
8484

85-
The sample demonstrates how to create a WebLogic domain home and associated Kubernetes resources for a domain that only has one cluster. In addition, the sample provides the capability for users to supply their own scripts to create the domain home for other use cases. The generated domain resource YAML file could also be modified to cover more use cases.
85+
The sample demonstrates how to create a WebLogic domain home and associated Kubernetes resources for a domain that only has one cluster. In addition, the sample provides the capability for users to supply their own scripts to create the domain home for other use cases. The generated domain YAML file could also be modified to cover more use cases.
8686

8787
## Verify the results
8888

@@ -98,7 +98,7 @@ The content of the generated `domain.yaml`:
9898
# Copyright 2017, 2018, Oracle Corporation and/or its affiliates. All rights reserved.
9999
# Licensed under the Universal Permissive License v 1.0 as shown at http://oss.oracle.com/licenses/upl.
100100
#
101-
# This is an example of how to define a Domain Custom Resource.
101+
# This is an example of how to define a Domain resource.
102102
#
103103
apiVersion: "weblogic.oracle/v2"
104104
kind: Domain
@@ -183,14 +183,14 @@ spec:
183183
volumeMounts:
184184
- name: runtime-properties
185185
mountPath: "/u01/oracle/properties"
186-
# The number of managed servers to start from clusters not listed in clusters
186+
# The number of managed servers to start for unlisted clusters
187187
# replicas: 1
188188
189189
```
190190

191-
### Verify the domain custom resource
191+
### Verify the domain
192192

193-
To confirm that the domain custom resource was created, use this command:
193+
To confirm that the domain was created, use this command:
194194

195195
```
196196
kubectl describe domain DOMAINUID -n NAMESPACE
@@ -331,9 +331,9 @@ domain1-managed-server1 ClusterIP None <none>
331331
domain1-managed-server2 ClusterIP None <none> 8001/TCP 22m
332332
```
333333

334-
## Delete domain custom resource
334+
## Delete domain
335335

336-
Th generated YAML file in the `/path/to/weblogic-operator-output-directory/weblogic-domains/<domainUID>` directory can also be used to delete the Kubernetes resource. The following command can be used to delete domain custom resource:
336+
Th generated YAML file in the `/path/to/weblogic-operator-output-directory/weblogic-domains/<domainUID>` directory can also be used to delete the Kubernetes resource. The following command can be used to delete domain:
337337

338338
```
339339
$ kubectl delete -f domain.yaml

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

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -41,10 +41,12 @@ managedServerPort: 8001
4141
productionModeEnabled: true
4242

4343
# Name of the Kubernetes secret for the Admin Server's username and password
44-
# The name must be lowercase
45-
weblogicCredentialsSecretName: domain1-weblogic-credentials
44+
# The name must be lowercase.
45+
# The default is <domainUID>-weblogic-credentials.
46+
weblogicCredentialsSecretName:
4647

47-
# Whether to include server .out to the pod's stdout, default is true
48+
# Whether to include server .out to the pod's stdout.
49+
# The default is true.
4850
includeServerOutInPodLog: true
4951

5052
# Port for the T3Channel of the NetworkAccessPoint

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

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -212,7 +212,6 @@ function initialize {
212212
domainUID \
213213
clusterName \
214214
managedServerNameBase \
215-
weblogicCredentialsSecretName \
216215
namespace \
217216
t3PublicAddress \
218217
includeServerOutInPodLog \
@@ -317,6 +316,10 @@ function createFiles {
317316
domainHome="/u01/oracle/user_projects/domains/${domainName}"
318317
runtimeProperties="${scriptDir}/docker-images/OracleWebLogic/samples/12213-domain-home-in-image/properties/docker_run"
319318

319+
if [ -z "${weblogicCredentialsSecretName}" ]; then
320+
weblogicCredentialsSecretName="${domainUID}-weblogic-credentials"
321+
fi
322+
320323
cp ${dcrInput} ${dcrOutput}
321324
sed -i -e "s:%NAMESPACE%:$namespace:g" ${dcrOutput}
322325
sed -i -e "s:%DOMAIN_UID%:${domainUID}:g" ${dcrOutput}
@@ -352,6 +355,7 @@ function createDomainHome {
352355
fail "Create domain ${domainName} failed."
353356
fi
354357

358+
cd -
355359
echo ""
356360
echo "Create domain ${domainName} successfully."
357361
}
@@ -383,6 +387,7 @@ function printSummary {
383387
# Function to create the domain custom resource
384388
#
385389
function createDomainResource {
390+
pwd
386391
kubectl apply -f ${dcrOutput}
387392
DCR_AVAIL=`kubectl get domain -n ${namespace} | grep ${domainUID} | wc | awk ' { print $1; } '`
388393
if [ "${DCR_AVAIL}" != "1" ]; then

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
# Copyright 2017, 2018, Oracle Corporation and/or its affiliates. All rights reserved.
22
# Licensed under the Universal Permissive License v 1.0 as shown at http://oss.oracle.com/licenses/upl.
33
#
4-
# This is an example of how to define a Domain Custom Resource.
4+
# This is an example of how to define a Domain resource.
55
#
66
apiVersion: "weblogic.oracle/v2"
77
kind: Domain

0 commit comments

Comments
 (0)