@@ -371,9 +371,19 @@ function initialize {
371
371
validationError " The template file ${apacheInput} for generating the apache-webtier deployment was not found"
372
372
fi
373
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"
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,7 +459,9 @@ 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
@@ -620,17 +632,21 @@ function createYamlFiles {
620
632
fi
621
633
622
634
if [ " ${loadBalancer} " = " VOYAGER" ]; then
635
+ # Voyager Operator Security yaml file
636
+ cp ${voyagerSecurityInput} ${voyagerSecurityOutput}
637
+ # Voyager Operator yaml file
638
+ cp ${voyagerOperatorInput} ${voyagerOperatorOutput}
623
639
# 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 }
640
+ cp ${voyagerIngressInput } ${voyagerIngressOutput }
641
+ echo Generating ${voyagerIngressOutput }
642
+ sed -i -e " s:%NAMESPACE%:$namespace :g" ${voyagerIngressOutput }
643
+ sed -i -e " s:%DOMAIN_UID%:${domainUID} :g" ${voyagerIngressOutput }
644
+ sed -i -e " s:%DOMAIN_NAME%:${domainName} :g" ${voyagerIngressOutput }
645
+ sed -i -e " s:%CLUSTER_NAME%:${clusterName} :g" ${voyagerIngressOutput }
646
+ sed -i -e " s:%CLUSTER_NAME_LC%:${clusterNameLC} :g" ${voyagerIngressOutput }
647
+ sed -i -e " s:%MANAGED_SERVER_PORT%:${managedServerPort} :g" ${voyagerIngressOutput }
648
+ sed -i -e " s:%LOAD_BALANCER_WEB_PORT%:$loadBalancerWebPort :g" ${voyagerIngressOutput }
649
+ sed -i -e " s:%LOAD_BALANCER_DASHBOARD_PORT%:$loadBalancerDashboardPort :g" ${voyagerIngressOutput }
634
650
fi
635
651
636
652
# Remove any "...yaml-e" files left over from running sed
@@ -728,79 +744,8 @@ function createDomain {
728
744
# Deploy Voyager/HAProxy load balancer
729
745
#
730
746
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
747
+ createVoyagerOperator ${voyagerSecurityOutput} ${voyagerOperatorOutput}
748
+ createVoyagerIngress ${voyagerIngressOutput} ${namespace} ${domainUID}
804
749
}
805
750
806
751
#
@@ -966,7 +911,9 @@ function outputJobSummary {
966
911
echo " ${apacheSecurityOutput} "
967
912
echo " ${apacheOutput} "
968
913
elif [ " ${loadBalancer} " = " VOYAGER" ]; then
969
- echo " ${voyagerOutput} "
914
+ echo " ${voyagerOperatorOutput} "
915
+ echo " ${voyagerSecurityOutput} "
916
+ echo " ${voyagerIngressOutput} "
970
917
fi
971
918
}
972
919
0 commit comments