@@ -96,11 +96,12 @@ function initAndValidateOutputDir {
96
96
${domainOutputDir} \
97
97
${valuesInputFile} \
98
98
create-weblogic-domain-inputs.yaml \
99
- weblogic-domain-persistent-volume.yaml \
100
- weblogic-domain-persistent-volume-claim.yaml \
99
+ weblogic-domain-pv.yaml \
100
+ weblogic-domain-pvc.yaml \
101
+ weblogic-domain-traefik-${clusterNameLC} .yaml \
102
+ weblogic-domain-traefik-security-${clusterNameLC} .yaml \
101
103
create-weblogic-domain-job.yaml \
102
- domain-custom-resource.yaml \
103
- traefik.yaml
104
+ domain-custom-resource.yaml
104
105
}
105
106
106
107
#
@@ -290,12 +291,12 @@ function initialize {
290
291
fi
291
292
fi
292
293
293
- domainPVInput=" ${scriptDir} /weblogic-domain-persistent-volume -template.yaml"
294
+ domainPVInput=" ${scriptDir} /weblogic-domain-pv -template.yaml"
294
295
if [ ! -f ${domainPVInput} ]; then
295
296
validationError " The template file ${domainPVInput} for generating a persistent volume was not found"
296
297
fi
297
298
298
- domainPVCInput=" ${scriptDir} /weblogic-domain-persistent-volume-claim -template.yaml"
299
+ domainPVCInput=" ${scriptDir} /weblogic-domain-pvc -template.yaml"
299
300
if [ ! -f ${domainPVCInput} ]; then
300
301
validationError " The template file ${domainPVCInput} for generating a persistent volume claim was not found"
301
302
fi
@@ -310,12 +311,12 @@ function initialize {
310
311
validationError " The template file ${dcrInput} for creating the domain custom resource was not found"
311
312
fi
312
313
313
- traefikSecurityInput=" ${scriptDir} /traefik-security-template.yaml"
314
+ traefikSecurityInput=" ${scriptDir} /weblogic-domain- traefik-security-template.yaml"
314
315
if [ ! -f ${traefikSecurityInput} ]; then
315
316
validationError " The file ${traefikSecurityInput} for generating the traefik RBAC was not found"
316
317
fi
317
318
318
- traefikInput=" ${scriptDir} /traefik-template.yaml"
319
+ traefikInput=" ${scriptDir} /weblogic-domain- traefik-template.yaml"
319
320
if [ ! -f ${traefikInput} ]; then
320
321
validationError " The template file ${traefikInput} for generating the traefik deployment was not found"
321
322
fi
@@ -381,12 +382,12 @@ function createYamlFiles {
381
382
# (if needed) and copy the inputs file there.
382
383
copyInputsFileToOutputDirectory ${valuesInputFile} " ${domainOutputDir} /create-weblogic-domain-inputs.yaml"
383
384
384
- domainPVOutput=" ${domainOutputDir} /weblogic-domain-persistent-volume .yaml"
385
- domainPVCOutput=" ${domainOutputDir} /weblogic-domain-persistent-volume-claim .yaml"
385
+ domainPVOutput=" ${domainOutputDir} /weblogic-domain-pv .yaml"
386
+ domainPVCOutput=" ${domainOutputDir} /weblogic-domain-pvc .yaml"
386
387
jobOutput=" ${domainOutputDir} /create-weblogic-domain-job.yaml"
387
388
dcrOutput=" ${domainOutputDir} /domain-custom-resource.yaml"
388
- traefikSecurityOutput=" ${domainOutputDir} /traefik-security.yaml"
389
- traefikOutput=" ${domainOutputDir} /traefik.yaml"
389
+ traefikSecurityOutput=" ${domainOutputDir} /weblogic-domain- traefik-security- ${clusterNameLC} .yaml"
390
+ traefikOutput=" ${domainOutputDir} /weblogic-domain- traefik- ${clusterNameLC} .yaml"
390
391
391
392
enabledPrefix=" " # uncomment the feature
392
393
disabledPrefix=" # " # comment out the feature
@@ -405,6 +406,7 @@ function createYamlFiles {
405
406
fi
406
407
407
408
sed -i -e " s:%DOMAIN_UID%:${domainUID} :g" ${domainPVOutput}
409
+ sed -i -e " s:%DOMAIN_NAME%:${domainName} :g" ${domainPVOutput}
408
410
sed -i -e " s:%NAMESPACE%:$namespace :g" ${domainPVOutput}
409
411
sed -i -e " s:%WEBLOGIC_DOMAIN_STORAGE_PATH%:${weblogicDomainStoragePath} :g" ${domainPVOutput}
410
412
sed -i -e " s:%WEBLOGIC_DOMAIN_STORAGE_RECLAIM_POLICY%:${weblogicDomainStorageReclaimPolicy} :g" ${domainPVOutput}
@@ -418,6 +420,7 @@ function createYamlFiles {
418
420
cp ${domainPVCInput} ${domainPVCOutput}
419
421
sed -i -e " s:%NAMESPACE%:$namespace :g" ${domainPVCOutput}
420
422
sed -i -e " s:%DOMAIN_UID%:${domainUID} :g" ${domainPVCOutput}
423
+ sed -i -e " s:%DOMAIN_NAME%:${domainName} :g" ${domainPVCOutput}
421
424
sed -i -e " s:%WEBLOGIC_DOMAIN_STORAGE_SIZE%:${weblogicDomainStorageSize} :g" ${domainPVCOutput}
422
425
423
426
# Generate the yaml to create the kubernetes job that will create the weblogic domain
@@ -475,8 +478,9 @@ function createYamlFiles {
475
478
echo Generating ${traefikOutput}
476
479
sed -i -e " s:%NAMESPACE%:$namespace :g" ${traefikOutput}
477
480
sed -i -e " s:%DOMAIN_UID%:${domainUID} :g" ${traefikOutput}
478
- sed -i -e " s:%CLUSTER_NAME_LC %:${clusterNameLC } :g" ${traefikOutput}
481
+ sed -i -e " s:%DOMAIN_NAME %:${domainName } :g" ${traefikOutput}
479
482
sed -i -e " s:%CLUSTER_NAME%:${clusterName} :g" ${traefikOutput}
483
+ sed -i -e " s:%CLUSTER_NAME_LC%:${clusterNameLC} :g" ${traefikOutput}
480
484
sed -i -e " s:%LOAD_BALANCER_WEB_PORT%:$loadBalancerWebPort :g" ${traefikOutput}
481
485
sed -i -e " s:%LOAD_BALANCER_DASHBOARD_PORT%:$loadBalancerDashboardPort :g" ${traefikOutput}
482
486
@@ -485,6 +489,8 @@ function createYamlFiles {
485
489
echo Generating ${traefikSecurityOutput}
486
490
sed -i -e " s:%NAMESPACE%:$namespace :g" ${traefikSecurityOutput}
487
491
sed -i -e " s:%DOMAIN_UID%:${domainUID} :g" ${traefikSecurityOutput}
492
+ sed -i -e " s:%DOMAIN_NAME%:${domainName} :g" ${traefikSecurityOutput}
493
+ sed -i -e " s:%CLUSTER_NAME%:${clusterName} :g" ${traefikSecurityOutput}
488
494
sed -i -e " s:%CLUSTER_NAME_LC%:${clusterNameLC} :g" ${traefikSecurityOutput}
489
495
490
496
# Remove any "...yaml-e" files left over from running sed
@@ -527,7 +533,7 @@ function createDomainPVC {
527
533
function createDomain {
528
534
529
535
# There is no way to re-run a kubernetes job, so first delete any prior job
530
- JOB_NAME=" domain- ${domainUID} -job"
536
+ JOB_NAME=" ${domainUID} -create-weblogic-domain -job"
531
537
deleteK8sObj job $JOB_NAME ${jobOutput}
532
538
533
539
echo Creating the domain by creating the job ${jobOutput}
@@ -540,8 +546,8 @@ function createDomain {
540
546
while [ " $JOB_STATUS " != " Completed" -a $count -lt $max ] ; do
541
547
sleep 30
542
548
count=` expr $count + 1`
543
- JOB_STATUS=` kubectl get pods --show-all -n ${namespace} | grep " domain- ${domainUID} " | awk ' { print $3; } ' `
544
- JOB_INFO=` kubectl get pods --show-all -n ${namespace} | grep " domain- ${domainUID} " | awk ' { print "pod", $1, "status is", $3; } ' `
549
+ JOB_STATUS=` kubectl get pods --show-all -n ${namespace} | grep ${JOB_NAME} | awk ' { print $3; } ' `
550
+ JOB_INFO=` kubectl get pods --show-all -n ${namespace} | grep ${JOB_NAME} | awk ' { print "pod", $1, "status is", $3; } ' `
545
551
echo " status on iteration $count of $max "
546
552
echo " $JOB_INFO "
547
553
@@ -559,7 +565,7 @@ function createDomain {
559
565
done
560
566
561
567
# Confirm the job pod is status completed
562
- JOB_POD=` kubectl get pods --show-all -n ${namespace} | grep " domain- ${domainUID} " | awk ' { print $1; } ' `
568
+ JOB_POD=` kubectl get pods --show-all -n ${namespace} | grep ${JOB_NAME} | awk ' { print $1; } ' `
563
569
if [ " $JOB_STATUS " != " Completed" ]; then
564
570
echo The create domain job is not showing status completed after waiting 300 seconds
565
571
echo Check the log output for errors
0 commit comments