Skip to content

Commit 819ce81

Browse files
committed
Keep job comfigmap plus README update
Signed-off-by: doxiao <[email protected]>
1 parent fd1b1ab commit 819ce81

File tree

2 files changed

+18
-28
lines changed

2 files changed

+18
-28
lines changed

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

Lines changed: 16 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,14 @@
11
# WebLogic Sample Domain Home on a Persistent Volume
22

3-
The sample scripts demonstrate the creation of a WebLogic domain home on an existing Kubernetes Persistent Volume (PV) and Persistent Volume Claim (PVC). 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 on an existing Kubernetes Persistent Volume (PV) and Persistent Volume Claim (PVC). The scripts also generate the domain resource YAML file, which can then be used to start the Kubernetes artifacts of the corresponding domain. Optionally, the scripts start up the domain resource, 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.
9+
* Create a Kubernetes namespace for the domain resource unless the intention is to use the default namespace.
1010
* Create in the same Kubernetes namespace, the Kubernetes persistent volume where the domain home will be hosted, and the Kubernetes persistent volume claim for the domain resource. For samples to create a PV and PVC, refer to [Create sample PV and PVC](../../create-weblogic-domain-pv-pvc/README.md).
11-
* Create the Kubernetes secrets `username` and `password` of the admin account in the same Kubernetes namespace as the domain custom resource.
11+
* Create the Kubernetes secrets `username` and `password` of the admin account in the same Kubernetes namespace as the domain resource.
1212

1313
## Using the script to create a domain
1414

@@ -25,10 +25,10 @@ The script will perform the following steps:
2525
* Create a directory for the generated 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 Kubernetes job that will start up a utility WebLogic Server container and run offline WLST scripts, or WebLogic Deploy Tool (WDT) scripts, to create the domain on the shared storage.
2727
* Run the job and wait for the job to finish.
28-
* Create a Kubernetes domain custom resource YAML file, `domain-custom-resource.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 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.
2929
* Create a convenient utility script, `delete-domain-job.yaml`, to clean up the domain home created by the create script.
3030

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

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

@@ -66,16 +66,23 @@ The following parameters can be provided in the inputs file.
6666
| `adminNodePort` | Port number of the Administration Server outside the Kubernetes cluster. | `30701` |
6767
| `adminServerName` | Name of the Administration Server. | `admin-server` |
6868
| `clusterName` | Name of the WebLogic cluster instance to generate for the domain. | `cluster-1` |
69+
| `clusterType` | Type of WebLogic Cluster. Legal values are `CONFIGURED` or `DYNAMIC`. | `DYNAMIC` |
6970
| `configuredManagedServerCount` | Number of Managed Server instances to generate for the domain. | `2` |
7071
| `createDomainFilesDir` | Directory to get all the create domain scripts and supporting files, including the script that is specified by the `createDomainScriptName` property. By default, this directory is set to the relative path `wlst`, and the create script will use the built-in WLST offline scripts in the `wlst` directory to create the WebLogic domain. It can also be set to the relative path `wdt`, and then the built-in WDT scripts will be used instead. An absolute path is also supported to point to an arbitrary directory in the file system. | `wlst` |
7172
| `createDomainScriptsMountPath` | Mount path of the directory where the create domain scripts are located inside the pod. | `/u01/weblogic` |
7273
| `createDomainScriptName` | Script that creates the domain. | `create-domain-job.sh` |
74+
| `domainHome` | Home directory of the WebLogic domain. | `/shared/domains/<domainUID>` |
7375
| `domainPVMountPath` | Mount path of the domain persistent volume. | `/shared` |
74-
| `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` |
76+
| `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` |
7577
| `exposeAdminNodePort` | Boolean indicating if the Administration Server is exposed outside of the Kubernetes cluster. | `false` |
7678
| `exposeAdminT3Channel` | Boolean indicating if the T3 administrative channel is exposed outside the Kubernetes cluster. | `false` |
79+
| `image` | WebLogic Docker image. | `store/oracle/weblogic:12.2.1.3` |
80+
| `imagePullPolicy` | WebLogic Docker image pull policy. Legal values are "IfNotPresent", "Always", or "Never" | `IfNotPresent` |
81+
| `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 | |
82+
| `includeServerOutInPodLog` | Boolean indicating whether to include server .out to the pod's stdout. | `true` |
7783
| `initialManagedServerReplicas` | Number of Managed Servers to initially start for the domain. | `2` |
7884
| `javaOptions` | Java options for starting the Administration and Managed Servers. A Java option can have references to one or more of the following pre-defined variables to obtain WebLogic domain information: `$(DOMAIN_NAME)`, `$(DOMAIN_HOME)`, `$(ADMIN_NAME)`, `$(ADMIN_PORT)`, and `$(SERVER_NAME)`. | `-Dweblogic.StdoutDebugEnabled=false` |
85+
| `logHome` | The in-pod name of the directory to store the domain, node manager, server logs, and server .out files in. | `/shared/logs/<domainUID>` |
7986
| `managedServerNameBase` | Base string used to generate Managed Server names. | `managed-server` |
8087
| `managedServerPort` | Port number for each Managed Server. | `8001` |
8188
| `namespace` | Kubernetes namespace in which to create the domain. | `default` |
@@ -98,7 +105,7 @@ Note that the example results below uses the `default` Kubernetes namespace. If
98105

