Skip to content

Commit 4ec61ad

Browse files
committed
Update example results in README
Signed-off-by: doxiao <[email protected]>
1 parent af38b6a commit 4ec61ad

File tree

2 files changed

+114
-88
lines changed

2 files changed

+114
-88
lines changed

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

Lines changed: 113 additions & 87 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 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.
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 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 resource unless the intention is to use the default namespace.
10-
* 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 resource.
9+
* Create a Kubernetes namespace for the domain unless the intention is to use the default namespace.
10+
* 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. 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.
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 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
* 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 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 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

@@ -95,7 +95,7 @@ The following parameters can be provided in the inputs file.
9595

9696
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 `("-")`.
9797

98-
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.
98+
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.
9999

100100
## Verify the results
101101

@@ -109,37 +109,54 @@ The content of the generated `domain.yaml`:
109109

110110
```
111111
# Copyright 2017, 2018, Oracle Corporation and/or its affiliates. All rights reserved.
112+
112113
# Licensed under the Universal Permissive License v 1.0 as shown at http://oss.oracle.com/licenses/upl.
113114
#
114-
# This is an example of how to define a Domain Custom Resource.
115+
# This is an example of how to define a Domain resource.
115116
#
116117
apiVersion: "weblogic.oracle/v2"
117118
kind: Domain
118119
metadata:
119120
name: domain1
120121
namespace: default
122+
labels:
123+
weblogic.resourceVersion: domain-v2
124+
weblogic.domainUID: domain1
125+
weblogic.domainName: domain1
121126
spec:
122127
# The domainUID must be unique across the entire Kubernetes Cluster. Each WebLogic Domain must
123128
# have its own unique domainUID. This does not have to be the same as the Domain Name. It is allowed
124129
# to have multiple Domains with the same Domain Name, but they MUST have different domainUID's.
125130
# The domainUID is also used to identify the Persistent Volume that belongs to/with this Domain.
126131
domainUID: domain1
127132
# The WebLogic Domain Name
128-
domainName: base_domain
133+
domainName: domain1
134+
# The WebLogic Domain Home
135+
domainHome: /shared/domains/domain1
136+
# If the domain home is in the image
137+
domainHomeInImage: false
129138
# The Operator currently does not support other images
130-
image: "store/oracle/weblogic:12.2.1.3"
139+
image: "store/oracle/weblogic:19.1.0.0"
131140
# imagePullPolicy defaults to "Always" if image version is :latest
132141
imagePullPolicy: "IfNotPresent"
133142
# Identify which Secret contains the credentials for pulling an image
134-
imagePullSecrets:
135-
- name:
143+
#imagePullSecrets:
144+
#- name:
136145
# Identify which Secret contains the WebLogic Admin credentials (note that there is an example of
137146
# how to create that Secret at the end of this file)
138147
adminSecret:
139148
name: domain1-weblogic-credentials
140149
# The name of the Admin Server
150+
asName: "admin-server"
141151
# The Admin Server's ListenPort
142152
asPort: 7001
153+
# Whether to include the server out file into the pod's stdout, default is true
154+
includeServerOutInPodLog: true
155+
# The in-pod name of the directory to store the domain, node manager, server logs, and server .out
156+
# files in.
157+
# If not specified or empty, domain log file, server logs, server out, and node manager log files
158+
# will be stored in the default logHome location of /shared/logs/<domainUID>/.
159+
logHome: /shared/logs/domain1
143160
# serverStartPolicy legal values are "NEVER", "ALWAYS", "IF_NEEDED", or "ADMIN_ONLY"
144161
# This determines which WebLogic Servers the Operator will start up when it discovers this Domain
145162
# - "ALWAYS" will start up all defined servers
@@ -148,13 +165,13 @@ spec:
148165
serverStartPolicy: "IF_NEEDED"
149166
# adminServer is used to configure the desired behavior for starting the administration server.
150167
adminServer:
151-
# desiredState legal values are "RUNNING" or "ADMIN"
168+
# serverStartState legal values are "RUNNING" or "ADMIN"
152169
# "RUNNING" means the listed server will be started up to "RUNNING" mode
153170
# "ADMIN" means the listed server will be start up to "ADMIN" mode
154-
desiredState: "RUNNING"
171+
serverStartState: "RUNNING"
155172
# The Admin Server's NodePort
156173
nodePort: 30701
157-
# export the T3Channel as a service
174+
# Uncomment to export the T3Channel as a service
158175
exportedNetworkAccessPoints:
159176
T3Channel: {}
160177
# an (optional) list of environment variable to be set on the server
@@ -163,28 +180,27 @@ spec:
163180
value: "-Dweblogic.StdoutDebugEnabled=false"
164181
- name: USER_MEM_ARGS
165182
value: "-Xms64m -Xmx256m "
166-
# clusters is used to configure the desired behavior for starting member servers of a cluster.
183+
# clusters is used to configure the desired behavior for starting member servers of a cluster.
167184
# If you use this entry, then the rules will be applied to ALL servers that are members of the named clusters.
168185
clusters:
169186
cluster-1:
170-
desiredState: "RUNNING"
187+
serverStartState: "RUNNING"
171188
replicas: 2
172189
env:
173190
- name: JAVA_OPTIONS
174191
value: "-Dweblogic.StdoutDebugEnabled=false"
175192
- name: USER_MEM_ARGS
176193
value: "-Xms64m -Xmx256m "
177-
# The number of managed servers to start from clusters not listed in clusters
194+
# The number of managed servers to start for unlisted clusters
178195
# replicas: 1
179196
storage:
180197
predefined:
181198
claim: domain1-weblogic-sample-pvc
182-
183199
```
184200

