@@ -370,10 +370,20 @@ function initialize {
370
370
if [ ! -f ${apacheInput} ]; then
371
371
validationError " The template file ${apacheInput} for generating the apache-webtier deployment was not found"
372
372
fi
373
-
374
- voyagerInput=" ${scriptDir} /voyager-ingress-template.yaml"
375
- if [ ! -f ${voyagerInput} ]; then
376
- validationError " The template file ${voyagerInput} for generating the Voyager Ingress was not found"
373
+
374
+ voyagerOperatorInput=" ${scriptDir} /voyager-operator.yaml"
375
+ if [ ! -f ${voyagerOperatorInput} ]; then
376
+ validationError " The file ${voyagerOperatorInput} for Voyager Operator was not found"
377
+ fi
378
+
379
+ voyagerSecurityInput=" ${scriptDir} /voyager-operator-security.yaml"
380
+ if [ ! -f ${voyagerSecurityInput} ]; then
381
+ validationError " The file ${voyagerSecurityInput} for generating the Voyager RBAC was not found"
382
+ fi
383
+
384
+ voyagerIngressInput=" ${scriptDir} /weblogic-domain-voyager-ingress-template.yaml"
385
+ if [ ! -f ${voyagerIngressInput} ]; then
386
+ validationError " The template file ${voyagerIngressInput} for generating the Voyager Ingress was not found"
377
387
fi
378
388
379
389
failIfValidationErrors
@@ -449,19 +459,13 @@ function createYamlFiles {
449
459
traefikOutput=" ${domainOutputDir} /weblogic-domain-traefik-${clusterNameLC} .yaml"
450
460
apacheOutput=" ${domainOutputDir} /weblogic-domain-apache.yaml"
451
461
apacheSecurityOutput=" ${domainOutputDir} /weblogic-domain-apache-security.yaml"
452
- voyagerOutput=" ${domainOutputDir} /voyager-ingress.yaml"
462
+ voyagerSecurityOutput=" ${domainOutputDir} /voyager-operator-security.yaml"
463
+ voyagerOperatorOutput=" ${domainOutputDir} /voyager-operator.yaml"
464
+ voyagerIngressOutput=" ${domainOutputDir} /weblogic-domain-voyager-ingress.yaml"
453
465
454
466
enabledPrefix=" " # uncomment the feature
455
467
disabledPrefix=" # " # comment out the feature
456
468
457
- # For backward compatability, default to "store/oracle/weblogic:12.2.1.3" if not defined in
458
- # create-weblogic-domain-inputs.yaml
459
- if [ -z " ${weblogicImage} " ]; then
460
- weblogicImage=" store/oracle/weblogic:12.2.1.3"
461
- fi
462
- # Must escape the ':' value in weblogicImage for sed to properly parse and replace
463
- weblogicImage=$( echo ${weblogicImage} | sed -e " s/\:/\\ \:/g" )
464
-
465
469
# Generate the yaml to create the persistent volume
466
470
echo Generating ${domainPVOutput}
467
471
@@ -499,7 +503,6 @@ function createYamlFiles {
499
503
cp ${createJobInput} ${createJobOutput}
500
504
sed -i -e " s:%NAMESPACE%:$namespace :g" ${createJobOutput}
501
505
sed -i -e " s:%WEBLOGIC_CREDENTIALS_SECRET_NAME%:${weblogicCredentialsSecretName} :g" ${createJobOutput}
502
- sed -i -e " s:%WEBLOGIC_IMAGE%:${weblogicImage} :g" ${createJobOutput}
503
506
sed -i -e " s:%WEBLOGIC_IMAGE_PULL_SECRET_NAME%:${weblogicImagePullSecretName} :g" ${createJobOutput}
504
507
sed -i -e " s:%WEBLOGIC_IMAGE_PULL_SECRET_PREFIX%:${weblogicImagePullSecretPrefix} :g" ${createJobOutput}
505
508
sed -i -e " s:%DOMAIN_UID%:${domainUID} :g" ${createJobOutput}
@@ -520,7 +523,6 @@ function createYamlFiles {
520
523
521
524
cp ${deleteJobInput} ${deleteJobOutput}
522
525
sed -i -e " s:%NAMESPACE%:$namespace :g" ${deleteJobOutput}
523
- sed -i -e " s:%WEBLOGIC_IMAGE%:${weblogicImage} :g" ${deleteJobOutput}
524
526
sed -i -e " s:%WEBLOGIC_CREDENTIALS_SECRET_NAME%:${weblogicCredentialsSecretName} :g" ${deleteJobOutput}
525
527
sed -i -e " s:%WEBLOGIC_IMAGE_PULL_SECRET_NAME%:${weblogicImagePullSecretName} :g" ${deleteJobOutput}
526
528
sed -i -e " s:%WEBLOGIC_IMAGE_PULL_SECRET_PREFIX%:${weblogicImagePullSecretPrefix} :g" ${deleteJobOutput}
@@ -548,7 +550,6 @@ function createYamlFiles {
548
550
sed -i -e " s:%DOMAIN_UID%:${domainUID} :g" ${dcrOutput}
549
551
sed -i -e " s:%DOMAIN_NAME%:${domainName} :g" ${dcrOutput}
550
552
sed -i -e " s:%ADMIN_SERVER_NAME%:${adminServerName} :g" ${dcrOutput}
551
- sed -i -e " s:%WEBLOGIC_IMAGE%:${weblogicImage} :g" ${dcrOutput}
552
553
sed -i -e " s:%ADMIN_PORT%:${adminPort} :g" ${dcrOutput}
553
554
sed -i -e " s:%INITIAL_MANAGED_SERVER_REPLICAS%:${initialManagedServerReplicas} :g" ${dcrOutput}
554
555
sed -i -e " s:%EXPOSE_T3_CHANNEL_PREFIX%:${exposeAdminT3ChannelPrefix} :g" ${dcrOutput}
@@ -583,24 +584,7 @@ function createYamlFiles {
583
584
if [ " ${loadBalancer} " = " APACHE" ]; then
584
585
# Apache file
585
586
cp ${apacheInput} ${apacheOutput}
586
-
587
587
echo Generating ${apacheOutput}
588
-
589
- if [ " ${loadBalancerExposeAdminPort} " = " true" ]; then
590
- enableLoadBalancerExposeAdminPortPrefix=" ${enabledPrefix} "
591
- else
592
- enableLoadBalancerExposeAdminPortPrefix=" ${disabledPrefix} "
593
- fi
594
-
595
- if [ ! -z " ${loadBalancerVolumePath} " ]; then
596
- enableLoadBalancerVolumePathPrefix=" ${enabledPrefix} "
597
- sed -i -e " s:%LOAD_BALANCER_VOLUME_PATH%:${loadBalancerVolumePath} :g" ${apacheOutput}
598
- else
599
- enableLoadBalancerVolumePathPrefix=" ${disabledPrefix} "
600
- fi
601
-
602
- sed -i -e " s:%ENABLE_LOAD_BALANCER_EXPOSE_ADMIN_PORT%:${enableLoadBalancerExposeAdminPortPrefix} :g" ${apacheOutput}
603
- sed -i -e " s:%ENABLE_LOAD_BALANCER_VOLUME_PATH%:${enableLoadBalancerVolumePathPrefix} :g" ${apacheOutput}
604
588
sed -i -e " s:%NAMESPACE%:$namespace :g" ${apacheOutput}
605
589
sed -i -e " s:%DOMAIN_UID%:${domainUID} :g" ${apacheOutput}
606
590
sed -i -e " s:%DOMAIN_NAME%:${domainName} :g" ${apacheOutput}
@@ -610,6 +594,17 @@ function createYamlFiles {
610
594
sed -i -e " s:%MANAGED_SERVER_PORT%:${managedServerPort} :g" ${apacheOutput}
611
595
sed -i -e " s:%LOAD_BALANCER_WEB_PORT%:$loadBalancerWebPort :g" ${apacheOutput}
612
596
sed -i -e " s:%WEB_APP_PREPATH%:$loadBalancerAppPrepath :g" ${apacheOutput}
597
+
598
+ if [ ! -z " ${loadBalancerVolumePath} " ]; then
599
+ sed -i -e " s:%LOAD_BALANCER_VOLUME_PATH%:${loadBalancerVolumePath} :g" ${apacheOutput}
600
+ sed -i -e " s:# volumes:volumes:g" ${apacheOutput}
601
+ sed -i -e " s:# - name:- name:g" ${apacheOutput}
602
+ sed -i -e " s:# hostPath: hostPath:g" ${apacheOutput}
603
+ sed -i -e " s:# path: path:g" ${apacheOutput}
604
+ sed -i -e " s:# volumeMounts:volumeMounts:g" ${apacheOutput}
605
+ sed -i -e " s:# - name:- name:g" ${apacheOutput}
606
+ sed -i -e " s:# mountPath: mountPath:g" ${apacheOutput}
607
+ fi
613
608
614
609
# Apache security file
615
610
cp ${apacheSecurityInput} ${apacheSecurityOutput}
@@ -620,17 +615,21 @@ function createYamlFiles {
620
615
fi
621
616
622
617
if [ " ${loadBalancer} " = " VOYAGER" ]; then
618
+ # Voyager Operator Security yaml file
619
+ cp ${voyagerSecurityInput} ${voyagerSecurityOutput}
620
+ # Voyager Operator yaml file
621
+ cp ${voyagerOperatorInput} ${voyagerOperatorOutput}
623
622
# Voyager Ingress file
624
- cp ${voyagerInput } ${voyagerOutput }
625
- echo Generating ${voyagerOutput }
626
- sed -i -e " s:%NAMESPACE%:$namespace :g" ${voyagerOutput }
627
- sed -i -e " s:%DOMAIN_UID%:${domainUID} :g" ${voyagerOutput }
628
- sed -i -e " s:%DOMAIN_NAME%:${domainName} :g" ${voyagerOutput }
629
- sed -i -e " s:%CLUSTER_NAME%:${clusterName} :g" ${voyagerOutput }
630
- sed -i -e " s:%CLUSTER_NAME_LC%:${clusterNameLC} :g" ${voyagerOutput }
631
- sed -i -e " s:%MANAGED_SERVER_PORT%:${managedServerPort} :g" ${voyagerOutput }
632
- sed -i -e " s:%LOAD_BALANCER_WEB_PORT%:$loadBalancerWebPort :g" ${voyagerOutput }
633
- sed -i -e " s:%LOAD_BALANCER_DASHBOARD_PORT%:$loadBalancerDashboardPort :g" ${voyagerOutput }
623
+ cp ${voyagerIngressInput } ${voyagerIngressOutput }
624
+ echo Generating ${voyagerIngressOutput }
625
+ sed -i -e " s:%NAMESPACE%:$namespace :g" ${voyagerIngressOutput }
626
+ sed -i -e " s:%DOMAIN_UID%:${domainUID} :g" ${voyagerIngressOutput }
627
+ sed -i -e " s:%DOMAIN_NAME%:${domainName} :g" ${voyagerIngressOutput }
628
+ sed -i -e " s:%CLUSTER_NAME%:${clusterName} :g" ${voyagerIngressOutput }
629
+ sed -i -e " s:%CLUSTER_NAME_LC%:${clusterNameLC} :g" ${voyagerIngressOutput }
630
+ sed -i -e " s:%MANAGED_SERVER_PORT%:${managedServerPort} :g" ${voyagerIngressOutput }
631
+ sed -i -e " s:%LOAD_BALANCER_WEB_PORT%:$loadBalancerWebPort :g" ${voyagerIngressOutput }
632
+ sed -i -e " s:%LOAD_BALANCER_DASHBOARD_PORT%:$loadBalancerDashboardPort :g" ${voyagerIngressOutput }
634
633
fi
635
634
636
635
# Remove any "...yaml-e" files left over from running sed
@@ -728,79 +727,8 @@ function createDomain {
728
727
# Deploy Voyager/HAProxy load balancer
729
728
#
730
729
function setupVoyagerLoadBalancer {
731
- # only deploy Voyager Ingress Controller the first time
732
- local vpod=` kubectl get pod -n voyager | grep voyager | wc -l`
733
- if [ " $vpod " == " 0" ]; then
734
- kubectl create namespace voyager
735
- curl -fsSL https://raw.githubusercontent.com/appscode/voyager/6.0.0/hack/deploy/voyager.sh \
736
- | bash -s -- --provider=baremetal --namespace=voyager
737
- fi
738
-
739
- echo Checking voyager controller pod is ready
740
- local maxwaitsecs=30
741
- local mstart=` date +%s`
742
- while : ; do
743
- local mnow=` date +%s`
744
- local ready=` kubectl -n voyager get pod | grep voyager-operator | awk ' { print $2; } ' `
745
- if [ " ${ready} " = " 1/1" ] ; then
746
- echo " Voyager Ingress Controller is ready"
747
- break
748
- fi
749
- if [ $(( mnow - mstart)) -gt $(( maxwaitsecs)) ]; then
750
- fail " The Voyager Ingress Controller is not ready."
751
- fi
752
- sleep 1
753
- done
754
-
755
- kubectl apply -f ${voyagerOutput}
756
-
757
- echo Checking Voyager Ingress resource
758
- local maxwaitsecs=100
759
- local mstart=` date +%s`
760
- while : ; do
761
- local mnow=` date +%s`
762
- local vdep=` kubectl get ingresses.voyager.appscode.com -n ${namespace} | grep ${domainUID} -voyager | wc | awk ' { print $1; } ' `
763
- if [ " $vdep " = " 1" ]; then
764
- echo " The Voyager Ingress resource ${domainUID} -voyager is created successfully."
765
- break
766
- fi
767
- if [ $(( mnow - mstart)) -gt $(( maxwaitsecs)) ]; then
768
- fail " The Voyager Ingress resource ${domainUID} -voyager was not created."
769
- fi
770
- sleep 5
771
- done
772
-
773
- echo Checking HAProxy pod is running
774
- local maxwaitsecs=100
775
- local mstart=` date +%s`
776
- while : ; do
777
- local mnow=` date +%s`
778
- local st=` kubectl get pod -n ${namespace} | grep ^voyager-${domainUID} -voyager- | awk ' { print $3; } ' `
779
- if [ " $st " = " Running" ]; then
780
- echo " The HAProxy pod for Voyaer Ingress ${domainUID} -voyager is created successfully."
781
- break
782
- fi
783
- if [ $(( mnow - mstart)) -gt $(( maxwaitsecs)) ]; then
784
- fail " The HAProxy pod for Voyaer Ingress ${domainUID} -voyager was not created or running."
785
- fi
786
- sleep 5
787
- done
788
-
789
- echo Checking Voyager service
790
- local maxwaitsecs=100
791
- local mstart=` date +%s`
792
- while : ; do
793
- local mnow=` date +%s`
794
- local vscv=` kubectl get service ${domainUID} -voyager-stats -n ${namespace} | grep ${domainUID} -voyager-stats | wc | awk ' { print $1; } ' `
795
- if [ " $vscv " = " 1" ]; then
796
- echo ' The service ${domainUID}-voyager-stats is created successfully.'
797
- break
798
- fi
799
- if [ $(( mnow - mstart)) -gt $(( maxwaitsecs)) ]; then
800
- fail " The service ${domainUID} -voyager-stats was not created."
801
- fi
802
- sleep 5
803
- done
730
+ createVoyagerOperator ${voyagerSecurityOutput} ${voyagerOperatorOutput}
731
+ createVoyagerIngress ${voyagerIngressOutput} ${namespace} ${domainUID}
804
732
}
805
733
806
734
#
@@ -966,7 +894,9 @@ function outputJobSummary {
966
894
echo " ${apacheSecurityOutput} "
967
895
echo " ${apacheOutput} "
968
896
elif [ " ${loadBalancer} " = " VOYAGER" ]; then
969
- echo " ${voyagerOutput} "
897
+ echo " ${voyagerOperatorOutput} "
898
+ echo " ${voyagerSecurityOutput} "
899
+ echo " ${voyagerIngressOutput} "
970
900
fi
971
901
}
972
902
0 commit comments