99106
### Generated YAML files with the default inputs
100107

101-
The content of the generated `domain-custom-resource.yaml`:
108+
The content of the generated `domain.yaml`:
102109

103110
```
104111
# Copyright 2017, 2018, Oracle Corporation and/or its affiliates. All rights reserved.
@@ -175,9 +182,9 @@ spec:
175182
176183
```
177184

178-
### Verify the domain custom resource
185+
### Verify the domain resource
179186

180-
To confirm that the domain custom resource was created, use this command:
187+
To confirm that the domain resource was created, use this command:
181188

182189
```
183190
kubectl describe domain DOMAINUID -n NAMESPACE

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

Lines changed: 2 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -447,14 +447,6 @@ function createDomainConfigmap {
447447
rm -rf $externalFilesTmpDir
448448
}
449449

450-
#
451-
# Function to delete the create domain job config map and fail
452-
#
453-
function cleanupAndFail {
454-
deleteDomainConfigmap
455-
fail $1
456-
}
457-
458450
#
459451
# Function to run the job that creates the domain
460452
#
@@ -501,7 +493,7 @@ function createDomainHome {
501493
echo "The create domain job is not showing status completed after waiting 300 seconds."
502494
echo "Check the log output for errors."
503495
kubectl logs jobs/$JOB_NAME -n ${namespace}
504-
cleanupAndFail "Exiting due to failure - the job status is not Completed!"
496+
fail "Exiting due to failure - the job status is not Completed!"
505497
fi
506498

507499
# Check for successful completion in log file
@@ -511,23 +503,14 @@ function createDomainHome {
511503
echo The log file for the create domain job does not contain a successful completion status
512504
echo Check the log output for errors
513505
kubectl logs $JOB_POD -n ${namespace}
514-
cleanupAndFail "Exiting due to failure - the job log file does not contain a successful completion status!"
506+
fail "Exiting due to failure - the job log file does not contain a successful completion status!"
515507
fi
516508

517509
# Delete the configmap for the create domain job
518510
deleteDomainConfigmap
519511

520512
}
521513

522-
#
523-
# Function to delete the config map used by the job
524-
#
525-
function deleteDomainConfigmap {
526-
# delete the configmap
527-
local cmName=${domainUID}-create-weblogic-sample-domain-job-cm
528-
kubectl delete configmap ${cmName} -n $namespace
529-
}
530-
531514
#
532515
# Function to output to the console a summary of the work completed
533516
#

0 commit comments

Comments
 (0)