Skip to content

Commit d537b1c

Browse files
committed
Merge branch 'master' into better-status
2 parents 688d37c + ebbfc62 commit d537b1c

27 files changed

+1006
-909
lines changed

docs/apidocs/oracle/kubernetes/operator/watcher/Watching.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -173,7 +173,7 @@ <h3>Method Summary</h3>
173173
</tr>
174174
</table>
175175
<ul class="blockList">
176-
<li class="blockList"><a name="methods.inherited.from.class.oracle.kubernetes.operator.watcher.WatchingEventDestination">
176+
<li class="blockList"><a name="methods.inherited.from.class.oracle.kubernetes.operator.watcher.WatchListener">
177177
<!-- -->
178178
</a>
179179
<h3>Methods inherited from interface&nbsp;oracle.kubernetes.operator.watcher.<a href="../../../../oracle/kubernetes/operator/watcher/WatchingEventDestination.html" title="interface in oracle.kubernetes.operator.watcher">WatchingEventDestination</a></h3>

docs/apidocs/oracle/kubernetes/operator/watcher/class-use/WatchingEventDestination.html

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
<html lang="en">
44
<head>
55
<!-- Generated by javadoc (9.0.4) on Wed Mar 07 11:29:56 EST 2018 -->
6-
<title>Uses of Interface oracle.kubernetes.operator.watcher.WatchingEventDestination (weblogic-kubernetes-operator 0.1.0 API)</title>
6+
<title>Uses of Interface oracle.kubernetes.operator.watcher.WatchListener (weblogic-kubernetes-operator 0.1.0 API)</title>
77
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
88
<meta name="date" content="2018-03-07">
99
<link rel="stylesheet" type="text/css" href="../../../../../stylesheet.css" title="Style">
@@ -21,13 +21,12 @@
2121
<script type="text/javascript"><!--
2222
try {
2323
if (location.href.indexOf('is-external=true') == -1) {
24-
parent.document.title="Uses of Interface oracle.kubernetes.operator.watcher.WatchingEventDestination (weblogic-kubernetes-operator 0.1.0 API)";
24+
parent.document.title="Uses of Interface oracle.kubernetes.operator.watcher.WatchListener (weblogic-kubernetes-operator 0.1.0 API)";
2525
}
2626
}
2727
catch(err) {
2828
}
29-
//-->
30-
var pathtoroot = "../../../../../";loadScripts(document, 'script');</script>
29+
//--></script>
3130
<noscript>
3231
<div>JavaScript is disabled on your browser.</div>
3332
</noscript>
@@ -95,7 +94,7 @@
9594
//-->
9695
</script>
9796
<div class="header">
98-
<h2 title="Uses of Interface oracle.kubernetes.operator.watcher.WatchingEventDestination" class="title">Uses of Interface<br>oracle.kubernetes.operator.watcher.WatchingEventDestination</h2>
97+
<h2 title="Uses of Interface oracle.kubernetes.operator.watcher.WatchListener" class="title">Uses of Interface<br>oracle.kubernetes.operator.watcher.WatchingEventDestination</h2>
9998
</div>
10099
<div class="classUseContainer">
101100
<ul class="blockList">

kubernetes/create-domain-job-inputs.yaml

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,13 @@ managedServerNameBase: managed-server
3636
# Port number for each managed server
3737
managedServerPort: 8001
3838

39+
# Persistent volume type, the value must be hostPath or nfs.
40+
# If using nfs, nfsServer must be specified.
41+
persistenceType: hostPath
42+
43+
# NFS server name or ip
44+
nfsServer: nfsServer
45+
3946
# Physical path of the persistent volume storage
4047
persistencePath: /scratch/k8s_dir/persistentVolume001
4148

kubernetes/create-domain-job.sh

