From 572a1cd21900821bd26e79ca2b342d34e361700b Mon Sep 17 00:00:00 2001 From: Mark Nelson Date: Mon, 14 Jan 2019 09:20:50 -0500 Subject: [PATCH 1/3] wip --- .../manually-create-domain/README.md | 31 +++++++ .../manually-create-domain/domain.yaml | 80 +++++++++++++++++++ site/domains.md | 8 +- 3 files changed, 118 insertions(+), 1 deletion(-) create mode 100644 kubernetes/samples/scripts/create-weblogic-domain/manually-create-domain/README.md create mode 100644 kubernetes/samples/scripts/create-weblogic-domain/manually-create-domain/domain.yaml diff --git a/kubernetes/samples/scripts/create-weblogic-domain/manually-create-domain/README.md b/kubernetes/samples/scripts/create-weblogic-domain/manually-create-domain/README.md new file mode 100644 index 00000000000..7a5984e54dc --- /dev/null +++ b/kubernetes/samples/scripts/create-weblogic-domain/manually-create-domain/README.md @@ -0,0 +1,31 @@ +# Manually creating the domain + +In some circumstances you may wish to manually create your domain custom resource. If you have created your own +Docker image containing your domain and the specific patches that you require, then this approach will probably +be most suitable for your needs. + +To create the domain custom resource, just make a copy of the sample [domain.yaml](./domain.yaml) provided in +this sample, and then edit it as per the instructions below. When it is ready, you can create the domain in your +Kubernetes cluster using the command: + +``` +kubectl apply -f domain.yaml +``` + +You can verify the domain custom resource was created using this command: + +``` +kubectl -n YOUR_NAMESPACE get domains +``` + +You can view details of the domain using this command: + +``` +kubectl -n YOUR_NAMESPACE describe domain YOUR_DOMAIN +``` + +In both of these commands, replace `YOUR_NAMESPACE` with the namespace that you created the domain in, and +replace `YOUR_DOMAIN` with the `domainUID` you chose. + +## Details of the domain custom resource YAML file + diff --git a/kubernetes/samples/scripts/create-weblogic-domain/manually-create-domain/domain.yaml b/kubernetes/samples/scripts/create-weblogic-domain/manually-create-domain/domain.yaml new file mode 100644 index 00000000000..a443b423e89 --- /dev/null +++ b/kubernetes/samples/scripts/create-weblogic-domain/manually-create-domain/domain.yaml @@ -0,0 +1,80 @@ +# Copyright 2017, 2019, Oracle Corporation and/or its affiliates. All rights reserved. + +# Licensed under the Universal Permissive License v 1.0 as shown at http://oss.oracle.com/licenses/upl. +# +# This is an example of how to define a Domain resource. +# +apiVersion: "weblogic.oracle/v2" +kind: Domain +metadata: + name: domain1 + namespace: weblogic + labels: + weblogic.resourceVersion: domain-v2 + weblogic.domainUID: domain1 +spec: + # The WebLogic Domain Home + domainHome: /u01/oracle/user_projects/domains/domain1 + # If the domain home is in the image + domainHomeInImage: true + # The Docker image name + image: "my-domain1-image:1.0" + # imagePullPolicy defaults to "Always" if image version is :latest + imagePullPolicy: "IfNotPresent" + # Identify which Secret contains the credentials for pulling an image + #imagePullSecrets: + #- name: + # Identify which Secret contains the WebLogic Admin credentials (note that there is an example of + # how to create that Secret at the end of this file) + webLogicCredentialsSecret: + name: domain1-weblogic-credentials + # Whether to include the server out file into the pod's stdout, default is true + includeServerOutInPodLog: true + # Whether to enable log home + # logHomeEnabled: false + # The in-pod name of the directory to store the domain, node manager, server logs, and server .out + # files in. + # If not specified or empty, domain log file, server logs, server out, and node manager log files + # will be stored in the default logHome location of /shared/logs//. + # logHome: /shared/logs/domain1 + # serverStartPolicy legal values are "NEVER", "IF_NEEDED", or "ADMIN_ONLY" + # This determines which WebLogic Servers the Operator will start up when it discovers this Domain + # - "NEVER" will not start any server in the domain + # - "ADMIN_ONLY" will start up only the administration server (no managed servers will be started) + # - "IF_NEEDED" will start all non-clustered servers, including the administration server and clustered servers up to the replica count + serverStartPolicy: "IF_NEEDED" + serverPod: + # an (optional) list of environment variable to be set on the servers + env: + - name: JAVA_OPTIONS + value: "-Dweblogic.StdoutDebugEnabled=false" + - name: USER_MEM_ARGS + value: "-Xms64m -Xmx256m " + # volumes: + # - name: weblogic-domain-storage-volume + # persistentVolumeClaim: + # claimName: domain1-weblogic-sample-pvc + # volumeMounts: + # - mountPath: /shared + # name: weblogic-domain-storage-volume + # adminServer is used to configure the desired behavior for starting the administration server. + adminServer: + # serverStartState legal values are "RUNNING" or "ADMIN" + # "RUNNING" means the listed server will be started up to "RUNNING" mode + # "ADMIN" means the listed server will be start up to "ADMIN" mode + serverStartState: "RUNNING" + adminService: + channels: + # The Admin Server's NodePort + - channelName: default + nodePort: 30701 + # Uncomment to export the T3Channel as a service + - channelName: T3Channel + # clusters is used to configure the desired behavior for starting member servers of a cluster. + # If you use this entry, then the rules will be applied to ALL servers that are members of the named clusters. + clusters: + - clusterName: cluster-1 + serverStartState: "RUNNING" + replicas: 2 + # The number of managed servers to start for unlisted clusters + # replicas: 1 \ No newline at end of file diff --git a/site/domains.md b/site/domains.md index 456468971b9..9afb7a12066 100644 --- a/site/domains.md +++ b/site/domains.md @@ -100,7 +100,13 @@ Please consult My Oracle Support Doc ID 2349228.1 for up-to-date information abo ### Creating and managing WebLogic domains -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). +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). + +If you wish to create your own Docker images, for example to choose a specific set of patches, or to create a domain +with a specific configuration and/or applications deployed, then you can create the domain custom resource +manually to deploy your domain. This process is documented in [this +sample](../kubernetes/samples/scripts/create-weblogic-domain/manually-create-domain/README.md). ### Modifying domain configurations From b294502d3715be669bd2f4899eeac50ee3c9b947 Mon Sep 17 00:00:00 2001 From: Mark Nelson Date: Tue, 15 Jan 2019 12:28:47 -0500 Subject: [PATCH 2/3] finish doc updates for manually creating a domain cr --- .../manually-create-domain/README.md | 5 +- .../manually-create-domain/domain.yaml | 48 ++++++++++++++----- 2 files changed, 39 insertions(+), 14 deletions(-) diff --git a/kubernetes/samples/scripts/create-weblogic-domain/manually-create-domain/README.md b/kubernetes/samples/scripts/create-weblogic-domain/manually-create-domain/README.md index 7a5984e54dc..a75c6fafa17 100644 --- a/kubernetes/samples/scripts/create-weblogic-domain/manually-create-domain/README.md +++ b/kubernetes/samples/scripts/create-weblogic-domain/manually-create-domain/README.md @@ -5,8 +5,8 @@ Docker image containing your domain and the specific patches that you require, t be most suitable for your needs. To create the domain custom resource, just make a copy of the sample [domain.yaml](./domain.yaml) provided in -this sample, and then edit it as per the instructions below. When it is ready, you can create the domain in your -Kubernetes cluster using the command: +this sample, and then edit it as per the instructions provided in the comments in that file. +When it is ready, you can create the domain in your Kubernetes cluster using the command: ``` kubectl apply -f domain.yaml @@ -27,5 +27,4 @@ kubectl -n YOUR_NAMESPACE describe domain YOUR_DOMAIN In both of these commands, replace `YOUR_NAMESPACE` with the namespace that you created the domain in, and replace `YOUR_DOMAIN` with the `domainUID` you chose. -## Details of the domain custom resource YAML file diff --git a/kubernetes/samples/scripts/create-weblogic-domain/manually-create-domain/domain.yaml b/kubernetes/samples/scripts/create-weblogic-domain/manually-create-domain/domain.yaml index a443b423e89..198c1b6174f 100644 --- a/kubernetes/samples/scripts/create-weblogic-domain/manually-create-domain/domain.yaml +++ b/kubernetes/samples/scripts/create-weblogic-domain/manually-create-domain/domain.yaml @@ -2,47 +2,65 @@ # Licensed under the Universal Permissive License v 1.0 as shown at http://oss.oracle.com/licenses/upl. # -# This is an example of how to define a Domain resource. +# This is an example of how to define a Domain resource. Please read through the comments which explain +# what updates are needed. # apiVersion: "weblogic.oracle/v2" kind: Domain metadata: + # Update this with the `domainUID` of your domain: name: domain1 + # Update this with the namespace your domain will run in: namespace: weblogic labels: weblogic.resourceVersion: domain-v2 + # Update this with the `domainUID` of your domain: weblogic.domainUID: domain1 + spec: - # The WebLogic Domain Home + # This parameter provides the location of the WebLogic Domain Home (from the container's point of view). + # Note that this might be in the image itself or in a mounted volume or network storage. domainHome: /u01/oracle/user_projects/domains/domain1 - # If the domain home is in the image + + # If the domain home is inside the Docker image, set this to `true`, otherwise set `false`: domainHomeInImage: true - # The Docker image name + + # Update this with the name of the Docker image that will be used to run your domain: image: "my-domain1-image:1.0" + # imagePullPolicy defaults to "Always" if image version is :latest imagePullPolicy: "IfNotPresent" - # Identify which Secret contains the credentials for pulling an image + + # If credentials are needed to pull the image, uncomment this section and identify which + # Secret contains the credentials for pulling an image: #imagePullSecrets: #- name: + # Identify which Secret contains the WebLogic Admin credentials (note that there is an example of # how to create that Secret at the end of this file) webLogicCredentialsSecret: + # Update this with the name of the secret containing your WebLogic server boot credentials: name: domain1-weblogic-credentials - # Whether to include the server out file into the pod's stdout, default is true + + # If you want to include the server out file into the pod's stdout, set this to `true`: includeServerOutInPodLog: true - # Whether to enable log home + + # If you want to use a mounted volume as the log home, i.e. to persist logs outside the container, then + # uncomment this and set it to `true`: # logHomeEnabled: false # The in-pod name of the directory to store the domain, node manager, server logs, and server .out # files in. # If not specified or empty, domain log file, server logs, server out, and node manager log files # will be stored in the default logHome location of /shared/logs//. # logHome: /shared/logs/domain1 + # serverStartPolicy legal values are "NEVER", "IF_NEEDED", or "ADMIN_ONLY" # This determines which WebLogic Servers the Operator will start up when it discovers this Domain # - "NEVER" will not start any server in the domain # - "ADMIN_ONLY" will start up only the administration server (no managed servers will be started) # - "IF_NEEDED" will start all non-clustered servers, including the administration server and clustered servers up to the replica count serverStartPolicy: "IF_NEEDED" + serverPod: # an (optional) list of environment variable to be set on the servers env: @@ -50,6 +68,10 @@ spec: value: "-Dweblogic.StdoutDebugEnabled=false" - name: USER_MEM_ARGS value: "-Xms64m -Xmx256m " + + # If you are storing your domain on a persistent volume (as opposed to inside the Docker image), + # then uncomment this section and provide the PVC details and mount path here (standard images + # from Oracle assume the mount path is `/shared`): # volumes: # - name: weblogic-domain-storage-volume # persistentVolumeClaim: @@ -57,6 +79,7 @@ spec: # volumeMounts: # - mountPath: /shared # name: weblogic-domain-storage-volume + # adminServer is used to configure the desired behavior for starting the administration server. adminServer: # serverStartState legal values are "RUNNING" or "ADMIN" @@ -65,16 +88,19 @@ spec: serverStartState: "RUNNING" adminService: channels: - # The Admin Server's NodePort + # Update this to set the NodePort to use for the Admin Server's default channel (where the + # admin console will be available): - channelName: default nodePort: 30701 - # Uncomment to export the T3Channel as a service - - channelName: T3Channel + # Uncomment to export the T3Channel as a service + #- channelName: T3Channel + # clusters is used to configure the desired behavior for starting member servers of a cluster. # If you use this entry, then the rules will be applied to ALL servers that are members of the named clusters. clusters: - clusterName: cluster-1 serverStartState: "RUNNING" replicas: 2 - # The number of managed servers to start for unlisted clusters + + # The number of managed servers to start for any unlisted clusters # replicas: 1 \ No newline at end of file From bef11b15ab679ba983bf0eb7d3c2b1243bd1251e Mon Sep 17 00:00:00 2001 From: Ryan Eberhard Date: Wed, 16 Jan 2019 17:00:43 -0500 Subject: [PATCH 3/3] Update README.md --- .../manually-create-domain/README.md | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/kubernetes/samples/scripts/create-weblogic-domain/manually-create-domain/README.md b/kubernetes/samples/scripts/create-weblogic-domain/manually-create-domain/README.md index a75c6fafa17..aacade60c77 100644 --- a/kubernetes/samples/scripts/create-weblogic-domain/manually-create-domain/README.md +++ b/kubernetes/samples/scripts/create-weblogic-domain/manually-create-domain/README.md @@ -4,24 +4,24 @@ In some circumstances you may wish to manually create your domain custom resourc Docker image containing your domain and the specific patches that you require, then this approach will probably be most suitable for your needs. -To create the domain custom resource, just make a copy of the sample [domain.yaml](./domain.yaml) provided in -this sample, and then edit it as per the instructions provided in the comments in that file. +To create the domain custom resource, just make a copy of the sample [domain.yaml](./domain.yaml), and then edit +it as per the instructions provided in the comments in that file. When it is ready, you can create the domain in your Kubernetes cluster using the command: ``` -kubectl apply -f domain.yaml +$ kubectl apply -f domain.yaml ``` You can verify the domain custom resource was created using this command: ``` -kubectl -n YOUR_NAMESPACE get domains +$ kubectl -n YOUR_NAMESPACE get domains ``` You can view details of the domain using this command: ``` -kubectl -n YOUR_NAMESPACE describe domain YOUR_DOMAIN +$ kubectl -n YOUR_NAMESPACE describe domain YOUR_DOMAIN ``` In both of these commands, replace `YOUR_NAMESPACE` with the namespace that you created the domain in, and