Skip to content

Commit c43f4ab

Browse files
fix domain on pv with wdt sample (#2306)
* fix domain on pv with wdt sample * Removing some debug statements * Remove some debug statements Co-authored-by: [email protected] <[email protected]>
1 parent f7b1ee5 commit c43f4ab

File tree

9 files changed

+30
-26
lines changed

9 files changed

+30
-26
lines changed

kubernetes/samples/scripts/common/utility.sh

Lines changed: 3 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -38,8 +38,6 @@ function checkInputFiles {
3838
valuesInputFile=${temp[1]}
3939
valuesInputFile1=${temp[0]}
4040
fi
41-
else
42-
echo "Found only 1 input file"
4341
fi
4442
}
4543

@@ -128,6 +126,7 @@ function parseCommonInputs {
128126
# We exclude javaOptions from the exportValuesFile
129127
grep -v "javaOptions" ${exportValuesFile} > ${tmpFile}
130128
source ${tmpFile}
129+
131130
rm ${exportValuesFile} ${tmpFile}
132131
}
133132

@@ -448,6 +447,7 @@ function createFiles {
448447
# we're in the domain in PV case
449448

450449
wdtVersion="${WDT_VERSION:-${wdtVersion}}"
450+
httpsProxy="${https_proxy}"
451451

452452
createJobOutput="${domainOutputDir}/create-domain-job.yaml"
453453
deleteJobOutput="${domainOutputDir}/delete-domain-job.yaml"
@@ -515,6 +515,7 @@ function createFiles {
515515
sed -i -e "s:%ISTIO_ENABLED%:${istioEnabled}:g" ${createJobOutput}
516516
sed -i -e "s:%ISTIO_READINESS_PORT%:${istioReadinessPort}:g" ${createJobOutput}
517517
sed -i -e "s:%WDT_VERSION%:${wdtVersion}:g" ${createJobOutput}
518+
sed -i -e "s|%PROXY_VAL%|${httpsProxy}|g" ${createJobOutput}
518519

519520
# Generate the yaml to create the kubernetes job that will delete the weblogic domain_home folder
520521
echo Generating ${deleteJobOutput}
@@ -533,8 +534,6 @@ function createFiles {
533534
sed -i -e "s:%DOMAIN_ROOT_DIR%:${domainPVMountPath}:g" ${deleteJobOutput}
534535
fi
535536

536-
echo Printing domainHomeSourceType
537-
echo domainHomeSourceType is ${domainHomeSourceType}
538537
if [ "${domainHomeSourceType}" == "FromModel" ]; then
539538
echo domainHomeSourceType is FromModel
540539
# leave domainHomeSourceType to FromModel
@@ -545,25 +544,20 @@ function createFiles {
545544
fi
546545
elif [ "${domainHomeInImage}" == "true" ]; then
547546
domainHomeSourceType="Image"
548-
echo domainHomeSourceType is Image
549547
if [ "${logHomeOnPV}" == "true" ]; then
550548
logHomeOnPVPrefix="${enabledPrefix}"
551549
else
552550
logHomeOnPVPrefix="${disabledPrefix}"
553551
fi
554552
else
555553
domainHomeSourceType="PersistentVolume"
556-
echo domainHomeSourceType is PV
557554
logHomeOnPVPrefix="${enabledPrefix}"
558555
logHomeOnPV=true
559556
fi
560557

561558
# Generate the yaml file for creating the domain resource
562559
# We want to use wdt's extractDomainResource.sh to get the domain resource
563560
# for domain on pv use case. For others, generate domain resource here
564-
echo domainHomeSourceType is ${domainHomeSourceType}
565-
echo wdtDomainType is ${wdtDomainType}
566-
echo useWdt is ${useWdt}
567561

568562
if [ "${domainHomeSourceType}" != "PersistentVolume" ] || [ "${wdtDomainType}" != "WLS" ] ||
569563
[ "${useWdt}" != true ]; then

kubernetes/samples/scripts/common/validate.sh

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -358,7 +358,6 @@ function validateDomainFilesDir {
358358
if [ -z "${createDomainFilesDir}" ] || [ "${createDomainFilesDir}" == "wlst" ]; then
359359
useWdt=false
360360
fi
361-
echo useWdt is ${useWdt}
362361
}
363362

364363
#

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

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -85,6 +85,8 @@ spec:
8585
value: "%ISTIO_READINESS_PORT%"
8686
- name: WDT_VERSION
8787
value: %WDT_VERSION%
88+
- name: PROXY_VAL
89+
value: "%PROXY_VAL%"
8890
volumes:
8991
- name: create-weblogic-sample-domain-job-cm-volume
9092
configMap:

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

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -213,11 +213,9 @@ function createDomainHome {
213213
sleep 30
214214
max=30
215215
count=0
216-
kubectl exec $POD_NAME -c create-weblogic-sample-domain-job -n ${namespace} -- bash -c "ls -l ${domainPVMountPath}/wdt"
217216
kubectl exec $POD_NAME -c create-weblogic-sample-domain-job -n ${namespace} -- bash -c "ls -l ${domainPVMountPath}/wdt" | grep "domaincreate.yaml"
218217
while [ $? -eq 1 -a $count -lt $max ]; do
219218
sleep 5
220-
kubectl exec $POD_NAME -c create-weblogic-sample-domain-job -n ${namespace} -- bash -c "ls -l ${domainPVMountPath}/wdt"
221219
count=`expr $count + 1`
222220
kubectl exec $POD_NAME -c create-weblogic-sample-domain-job -n ${namespace} -- bash -c "ls -l ${domainPVMountPath}/wdt" | grep "domaincreate.yaml"
223221
done
@@ -303,4 +301,4 @@ function printSummary {
303301
}
304302

305303
# Perform the sequence of steps to create a domain
306-
createDomain false
304+
createDomain false

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

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -86,6 +86,8 @@ spec:
8686
value: "%ISTIO_READINESS_PORT%"
8787
- name: WDT_VERSION
8888
value: %WDT_VERSION%
89+
- name: PROXY_VAL
90+
value: "%PROXY_VAL%"
8991
volumes:
9092
- name: update-weblogic-sample-domain-job-cm-volume
9193
configMap:

kubernetes/samples/scripts/create-weblogic-domain/domain-home-on-pv/update-domain.sh

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -207,11 +207,9 @@ function updateDomainHome {
207207
sleep 30
208208
max=30
209209
count=0
210-
kubectl exec $POD_NAME -c update-weblogic-sample-domain-job -n ${namespace} -- bash -c "ls -l ${domainPVMountPath}/wdt"
211210
kubectl exec $POD_NAME -c update-weblogic-sample-domain-job -n ${namespace} -- bash -c "ls -l ${domainPVMountPath}/wdt" | grep "domainupdate.yaml"
212211
while [ $? -eq 1 -a $count -lt $max ]; do
213212
sleep 5
214-
#kubectl exec $POD_NAME -c update-weblogic-sample-domain-job -n ${namespace} -- bash -c "ls -l ${domainPVMountPath}/wdt"
215213
count=`expr $count + 1`
216214
kubectl exec $POD_NAME -c update-weblogic-sample-domain-job -n ${namespace} -- bash -c "ls -l ${domainPVMountPath}/wdt" | grep "domainupdate.yaml"
217215
done
@@ -296,4 +294,4 @@ function printSummary {
296294
}
297295

298296
# Perform the sequence of steps to create a domain
299-
updateDomain
297+
updateDomain

kubernetes/samples/scripts/create-weblogic-domain/domain-home-on-pv/wdt/create-domain-script.sh

Lines changed: 12 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,7 @@ WDT_INSTALL_ZIP_URL=${WDT_INSTALL_ZIP_URL:-"https://github.com/oracle/weblogic-d
8181

8282

8383
# using "-" instead of ":-" in case proxy vars are explicitly set to "".
84-
https_proxy=${https_proxy-""}
84+
https_proxy=${PROXY_VAL-""}
8585
https_proxy2=${https_proxy2-""}
8686

8787
# Define functions
@@ -106,16 +106,16 @@ function install_wdt {
106106
sleep 10
107107
count=`expr $count + 1`
108108
for proxy in "${https_proxy}" "${https_proxy2}"; do
109-
echo @@ "Info: Downloading $WDT_INSTALL_ZIP_URL with https_proxy=\"$proxy\""
110-
https_proxy="${proxy}" \
111-
curl --silent --show-error --connect-timeout 10 -O -L $WDT_INSTALL_ZIP_URL
112-
curl_res=$?
113-
[ $curl_res -eq 0 ] && break
114-
done
109+
echo @@ "Info: Downloading $WDT_INSTALL_ZIP_URL with https_proxy=\"$proxy\""
110+
https_proxy="${proxy}" \
111+
curl --silent --show-error --connect-timeout 10 -O -L $WDT_INSTALL_ZIP_URL
112+
curl_res=$?
113+
[ $curl_res -eq 0 ] && break
114+
done
115115
done
116116
if [ $curl_res -ne 0 ] || [ ! -f $WDT_INSTALL_ZIP_FILE ]; then
117117
cd $save_dir
118-
echo @@ "Error: Download failed or $WDT_INSTALL_ZIP_FILE not found."
118+
echo @@ "Error: Download failed or $WDT_INSTALL_ZIP_FILE not found. Check if https_proxy is set in your environment"
119119
return 1
120120
fi
121121

@@ -280,12 +280,15 @@ fi
280280
action=$1
281281

282282
echo @@ "Info: action is $action"
283+
echo @@ "Info: https_proxy is $https_proxy"
283284

284285
if [ "$action" = "create" ]; then
285286
setup_wdt_shared_dir || exit 1
286287
fi
287288

288-
install_wdt || exit 1
289+
if [ "${action}" = "create" ]; then
290+
install_wdt || exit 1
291+
fi
289292

290293
if [ "${action}" = "update" ]; then
291294
run_wdt "update"|| exit 1

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ topology:
1010
'@@PROP:clusterName@@':
1111
DynamicServers:
1212
CalculatedListenPorts: false
13-
DynamicClusterSize: '@@PROP:initialManagedServerReplicas@@'
13+
DynamicClusterSize: '@@PROP:configuredManagedServerCount@@'
1414
MaxDynamicClusterSize: '@@PROP:configuredManagedServerCount@@'
1515
ServerNamePrefix: '@@PROP:managedServerNameBase@@'
1616
ServerTemplate: '@@PROP:clusterName@@-template'

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

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,7 @@ kubernetes:
5353
# data storage directories are determined from the WebLogic domain home configuration.
5454
dataHome: "%DATA_HOME%"
5555

56+
replicas: 2
5657
# serverStartPolicy legal values are "NEVER", "IF_NEEDED", or "ADMIN_ONLY"
5758
# This determines which WebLogic Servers the Operator will start up when it discovers this Domain
5859
# - "NEVER" will not start any server in the domain
@@ -90,6 +91,13 @@ kubernetes:
9091
# Uncomment to export the T3Channel as a service
9192
%EXPOSE_T3_CHANNEL_PREFIX% T3Channel:
9293

94+
# clusters is used to configure the desired behavior for starting member servers of a cluster.
95+
# If you use this entry, then the rules will be applied to ALL servers that are members of the named clusters.
96+
clusters:
97+
'@@PROP:clusterName@@':
98+
serverStartState: "RUNNING"
99+
replicas: %INITIAL_MANAGED_SERVER_REPLICAS%
100+
93101
# Istio service mesh support is experimental.
94102
%ISTIO_PREFIX%configuration:
95103
%ISTIO_PREFIX% istio:

0 commit comments

Comments
 (0)