Lines changed: 24 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,7 @@ function validatePersistentVolumeClaimName {
8686
#
8787
# Function to validate the persistent volume name
8888
#
89-
function validatePersistenVolumeName {
89+
function validatePersistentVolumeName {
9090
validateLowerCase ${persistenceVolumeName} "persistenceVolumeName"
9191

9292
if [[ ${persistenceVolumeName} != ${domainUid}-* ]] ; then
@@ -96,6 +96,17 @@ function validatePersistenVolumeName {
9696
fi
9797
}
9898

99+
#
100+
# Function to validate the persistence type
101+
#
102+
function validatePersistenceType {
103+
if [ ${persistenceType} == "nfs" ] ; then
104+
validateInputParamsSpecified nfsServer
105+
elif [ ${persistenceType} != "hostPath" ] ; then
106+
validationError "The persistenceType ${persistenceType} is invalid, it must be hostPath or nfs"
107+
fi
108+
}
109+
99110
#
100111
# Function to validate the secret name
101112
#
@@ -262,7 +273,8 @@ function initialize {
262273
validateDomainUid
263274
validateClusterName
264275
validateStorageClass
265-
validatePersistenVolumeName
276+
validatePersistenceType
277+
validatePersistentVolumeName
266278
validatePersistentVolumeClaimName
267279
validateSecretName
268280
validateImagePullSecretName
@@ -283,12 +295,22 @@ function createYamlFiles {
283295
echo Generating ${pvOutput}
284296

285297
cp ${pvInput} ${pvOutput}
298+
if [ "${persistenceType}" == "nfs" ]; then
299+
hostPathPrefix="${disabledPrefix}"
300+
nfsPrefix="${enabledPrefix}"
301+
sed -i -e "s:%NFS_SERVER%:${nfsServer}:g" ${pvOutput}
302+
else
303+
hostPathPrefix="${enabledPrefix}"
304+
nfsPrefix="${disabledPrefix}"
305+
fi
286306
sed -i -e "s:%DOMAIN_UID%:${domainUid}:g" ${pvOutput}
287307
sed -i -e "s:%NAMESPACE%:$namespace:g" ${pvOutput}
288308
sed -i -e "s:%PERSISTENT_VOLUME%:${persistenceVolumeName}:g" ${pvOutput}
289309
sed -i -e "s:%PERSISTENT_VOLUME_PATH%:${persistencePath}:g" ${pvOutput}
290310
sed -i -e "s:%PERSISTENT_VOLUME_SIZE%:${persistenceSize}:g" ${pvOutput}
291311
sed -i -e "s:%STORAGE_CLASS_NAME%:${persistenceStorageClass}:g" ${pvOutput}
312+
sed -i -e "s:%HOST_PATH_PREFIX%:${hostPathPrefix}:g" ${pvOutput}
313+
sed -i -e "s:%NFS_PREFIX%:${nfsPrefix}:g" ${pvOutput}
292314

293315
# Generate the yaml to create the persistent volume claim
294316
echo Generating ${pvcOutput}

kubernetes/internal/domain-job-template.yaml

Lines changed: 53 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -153,12 +153,14 @@ data:
153153
# Function to create script for starting a server
154154
# $1 - Domain UID
155155
# $2 - Server Name
156+
# $3 - Flag (only passed for admin server)
156157
function createStartScript() {
157158
158159
nmdir=${DOMAIN_HOME}/servers/$2/nodemgr_home
159160
stateFile=${DOMAIN_HOME}/servers/$2/data/nodemanager/$2.state
160161
scriptFile=${nmdir}/startServer.sh
161162
pyFile=${nmdir}/start-server.py
163+
argsFile=${nmdir}/set-ms-args.py
162164
163165
# Create a script that starts the node manager, then uses wlst to connect
164166
# to the nodemanager and start the server.
@@ -180,7 +182,14 @@ data:
180182
echo "Finished waiting for the nodemanager to start"
181183
182184
echo "Update JVM arguments"
183-
echo "Arguments=\${USER_MEM_ARGS} -XX\:+UnlockExperimentalVMOptions -XX\:+UseCGroupMemoryLimitForHeap \${JAVA_OPTIONS}" >> ${startProp}
185+
if [ $# -eq 3 ]
186+
then
187+
echo "Update JVM arguments for admin server"
188+
echo "Arguments=\${USER_MEM_ARGS} -XX\:+UnlockExperimentalVMOptions -XX\:+UseCGroupMemoryLimitForHeap \${JAVA_OPTIONS}" >> ${startProp}
189+
else
190+
echo "Update JVM arguments for managed server"
191+
wlst.sh ${argsFile} $1 $2 ${startProp}
192+
fi
184193
185194
echo "Start the server"
186195
wlst.sh -skipWLSModuleScanning ${pyFile}
@@ -208,6 +217,48 @@ data:
208217
209218
checkFileExists ${pyFile}
210219
220+
# Create a python script to set JVM arguments for managed server.
221+
# The script and 'EOF' on the following lines must not be indented!
222+
cat << EOF > ${argsFile}
223+
224+
import os
225+
import sys
226+
EOF
227+
228+
cat /u01/weblogic/read-domain-secret.py >> ${argsFile}
229+
cat << EOF >> ${argsFile}
230+
231+
mem_args=os.environ['USER_MEM_ARGS']
232+
java_opt=os.environ['JAVA_OPTIONS']
233+
admin_server=os.environ['ADMIN_NAME']
234+
admin_port=os.environ['ADMIN_PORT']
235+
236+
domain_UID=sys.argv[1]
237+
server_name=sys.argv[2]
238+
startup_file=sys.argv[3]
239+
240+
adminUrl='t3://' + domain_UID + '-' + admin_server + ':' + admin_port
241+
dirStr='Servers/managed-server1/ServerStart/' + server_name
242+
243+
# Connect to admin server to get startup arguments of this server
244+
connect(admin_username, admin_password, adminUrl)
245+
cd(dirStr)
246+
args=get('Arguments')
247+
disconnect()
248+
249+
f = open(startup_file, 'a')
250+
s=str("Arguments="+ mem_args + " -XX\:+UnlockExperimentalVMOptions -XX\:+UseCGroupMemoryLimitForHeap " + java_opt )
251+
if not (args is None):
252+
s=str(s + " " + args + "\n")
253+
else:
254+
s=str(s + "\n")
255+
256+
f.write(s)
257+
f.close()
258+
EOF
259+
260+
checkFileExists ${argsFile}
261+
211262
}
212263
213264
# Function to create script for stopping a server
@@ -274,7 +325,7 @@ data:
274325
275326
# Setup admin server
276327
createNodeMgrHome %DOMAIN_UID% %ADMIN_SERVER_NAME%
277-
createStartScript %DOMAIN_UID% %ADMIN_SERVER_NAME%
328+
createStartScript %DOMAIN_UID% %ADMIN_SERVER_NAME% 'admin'
278329
createStopScript %DOMAIN_UID% %ADMIN_SERVER_NAME%
279330
280331
# Create the managed servers

kubernetes/internal/persistent-volume-template.yaml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,5 +14,7 @@ spec:
1414
accessModes:
1515
- ReadWriteMany
1616
persistentVolumeReclaimPolicy: Retain
17-
hostPath:
17+
%HOST_PATH_PREFIX%hostPath:
18+
%NFS_PREFIX%nfs:
19+
%NFS_PREFIX%server: %NFS_SERVER%
1820
path: "%PERSISTENT_VOLUME_PATH%"

pom.xml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -140,7 +140,9 @@
140140
<artifactId>maven-compiler-plugin</artifactId>
141141
<version>3.7.0</version>
142142
<configuration>
143-
<!-- none yet -->
143+
<compilerArgs>
144+
<arg>-Xpkginfo:always</arg>
145+
</compilerArgs>
144146
</configuration>
145147
</plugin>
146148

site/creating-domain.md

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -102,30 +102,31 @@ The following parameters must be provided in the input file:
102102
| createDomainScript | Script used to create the domain. This parameter should not be modified. | /u01/weblogic/create-domain-script.sh |
103103
| domainName | Name of the WebLogic domain to create. | base_domain |
104104
| domainUid | Unique ID that will be used to identify this particular domain. This ID must be unique across all domains in a Kubernetes cluster. | domain1 |
105+
| enableLoadBalancerAdminPort | Determines whether the load balancer administration port should be exposed outside the Kubernetes cluster. | false |
106+
| imagePullSecretName | Name of the Kubernetes secret for the Docker Store, used to pull the WebLogic Server image. | docker-store-secret |
107+
| loadBalancerAdminPort | The node port for the load balancer to accept admin requests. | 30315 |
108+
| loadBalancerWebPort | The node port for the load balancer to accept user traffic. | 30305 |
105109
| managedServerCount | Number of Managed Server instances to generate for the domain. | 2 |
106110
| managedServerNameBase | Base string used to generate Managed Server names. | managed-server |
107111
| managedServerPort | Port number for each Managed Server. | 8001 |
112+
| namespace | The Kubernetes namespace to create the domain in. | default |
113+
| nfsServer | NFS server name or IP. | |
108114
| persistencePath | Physical path of the persistent volume storage. | /scratch/k8s_dir/persistentVolume001 |
109115
| persistenceSize | Total storage allocated by the persistent volume. | 10Gi |
110116
| persistenceStorageClass | Name of the storage class to set for the persistent volume and persistent volume claim. | weblogic |
117+
| persistenceType | Persistent volume type. The parameter value must be hostPath or nfs. If set to 'nfs', nfsServer must be specified. | hostPath |
111118
| persistenceVolumeClaimName | Name of the Kubernetes persistent volume claim for this domain. | pv001-claim |
112119
| persistenceVolumeName | Name of the Kubernetes persistent volume for this domain. | pv001 |
113-
| replaceExistingDomain | If set to 'true' the script will remove any data it finds in the persistent volume before creating the new domain. Use with caution. | false |
114120
| productionModeEnabled | Boolean indicating if production mode is enabled for the domain. | true |
115-
| secretsMountPath | Path for mounting secrets. This parameter should not be modified. | /var/run/secrets-domain1 |
116121
| secretName | Name of the Kubernetes secret for the Administration Server's username and password. | domain1-weblogic-credentials |
117-
| imagePullSecretName | Name of the Kubernetes secret for the Docker Store, used to pull the WebLogic Server image. | docker-store-secret |
122+
| secretsMountPath | Path for mounting secrets. This parameter should not be modified. | /var/run/secrets-domain1 |
123+
| startupControl | Determines which WebLogic servers will be started up. Legal values are 'NONE', 'ALL', 'ADMIN', 'SPECIFIED', or 'AUTO' | AUTO |
118124
| T3ChannelPort | Port for the T3Channel of the NetworkAccessPoint. | 7002 |
119-
| namespace | The Kubernetes namespace to create the domain in. | default |
120-
| loadBalancerAdminPort | The node port for the load balancer to accept admin requests. | 30315 |
121-
| loadBalancerWebPort | The node port for the load balancer to accept user traffic. | 30305 |
122-
| enableLoadBalancerAdminPort | Determines whether the load balancer administration port should be exposed outside the Kubernetes cluster. | false |
123125

124126
## Limitations of the create domain script
125127

126128
This technology preview release has some limitations in the create domain script that users should be aware of.
127129

128-
* The script assumes the use of the `HostPath` persistent volume provider.
129130
* The script creates the specified number of Managed Servers and places them all in one cluster.
130131
* The script always creates one cluster.
131132

src/integration-tests/bash/run.sh

Lines changed: 38 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -890,6 +890,24 @@ function get_cluster_replicas {
890890
echo $replicas
891891
}
892892

893+
function get_startup_control {
894+
if [ "$#" != 1 ] ; then
895+
fail "requires 1 parameter: domainkey"
896+
fi
897+
898+
local NAMESPACE="`dom_get $1 NAMESPACE`"
899+
local DOMAIN_UID="`dom_get $1 DOMAIN_UID`"
900+
901+
local startup_control_cmd="kubectl get domain $DOMAIN_UID -n $NAMESPACE -o jsonpath='{.spec.startupControl}'"
902+
local startup_control=`eval $startup_control_cmd`
903+
904+
if [ -z ${startup_control} ]; then
905+
fail "startupControl not found in domain $DOMAIN_UID"
906+
fi
907+
908+
echo $startup_control
909+
}
910+
893911
function verify_managed_servers_ready {
894912
if [ "$#" != 1 ] ; then
895913
fail "requires 1 parameter: domainkey"
@@ -1893,7 +1911,6 @@ function verify_domain_created {
18931911

18941912
local NAMESPACE="`dom_get $1 NAMESPACE`"
18951913
local DOMAIN_UID="`dom_get $1 DOMAIN_UID`"
1896-
local STARTUP_CONTROL="`dom_get $1 STARTUP_CONTROL`"
18971914
local MS_BASE_NAME="`dom_get $1 MS_BASE_NAME`"
18981915

18991916
trace "verify domain $DOMAIN_UID in $NAMESPACE namespace"
@@ -1913,8 +1930,10 @@ function verify_domain_created {
19131930
trace "verify the service and pod of admin server"
19141931
verify_service_and_pod_created $DOM_KEY 0
19151932

1933+
local startup_control=`get_startup_control $DOM_KEY`
1934+
19161935
local verify_as_only=false
1917-
if [ "$STARTUP_CONTROL" = "ADMIN" ] ; then
1936+
if [ "${startup_control}" = "ADMIN" ] ; then
19181937
verify_as_only=true
19191938
fi
19201939

@@ -2223,6 +2242,22 @@ function test_operator_lifecycle {
22232242
declare_test_pass
22242243
}
22252244

2245+
function test_create_domain_startup_control_admin {
2246+
declare_new_test 1 "$@"
2247+
2248+
if [ "$#" != 1 ] ; then
2249+
fail "requires 1 parameters: domainKey"
2250+
fi
2251+
2252+
local DOM_KEY=${1}
2253+
local DOMAIN_UID="`dom_get $1 DOMAIN_UID`"
2254+
2255+
run_create_domain_job $DOMAIN_UID
2256+
verify_domain_created $DOMAIN_UID
2257+
2258+
declare_test_pass
2259+
}
2260+
22262261
# scale domain $1 up and down, and optionally verify the scaling had no effect on domain $2
22272262
function test_cluster_scale {
22282263
declare_new_test 1 "$@"
@@ -2559,8 +2594,7 @@ function test_suite {
25592594
test_domain_lifecycle domain1 domain4
25602595

25612596
# create another domain in the default namespace with startupControl="ADMIN", and verify that only admin server is created
2562-
run_create_domain_job domain5
2563-
verify_domain_created domain5
2597+
test_create_domain_startup_control_admin domain5
25642598

25652599
# test managed server 1 pod auto-restart
25662600
test_wls_liveness_probe domain1

0 commit comments

Comments
 (0)