summaryrefslogtreecommitdiffstats
path: root/kubernetes
diff options
context:
space:
mode:
authorAlexis de Talhouƫt <alexis.de_talhouet@bell.ca>2018-12-04 12:59:02 +0000
committerGerrit Code Review <gerrit@onap.org>2018-12-04 12:59:02 +0000
commit693bc2491bb1249f3e0313a31c4240f5f65e3ba3 (patch)
tree017678d36cf8e81cdd4b941893c022e228c3b017 /kubernetes
parenta8149b2cf3fe63dd6ffcb7dcb108656ae9136381 (diff)
parent00520bcdb6f1bced922ed97016f42d370d3d2722 (diff)
Merge "Make the PNDA mirror accessible via a NodePort"
Diffstat (limited to 'kubernetes')
-rw-r--r--kubernetes/pnda/charts/dcae-pnda-bootstrap/resources/scripts/bootstrap.sh14
-rw-r--r--kubernetes/pnda/charts/dcae-pnda-bootstrap/values.yaml2
-rw-r--r--kubernetes/pnda/charts/dcae-pnda-mirror/templates/service.yaml2
-rw-r--r--kubernetes/pnda/charts/dcae-pnda-mirror/values.yaml8
4 files changed, 15 insertions, 11 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
diff --git a/kubernetes/pnda/charts/dcae-pnda-bootstrap/values.yaml b/kubernetes/pnda/charts/dcae-pnda-bootstrap/values.yaml
index 43f35b62d1..e22b8d26e7 100644
--- a/kubernetes/pnda/charts/dcae-pnda-bootstrap/values.yaml
+++ b/kubernetes/pnda/charts/dcae-pnda-bootstrap/values.yaml
@@ -18,7 +18,7 @@
# Global configuration defaults.
#################################################################
global:
- nodePortPrefix: 302
+ nodePortPrefixExt: 304
readinessRepository: oomk8s
readinessImage: readiness-check:2.0.0
loggingRepository: docker.elastic.co
diff --git a/kubernetes/pnda/charts/dcae-pnda-mirror/templates/service.yaml b/kubernetes/pnda/charts/dcae-pnda-mirror/templates/service.yaml
index b233a17348..fd376d16bb 100644
--- a/kubernetes/pnda/charts/dcae-pnda-mirror/templates/service.yaml
+++ b/kubernetes/pnda/charts/dcae-pnda-mirror/templates/service.yaml
@@ -30,7 +30,7 @@ spec:
ports:
{{if eq .Values.service.type "NodePort" -}}
- port: {{ .Values.service.externalPort }}
- nodePort: {{ .Values.global.nodePortPrefix | default .Values.nodePortPrefix }}{{ .Values.service.nodePort }}
+ nodePort: {{ .Values.global.nodePortPrefixExt | default .Values.nodePortPrefixExt }}{{ .Values.service.nodePort }}
name: {{ .Values.service.portName }}
{{- else -}}
- port: {{ .Values.service.externalPort }}
diff --git a/kubernetes/pnda/charts/dcae-pnda-mirror/values.yaml b/kubernetes/pnda/charts/dcae-pnda-mirror/values.yaml
index 6f346b8a8d..34de52a7be 100644
--- a/kubernetes/pnda/charts/dcae-pnda-mirror/values.yaml
+++ b/kubernetes/pnda/charts/dcae-pnda-mirror/values.yaml
@@ -18,7 +18,7 @@
# Global configuration defaults.
#################################################################
global:
- nodePortPrefix: 302
+ nodePortPrefixExt: 304
readinessRepository: oomk8s
readinessImage: readiness-check:2.0.0
loggingRepository: docker.elastic.co
@@ -59,9 +59,9 @@ readiness:
periodSeconds: 10
service:
- type: LoadBalancer
- name: dcae-pnda-mirror
- portName: client
+ type: NodePort
+ portName: dcae-pnda-mirror
+ nodePort: "00"
externalPort: 80
internalPort: 80