@@ -96,11 +96,12 @@ function initAndValidateOutputDir {
9696 ${domainOutputDir} \
9797 ${valuesInputFile} \
9898 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 \
101103 create-weblogic-domain-job.yaml \
102- domain-custom-resource.yaml \
103- traefik.yaml
104+ domain-custom-resource.yaml
104105}
105106
106107#
@@ -290,12 +291,12 @@ function initialize {
290291 fi
291292 fi
292293
293- domainPVInput=" ${scriptDir} /weblogic-domain-persistent-volume -template.yaml"
294+ domainPVInput=" ${scriptDir} /weblogic-domain-pv -template.yaml"
294295 if [ ! -f ${domainPVInput} ]; then
295296 validationError " The template file ${domainPVInput} for generating a persistent volume was not found"
296297 fi
297298
298- domainPVCInput=" ${scriptDir} /weblogic-domain-persistent-volume-claim -template.yaml"
299+ domainPVCInput=" ${scriptDir} /weblogic-domain-pvc -template.yaml"
299300 if [ ! -f ${domainPVCInput} ]; then
300301 validationError " The template file ${domainPVCInput} for generating a persistent volume claim was not found"
301302 fi
@@ -310,12 +311,12 @@ function initialize {
310311 validationError " The template file ${dcrInput} for creating the domain custom resource was not found"
311312 fi
312313
313- traefikSecurityInput=" ${scriptDir} /traefik-security-template.yaml"
314+ traefikSecurityInput=" ${scriptDir} /weblogic-domain- traefik-security-template.yaml"
314315 if [ ! -f ${traefikSecurityInput} ]; then
315316 validationError " The file ${traefikSecurityInput} for generating the traefik RBAC was not found"
316317 fi
317318
318- traefikInput=" ${scriptDir} /traefik-template.yaml"
319+ traefikInput=" ${scriptDir} /weblogic-domain- traefik-template.yaml"
319320 if [ ! -f ${traefikInput} ]; then
320321 validationError " The template file ${traefikInput} for generating the traefik deployment was not found"
321322 fi
@@ -381,12 +382,12 @@ function createYamlFiles {
381382 # (if needed) and copy the inputs file there.
382383 copyInputsFileToOutputDirectory ${valuesInputFile} " ${domainOutputDir} /create-weblogic-domain-inputs.yaml"
383384
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"
386387 jobOutput=" ${domainOutputDir} /create-weblogic-domain-job.yaml"
387388 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"
390391
391392 enabledPrefix=" " # uncomment the feature
392393 disabledPrefix=" # " # comment out the feature
@@ -405,6 +406,7 @@ function createYamlFiles {
405406 fi
406407
407408 sed -i -e " s:%DOMAIN_UID%:${domainUID} :g" ${domainPVOutput}
409+ sed -i -e " s:%DOMAIN_NAME%:${domainName} :g" ${domainPVOutput}
408410 sed -i -e " s:%NAMESPACE%:$namespace :g" ${domainPVOutput}
409411 sed -i -e " s:%WEBLOGIC_DOMAIN_STORAGE_PATH%:${weblogicDomainStoragePath} :g" ${domainPVOutput}
410412 sed -i -e " s:%WEBLOGIC_DOMAIN_STORAGE_RECLAIM_POLICY%:${weblogicDomainStorageReclaimPolicy} :g" ${domainPVOutput}
@@ -418,6 +420,7 @@ function createYamlFiles {
418420 cp ${domainPVCInput} ${domainPVCOutput}
419421 sed -i -e " s:%NAMESPACE%:$namespace :g" ${domainPVCOutput}
420422 sed -i -e " s:%DOMAIN_UID%:${domainUID} :g" ${domainPVCOutput}
423+ sed -i -e " s:%DOMAIN_NAME%:${domainName} :g" ${domainPVCOutput}
421424 sed -i -e " s:%WEBLOGIC_DOMAIN_STORAGE_SIZE%:${weblogicDomainStorageSize} :g" ${domainPVCOutput}
422425
423426 # Generate the yaml to create the kubernetes job that will create the weblogic domain
@@ -475,8 +478,9 @@ function createYamlFiles {
475478 echo Generating ${traefikOutput}
476479 sed -i -e " s:%NAMESPACE%:$namespace :g" ${traefikOutput}
477480 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}
479482 sed -i -e " s:%CLUSTER_NAME%:${clusterName} :g" ${traefikOutput}
483+ sed -i -e " s:%CLUSTER_NAME_LC%:${clusterNameLC} :g" ${traefikOutput}
480484 sed -i -e " s:%LOAD_BALANCER_WEB_PORT%:$loadBalancerWebPort :g" ${traefikOutput}
481485 sed -i -e " s:%LOAD_BALANCER_DASHBOARD_PORT%:$loadBalancerDashboardPort :g" ${traefikOutput}
482486
@@ -485,6 +489,8 @@ function createYamlFiles {
485489 echo Generating ${traefikSecurityOutput}
486490 sed -i -e " s:%NAMESPACE%:$namespace :g" ${traefikSecurityOutput}
487491 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}
488494 sed -i -e " s:%CLUSTER_NAME_LC%:${clusterNameLC} :g" ${traefikSecurityOutput}
489495
490496 # Remove any "...yaml-e" files left over from running sed
@@ -527,7 +533,7 @@ function createDomainPVC {
527533function createDomain {
528534
529535 # 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"
531537 deleteK8sObj job $JOB_NAME ${jobOutput}
532538
533539 echo Creating the domain by creating the job ${jobOutput}
@@ -540,8 +546,8 @@ function createDomain {
540546 while [ " $JOB_STATUS " != " Completed" -a $count -lt $max ] ; do
541547 sleep 30
542548 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; } ' `
545551 echo " status on iteration $count of $max "
546552 echo " $JOB_INFO "
547553
@@ -559,7 +565,7 @@ function createDomain {
559565 done
560566
561567 # 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; } ' `
563569 if [ " $JOB_STATUS " != " Completed" ]; then
564570 echo The create domain job is not showing status completed after waiting 300 seconds
565571 echo Check the log output for errors
0 commit comments