From: David Garcia Date: Wed, 2 Sep 2020 09:40:12 +0000 (+0200) Subject: Improve annotations for exposing OSM services in charmed installer X-Git-Tag: release-v9.0-start~68 X-Git-Url: https://osm.etsi.org/gitweb/?p=osm%2Fdevops.git;a=commitdiff_plain;h=de5fc1da0abc424bd83f3b22a931950de09709fd Improve annotations for exposing OSM services in charmed installer Change-Id: Iffde16ff5f92aa3a99f2fb8e1ff22c8b9eb61caf Signed-off-by: David Garcia --- diff --git a/installers/charmed_install.sh b/installers/charmed_install.sh index c1c46e4f..8900270c 100755 --- a/installers/charmed_install.sh +++ b/installers/charmed_install.sh @@ -210,25 +210,30 @@ function deploy_charmed_osm(){ API_SERVER="$(echo $hostport | sed -e 's,:.*,,g')" fi + # Expose OSM services + # Expose NBI juju config nbi-k8s juju-external-hostname=nbi.${API_SERVER}.xip.io juju expose nbi-k8s - wait_for_port nbi-k8s 0 - sg ${KUBEGRP} -c "${KUBECTL} get ingress -n osm -o json | jq '.items[0].metadata.annotations += {\"nginx.ingress.kubernetes.io/backend-protocol\": \"HTTPS\"}' | ${KUBECTL} --validate=false replace -f -" - sg ${KUBEGRP} -c "${KUBECTL} get ingress -n osm -o json | jq '.items[0].metadata.annotations += {\"nginx.ingress.kubernetes.io/proxy-body-size\": \"0\"}' | ${KUBECTL} replace -f -" - + # Expose NG UI juju config ng-ui juju-external-hostname=ui.${API_SERVER}.xip.io juju expose ng-ui - wait_for_port ng-ui 1 - sg ${KUBEGRP} -c "${KUBECTL} get ingress -n osm -o json | jq '.items[2].metadata.annotations += {\"nginx.ingress.kubernetes.io/proxy-body-size\": \"0\"}' | ${KUBECTL} --validate=false replace -f -" - + # Expose UI juju config ui-k8s juju-external-hostname=osm.${API_SERVER}.xip.io juju expose ui-k8s + # Wait for ingress resources to be applied + wait_for_port nbi-k8s 0 + wait_for_port ng-ui 1 wait_for_port ui-k8s 2 - sg ${KUBEGRP} -c "${KUBECTL} get ingress -n osm -o json | jq '.items[1].metadata.annotations += {\"nginx.ingress.kubernetes.io/proxy-body-size\": \"0\"}' | ${KUBECTL} --validate=false replace -f -" -} + + # Apply annotations + sg ${KUBEGRP} -c "${KUBECTL} annotate ingress nginx.ingress.kubernetes.io/backend-protocol=HTTPS -n osm -l juju-app=nbi-k8s" + sg ${KUBEGRP} -c "${KUBECTL} annotate ingress nginx.ingress.kubernetes.io/proxy-body-size=0 -n osm -l juju-app=nbi-k8s" + sg ${KUBEGRP} -c "${KUBECTL} annotate ingress nginx.ingress.kubernetes.io/proxy-body-size=0 -n osm -l juju-app=ng-ui" + sg ${KUBEGRP} -c "${KUBECTL} annotate ingress nginx.ingress.kubernetes.io/proxy-body-size=0 -n osm -l juju-app=ui-k8s" + function check_osm_deployed() { TIME_TO_WAIT=600