185-
### Verify the domain resource
201+
### Verify the domain
186202

187-
To confirm that the domain resource was created, use this command:
203+
To confirm that the domain was created, use this command:
188204

189205
```
190206
kubectl describe domain DOMAINUID -n NAMESPACE
@@ -198,92 +214,102 @@ Here is an example of the output of this command:
198214
$ kubectl describe domain domain1
199215
Name: domain1
200216
Namespace: default
201-
Labels: weblogic.domainName=base_domain
217+
Labels: weblogic.domainName=domain1
202218
weblogic.domainUID=domain1
203219
weblogic.resourceVersion=domain-v2
204220
Annotations: <none>
205-
API Version: weblogic.oracle/v1
221+
API Version: weblogic.oracle/v2
206222
Kind: Domain
207223
Metadata:
208-
Cluster Name:
209-
Creation Timestamp: 2018-10-31T12:59:15Z
210-
Generation: 0
211-
Resource Version: 1314703
212-
Self Link: /apis/weblogic.oracle/v1/namespaces/default/domains/domain1
213-
UID: c52f5e11-dd0c-11e8-9238-fa163e855ac8
224+
Cluster Name:
225+
Creation Timestamp: 2018-12-07T04:32:13Z
226+
Generation: 1
227+
Resource Version: 351622
228+
Self Link: /apis/weblogic.oracle/v2/namespaces/default/domains/domain1
229+
UID: 11d951d0-f9d9-11e8-b751-fa163e855ac8
214230
Spec:
215231
Admin Secret:
216-
Name: domain1-weblogic-credentials
217-
As Name: admin-server
218-
As Port: 7001
219-
Cluster Startup:
220-
Cluster Name: cluster-1
221-
Desired State: RUNNING
222-
Env:
223-
Name: JAVA_OPTIONS
224-
Value: -Dweblogic.StdoutDebugEnabled=false
225-
Name: USER_MEM_ARGS
226-
Value: -Xms64m -Xmx256m
227-
Replicas: 2
232+
Name: domain1-weblogic-credentials
233+
Admin Server:
234+
Exported Network Access Points:
235+
T 3 Channel:
236+
Annotations:
237+
Labels:
238+
Node Port: 30701
239+
Server Pod:
240+
Container Security Context:
241+
Env:
242+
Liveness Probe:
243+
Node Selector:
244+
Pod Annotations:
245+
Pod Labels:
246+
Pod Security Context:
247+
Readiness Probe:
248+
Resources:
249+
Limits:
250+
Requests:
251+
Volume Mounts:
252+
Volumes:
253+
Server Start State: RUNNING
254+
As Name: admin-server
255+
As Port: 7001
228256
Clusters:
229-
Domain Home In Image: false
230-
Domain Name: base_domain
231-
Domain UID: domain1
232-
Env:
233-
Export T 3 Channels:
234-
T3Channel
235-
Exported Network Access Points:
236-
Image: store/oracle/weblogic:12.2.1.3
237-
Image Pull Policy: IfNotPresent
238-
Image Pull Secret:
239-
Liveness Probe:
257+
Cluster - 1:
258+
Replicas: 2
259+
Server Pod:
260+
Container Security Context:
261+
Env:
262+
Liveness Probe:
263+
Node Selector:
264+
Pod Annotations:
265+
Pod Labels:
266+
Pod Security Context:
267+
Readiness Probe:
268+
Resources:
269+
Limits:
270+
Requests:
271+
Volume Mounts:
272+
Volumes:
273+
Server Start State: RUNNING
274+
Domain Home: /shared/domains/domain1
275+
Domain Home In Image: false
276+
Domain Name: domain1
277+
Domain UID: domain1
278+
Image: store/oracle/weblogic:19.1.0.0
279+
Image Pull Policy: IfNotPresent
280+
Include Server Out In Pod Log: true
281+
Log Home: /shared/logs/domain1
240282
Managed Servers:
241-
Readiness Probe:
242-
Server Startup:
243-
Desired State: RUNNING
283+
Server Pod:
284+
Container Security Context:
244285
Env:
245-
Name: JAVA_OPTIONS
246-
Value: -Dweblogic.StdoutDebugEnabled=false
247-
Name: USER_MEM_ARGS
248-
Value: -Xms64m -Xmx256m
249-
Node Port: 30701
250-
Server Name: admin-server
251-
Startup Control: AUTO
286+
Liveness Probe:
287+
Node Selector:
288+
Pod Annotations:
289+
Pod Labels:
290+
Pod Security Context:
291+
Readiness Probe:
292+
Resources:
293+
Limits:
294+
Requests:
295+
Volume Mounts:
296+
Volumes:
297+
Server Start Policy: NEVER
252298
Storage:
253299
Predefined:
254300
Claim: domain1-weblogic-sample-pvc
255301
Status:
256302
Conditions:
257-
Last Transition Time: 2018-10-31T13:01:34.786Z
303+
Last Transition Time: 2018-12-07T04:37:14.905Z
258304
Reason: ServersReady
259305
Status: True
260306
Type: Available
261307
Servers:
262-
Health:
263-
Activation Time: 2018-10-31T13:07:14.472Z
264-
Overall Health: ok
265-
Subsystems:
266-
Node Name: xxxxxxxx
267-
Server Name: admin-server
268-
State: RUNNING
269-
Cluster Name: cluster-1
270-
Health:
271-
Activation Time: 2018-10-31T13:01:05.100Z
272-
Overall Health: ok
273-
Subsystems:
274-
Node Name: xxxxxxxx
275-
Server Name: managed-server1
276-
State: RUNNING
277-
Cluster Name: cluster-1
278-
Health:
279-
Activation Time: 2018-10-31T13:01:05.190Z
280-
Overall Health: ok
281-
Subsystems:
282-
Node Name: xxxxxxxx
283-
Server Name: managed-server2
284-
State: RUNNING
285-
Start Time: 2018-10-31T12:59:15.244Z
308+
Server Name: admin-server
309+
State: SHUTDOWN
310+
Start Time: 2018-12-07T04:32:13.779Z
286311
Events: <none>
312+
287313
```
288314

289315
In the `Status` section of the output, the available servers and clusters are listed. Note that if this command is issued very soon after the script finishes, there may be no servers available yet, or perhaps only the Administration Server but no Managed Servers. The operator will start up the Administration Server first and wait for it to become ready before starting Managed Servers.

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
# Licensed under the Universal Permissive License v 1.0 as shown at http://oss.oracle.com/licenses/upl.
44
#
5-
# This is an example of how to define a Domain Custom Resource.
5+
# This is an example of how to define a Domain resource.
66
#
77
apiVersion: "weblogic.oracle/v2"
88
kind: Domain

0 commit comments

Comments
 (0)