You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
# WebLogic Sample Domain Home on a Persistent Volume
2
2
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.
4
4
5
5
## Prerequisites
6
6
7
7
The following prerequisites must be handled prior to running the create domain script:
8
8
* 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.
12
12
13
13
## Using the script to create a domain
14
14
@@ -25,10 +25,10 @@ The script will perform the following steps:
25
25
* 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.
26
26
* 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.
27
27
* 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.
29
29
* Create a convenient utility script, `delete-domain-job.yaml`, to clean up the domain home created by the create script.
30
30
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.
32
32
33
33
The usage of the create script is as follows:
34
34
@@ -95,7 +95,7 @@ The following parameters can be provided in the inputs file.
95
95
96
96
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 `("-")`.
97
97
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.
99
99
100
100
## Verify the results
101
101
@@ -109,37 +109,54 @@ The content of the generated `domain.yaml`:
109
109
110
110
```
111
111
# Copyright 2017, 2018, Oracle Corporation and/or its affiliates. All rights reserved.
112
+
112
113
# Licensed under the Universal Permissive License v 1.0 as shown at http://oss.oracle.com/licenses/upl.
113
114
#
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.
115
116
#
116
117
apiVersion: "weblogic.oracle/v2"
117
118
kind: Domain
118
119
metadata:
119
120
name: domain1
120
121
namespace: default
122
+
labels:
123
+
weblogic.resourceVersion: domain-v2
124
+
weblogic.domainUID: domain1
125
+
weblogic.domainName: domain1
121
126
spec:
122
127
# The domainUID must be unique across the entire Kubernetes Cluster. Each WebLogic Domain must
123
128
# have its own unique domainUID. This does not have to be the same as the Domain Name. It is allowed
124
129
# to have multiple Domains with the same Domain Name, but they MUST have different domainUID's.
125
130
# The domainUID is also used to identify the Persistent Volume that belongs to/with this Domain.
126
131
domainUID: domain1
127
132
# 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
129
138
# 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"
131
140
# imagePullPolicy defaults to "Always" if image version is :latest
132
141
imagePullPolicy: "IfNotPresent"
133
142
# Identify which Secret contains the credentials for pulling an image
134
-
imagePullSecrets:
135
-
- name:
143
+
#imagePullSecrets:
144
+
#- name:
136
145
# Identify which Secret contains the WebLogic Admin credentials (note that there is an example of
137
146
# how to create that Secret at the end of this file)
138
147
adminSecret:
139
148
name: domain1-weblogic-credentials
140
149
# The name of the Admin Server
150
+
asName: "admin-server"
141
151
# The Admin Server's ListenPort
142
152
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
143
160
# serverStartPolicy legal values are "NEVER", "ALWAYS", "IF_NEEDED", or "ADMIN_ONLY"
144
161
# This determines which WebLogic Servers the Operator will start up when it discovers this Domain
145
162
# - "ALWAYS" will start up all defined servers
@@ -148,13 +165,13 @@ spec:
148
165
serverStartPolicy: "IF_NEEDED"
149
166
# adminServer is used to configure the desired behavior for starting the administration server.
150
167
adminServer:
151
-
# desiredState legal values are "RUNNING" or "ADMIN"
168
+
# serverStartState legal values are "RUNNING" or "ADMIN"
152
169
# "RUNNING" means the listed server will be started up to "RUNNING" mode
153
170
# "ADMIN" means the listed server will be start up to "ADMIN" mode
154
-
desiredState: "RUNNING"
171
+
serverStartState: "RUNNING"
155
172
# The Admin Server's NodePort
156
173
nodePort: 30701
157
-
# export the T3Channel as a service
174
+
# Uncomment to export the T3Channel as a service
158
175
exportedNetworkAccessPoints:
159
176
T3Channel: {}
160
177
# an (optional) list of environment variable to be set on the server
@@ -163,28 +180,27 @@ spec:
163
180
value: "-Dweblogic.StdoutDebugEnabled=false"
164
181
- name: USER_MEM_ARGS
165
182
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.
167
184
# If you use this entry, then the rules will be applied to ALL servers that are members of the named clusters.
168
185
clusters:
169
186
cluster-1:
170
-
desiredState: "RUNNING"
187
+
serverStartState: "RUNNING"
171
188
replicas: 2
172
189
env:
173
190
- name: JAVA_OPTIONS
174
191
value: "-Dweblogic.StdoutDebugEnabled=false"
175
192
- name: USER_MEM_ARGS
176
193
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
178
195
# replicas: 1
179
196
storage:
180
197
predefined:
181
198
claim: domain1-weblogic-sample-pvc
182
-
183
199
```
184
200
185
-
### Verify the domain resource
201
+
### Verify the domain
186
202
187
-
To confirm that the domain resource was created, use this command:
203
+
To confirm that the domain was created, use this command:
188
204
189
205
```
190
206
kubectl describe domain DOMAINUID -n NAMESPACE
@@ -198,92 +214,102 @@ Here is an example of the output of this command:
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.
0 commit comments