summaryrefslogtreecommitdiffstats
path: root/kubernetes/pnda/charts/dcae-pnda-bootstrap/resources
diff options
context:
space:
mode:
authorJulien Barbot <julien@barbot.org>2018-11-13 19:08:56 +0100
committerJulien Barbot <julien@barbot.org>2018-11-23 16:54:08 +0100
commit00520bcdb6f1bced922ed97016f42d370d3d2722 (patch)
tree8f132c02c44de4ca903ec78fd8fecdc8dbe97421 /kubernetes/pnda/charts/dcae-pnda-bootstrap/resources
parenta7b2ee30e615a8567d953b644bc37ec07759fcdf (diff)
Make the PNDA mirror accessible via a NodePort
The allocated port is {{.nodePortPrefixExt}}00 (i.e.: 30400). Change-Id: If11ab3a799c7225bc1a7227c0866f2eb4173ea13 Issue-ID: DCAEGEN2-779 Signed-off-by: Julien Barbot <julien@barbot.org>
Diffstat (limited to 'kubernetes/pnda/charts/dcae-pnda-bootstrap/resources')
-rw-r--r--kubernetes/pnda/charts/dcae-pnda-bootstrap/resources/scripts/bootstrap.sh14
1 files changed, 9 insertions, 5 deletions
diff --git a/kubernetes/pnda/charts/dcae-pnda-bootstrap/resources/scripts/bootstrap.sh b/kubernetes/pnda/charts/dcae-pnda-bootstrap/resources/scripts/bootstrap.sh
index 1c2608ac7d..e9b6f34bd3 100644
--- a/kubernetes/pnda/charts/dcae-pnda-bootstrap/resources/scripts/bootstrap.sh
+++ b/kubernetes/pnda/charts/dcae-pnda-bootstrap/resources/scripts/bootstrap.sh
@@ -49,17 +49,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