Skip to content

Commit d093770

Browse files
authored
Merge pull request #794 from oracle/create-domain-doc
Document how to manually create a domain CR
2 parents 8ef6231 + bef11b1 commit d093770

File tree

3 files changed

+143
-1
lines changed

3 files changed

+143
-1
lines changed
Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
# Manually creating the domain
2+
3+
In some circumstances you may wish to manually create your domain custom resource. If you have created your own
4+
Docker image containing your domain and the specific patches that you require, then this approach will probably
5+
be most suitable for your needs.
6+
7+
To create the domain custom resource, just make a copy of the sample [domain.yaml](./domain.yaml), and then edit
8+
it as per the instructions provided in the comments in that file.
9+
When it is ready, you can create the domain in your Kubernetes cluster using the command:
10+
11+
```
12+
$ kubectl apply -f domain.yaml
13+
```
14+
15+
You can verify the domain custom resource was created using this command:
16+
17+
```
18+
$ kubectl -n YOUR_NAMESPACE get domains
19+
```
20+
21+
You can view details of the domain using this command:
22+
23+
```
24+
$ kubectl -n YOUR_NAMESPACE describe domain YOUR_DOMAIN
25+
```
26+
27+
In both of these commands, replace `YOUR_NAMESPACE` with the namespace that you created the domain in, and
28+
replace `YOUR_DOMAIN` with the `domainUID` you chose.
29+
30+
Lines changed: 106 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,106 @@
1+
# Copyright 2017, 2019, Oracle Corporation and/or its affiliates. All rights reserved.
2+
3+
# Licensed under the Universal Permissive License v 1.0 as shown at http://oss.oracle.com/licenses/upl.
4+
#
5+
# This is an example of how to define a Domain resource. Please read through the comments which explain
6+
# what updates are needed.
7+
#
8+
apiVersion: "weblogic.oracle/v2"
9+
kind: Domain
10+
metadata:
11+
# Update this with the `domainUID` of your domain:
12+
name: domain1
13+
# Update this with the namespace your domain will run in:
14+
namespace: weblogic
15+
labels:
16+
weblogic.resourceVersion: domain-v2
17+
# Update this with the `domainUID` of your domain:
18+
weblogic.domainUID: domain1
19+
20+
spec:
21+
# This parameter provides the location of the WebLogic Domain Home (from the container's point of view).
22+
# Note that this might be in the image itself or in a mounted volume or network storage.
23+
domainHome: /u01/oracle/user_projects/domains/domain1
24+
25+
# If the domain home is inside the Docker image, set this to `true`, otherwise set `false`:
26+
domainHomeInImage: true
27+
28+
# Update this with the name of the Docker image that will be used to run your domain:
29+
image: "my-domain1-image:1.0"
30+
31+
# imagePullPolicy defaults to "Always" if image version is :latest
32+
imagePullPolicy: "IfNotPresent"
33+
34+
# If credentials are needed to pull the image, uncomment this section and identify which
35+
# Secret contains the credentials for pulling an image:
36+
#imagePullSecrets:
37+
#- name:
38+
39+
# Identify which Secret contains the WebLogic Admin credentials (note that there is an example of
40+
# how to create that Secret at the end of this file)
41+
webLogicCredentialsSecret:
42+
# Update this with the name of the secret containing your WebLogic server boot credentials:
43+
name: domain1-weblogic-credentials
44+
45+
# If you want to include the server out file into the pod's stdout, set this to `true`:
46+
includeServerOutInPodLog: true
47+
48+
# If you want to use a mounted volume as the log home, i.e. to persist logs outside the container, then
49+
# uncomment this and set it to `true`:
50+
# logHomeEnabled: false
51+
# The in-pod name of the directory to store the domain, node manager, server logs, and server .out
52+
# files in.
53+
# If not specified or empty, domain log file, server logs, server out, and node manager log files
54+
# will be stored in the default logHome location of /shared/logs/<domainUID>/.
55+
# logHome: /shared/logs/domain1
56+
57+
# serverStartPolicy legal values are "NEVER", "IF_NEEDED", or "ADMIN_ONLY"
58+
# This determines which WebLogic Servers the Operator will start up when it discovers this Domain
59+
# - "NEVER" will not start any server in the domain
60+
# - "ADMIN_ONLY" will start up only the administration server (no managed servers will be started)
61+
# - "IF_NEEDED" will start all non-clustered servers, including the administration server and clustered servers up to the replica count
62+
serverStartPolicy: "IF_NEEDED"
63+
64+
serverPod:
65+
# an (optional) list of environment variable to be set on the servers
66+
env:
67+
- name: JAVA_OPTIONS
68+
value: "-Dweblogic.StdoutDebugEnabled=false"
69+
- name: USER_MEM_ARGS
70+
value: "-Xms64m -Xmx256m "
71+
72+
# If you are storing your domain on a persistent volume (as opposed to inside the Docker image),
73+
# then uncomment this section and provide the PVC details and mount path here (standard images
74+
# from Oracle assume the mount path is `/shared`):
75+
# volumes:
76+
# - name: weblogic-domain-storage-volume
77+
# persistentVolumeClaim:
78+
# claimName: domain1-weblogic-sample-pvc
79+
# volumeMounts:
80+
# - mountPath: /shared
81+
# name: weblogic-domain-storage-volume
82+
83+
# adminServer is used to configure the desired behavior for starting the administration server.
84+
adminServer:
85+
# serverStartState legal values are "RUNNING" or "ADMIN"
86+
# "RUNNING" means the listed server will be started up to "RUNNING" mode
87+
# "ADMIN" means the listed server will be start up to "ADMIN" mode
88+
serverStartState: "RUNNING"
89+
adminService:
90+
channels:
91+
# Update this to set the NodePort to use for the Admin Server's default channel (where the
92+
# admin console will be available):
93+
- channelName: default
94+
nodePort: 30701
95+
# Uncomment to export the T3Channel as a service
96+
#- channelName: T3Channel
97+
98+
# clusters is used to configure the desired behavior for starting member servers of a cluster.
99+
# If you use this entry, then the rules will be applied to ALL servers that are members of the named clusters.
100+
clusters:
101+
- clusterName: cluster-1
102+
serverStartState: "RUNNING"
103+
replicas: 2
104+
105+
# The number of managed servers to start for any unlisted clusters
106+
# replicas: 1

site/domains.md

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -102,7 +102,13 @@ Please consult My Oracle Support Doc ID 2349228.1 for up-to-date information abo
102102

103103
### Creating and managing WebLogic domains
104104

105-
In this version of the operator, a WebLogic domain can be located either in a persistent volume (PV) or in a Docker image. For examples of each, see the [WebLogic operator samples](../kubernetes/samples/README.md).
105+
In this version of the operator, a WebLogic domain can be located either in a persistent volume (PV) or in a Docker image.
106+
For examples of each, see the [WebLogic operator samples](../kubernetes/samples/README.md).
107+
108+
If you wish to create your own Docker images, for example to choose a specific set of patches, or to create a domain
109+
with a specific configuration and/or applications deployed, then you can create the domain custom resource
110+
manually to deploy your domain. This process is documented in [this
111+
sample](../kubernetes/samples/scripts/create-weblogic-domain/manually-create-domain/README.md).
106112

107113
### Modifying domain configurations
108114

0 commit comments

Comments
 (0)