X-Git-Url: https://gerrit.onap.org/r/gitweb?a=blobdiff_plain;f=kubernetes%2Fpnda%2Fcharts%2Fdcae-pnda-bootstrap%2Fresources%2Fscripts%2Fbootstrap.sh;h=bc531844207abb48a3346a0566ec2b3bb38b7310;hb=b1ee058f941a9c9ff27467054d98b8a56c988797;hp=1c2608ac7d6712c3db0d2f7dbe6810e16c5188a8;hpb=460e28cbf478ac6df05056cd05bc60468fcf2745;p=oom.git diff --git a/kubernetes/pnda/charts/dcae-pnda-bootstrap/resources/scripts/bootstrap.sh b/kubernetes/pnda/charts/dcae-pnda-bootstrap/resources/scripts/bootstrap.sh old mode 100644 new mode 100755 index 1c2608ac7d..bc53184420 --- a/kubernetes/pnda/charts/dcae-pnda-bootstrap/resources/scripts/bootstrap.sh +++ b/kubernetes/pnda/charts/dcae-pnda-bootstrap/resources/scripts/bootstrap.sh @@ -1,4 +1,5 @@ #!/bin/sh +{{/* # ================================================================================ # Copyright (c) 2018 Cisco Systems. All rights reserved. # ================================================================================ @@ -14,6 +15,7 @@ # See the License for the specific language governing permissions and # limitations under the License. # ============LICENSE_END========================================================= +*/}} # Install PNDA in Openstack with Heat templates # Expects: @@ -29,7 +31,7 @@ fi set -ex -CLUSTER_PREFIX="{{ .Release.Name }}-{{ include "common.namespace" . }}-pnda" +CLUSTER_PREFIX="{{ include "common.release" . }}-{{ include "common.namespace" . }}-pnda" DATANODES="{{ .Values.pnda.dataNodes }}" KAFKANODES="{{ .Values.pnda.kafkaNodes }}" VERSION="{{ .Values.pnda.version }}" @@ -49,17 +51,21 @@ KUBE_TOKEN=$(cat /var/run/secrets/kubernetes.io/serviceaccount/token) for i in 1 2 3 4 5 6 7 8 9 do - MIRROR_IP=$(curl -s $KUBE_API/namespaces/{{ include "common.namespace" . }}/services/dcae-pnda-mirror \ - --header "Authorization: Bearer $KUBE_TOKEN" \ - --insecure | jq -r '.status.loadBalancer.ingress[0].ip') + MIRROR_IP=$(curl -s $KUBE_API/namespaces/{{ include "common.namespace" . }}/pods \ + --header "Authorization: Bearer $KUBE_TOKEN" \ + --insecure | jq -r '.items[].status | select(.containerStatuses != null) | select(.containerStatuses[].ready and .containerStatuses[].name=="dcae-pnda-mirror") | .hostIP') + MIRROR_PORT=$(curl -s $KUBE_API/namespaces/{{ include "common.namespace" . }}/services/dcae-pnda-mirror \ + --header "Authorization: Bearer $KUBE_TOKEN" \ + --insecure | jq -r '.spec.ports[] | select(.name=="dcae-pnda-mirror") | .nodePort') - if [ "$MIRROR_IP" != "null" ]; then + if [ "x${MIRROR_IP}" != "xnull" -a "x${MIRROR_PORT}" != "xnull" ]; then + PNDA_MIRROR="http://$MIRROR_IP:$MIRROR_PORT" break fi sleep 5 done -PNDA_MIRROR="http://$MIRROR_IP:80" +[ -z "${PNDA_MIRROR}" ] && { echo "Unable to get PNDA mirror IP:PORT"; exit 1; } sed -i -e 's?CLIENT_IP/32?CLIENT_IP?' bootstrap-scripts/package-install.sh