Commit 081237d7 authored by Lluis Gifre Renom's avatar Lluis Gifre Renom
Browse files

Changes in WebUI:

- Added upload of descriptors file
- Added scripts to generate descriptor files
- Arranged minor script details
- Minor bug fixing
parent c0a8be42
Loading
Loading
Loading
Loading
+2 −2
Original line number Diff line number Diff line
@@ -25,8 +25,8 @@ INFLUXDB_DATABASE=$(kubectl --namespace $K8S_NAMESPACE get secrets influxdb-secr
# GRAFANA_HOSTNAME=$(kubectl get node $K8S_HOSTNAME -o 'jsonpath={.status.addresses[?(@.type=="InternalIP")].address}')
# GRAFANA_HOSTNAME=`kubectl get service/webuiservice-public -n ${K8S_NAMESPACE} -o jsonpath='{.spec.clusterIP}'`
GRAFANA_HOSTNAME=`kubectl get nodes --selector=node-role.kubernetes.io/master -o jsonpath='{$.items[*].status.addresses[?(@.type=="InternalIP")].address}'`
# GRAFANA_PORT=$(kubectl get service webuiservice-public --namespace $K8S_NAMESPACE -o 'jsonpath={.spec.ports[?(@.port==3000)].nodePort}')
GRAFANA_PORT=`kubectl get service/webuiservice-public -n ${K8S_NAMESPACE} -o jsonpath='{.spec.ports[1].nodePort}'`
GRAFANA_PORT=$(kubectl get service webuiservice-public --namespace $K8S_NAMESPACE -o 'jsonpath={.spec.ports[?(@.port==3000)].nodePort}')
#GRAFANA_PORT=`kubectl get service/webuiservice-public -n ${K8S_NAMESPACE} -o jsonpath='{.spec.ports[1].nodePort}'`
GRAFANA_USERNAME="admin"
GRAFANA_PASSWORD=${GRAFANA_PASSWORD:-"admin123+"}
GRAFANA_URL="http://${GRAFANA_USERNAME}:${GRAFANA_PASSWORD}@${GRAFANA_HOSTNAME}:${GRAFANA_PORT}"

manifests/expose_services.yaml

deleted100644 → 0
+0 −90
Original line number Diff line number Diff line
---
apiVersion: v1
kind: Service
metadata:
  name: contextservice-public
  labels:
    app: contextservice
spec:
  type: NodePort
  selector:
    app: contextservice
  ports:
  - name: grpc
    protocol: TCP
    port: 1010
    targetPort: 1010
  - name: http
    protocol: TCP
    port: 8080
    targetPort: 8080
    nodePort: 30808
---
apiVersion: v1
kind: Service
metadata:
  name: redis-tests
  labels:
    app: contextservice
spec:
  type: NodePort
  selector:
    app: contextservice
  ports:
  - name: redis
    protocol: TCP
    port: 6379
    targetPort: 6379
---
apiVersion: v1
kind: Service
metadata:
  name: influx-tests
  labels:
    app: monitoringservice
spec:
  type: NodePort
  selector:
    app: monitoringservice
  ports:
  - name: influx
    protocol: TCP
    port: 8086
    targetPort: 8086
---
apiVersion: v1
kind: Service
metadata:
  name: deviceservice-public
  labels:
    app: deviceservice
spec:
  type: NodePort
  selector:
    app: deviceservice
  ports:
  - name: grpc
    protocol: TCP
    port: 2020
    targetPort: 2020
---
apiVersion: v1
kind: Service
metadata:
  name: computeservice-public
  labels:
    app: computeservice
spec:
  type: NodePort
  selector:
    app: computeservice
  ports:
  - name: http
    protocol: TCP
    port: 8080
    targetPort: 8080
  - name: grpc
    protocol: TCP
    port: 9090
    targetPort: 9090
---
 No newline at end of file
+2 −2
Original line number Diff line number Diff line
@@ -18,8 +18,8 @@

K8S_NAMESPACE=${K8S_NAMESPACE:-'tf-dev'}

GRAFANA_IP=`kubectl get service/webuiservice -n ${K8S_NAMESPACE} -o jsonpath='{.spec.clusterIP}'`
GRAFANA_PORT=`kubectl get service/webuiservice -n ${K8S_NAMESPACE} -o jsonpath='{.spec.ports[1].port}'`
GRAFANA_IP=$(kubectl get service/webuiservice -n ${K8S_NAMESPACE} -o jsonpath='{.spec.clusterIP}')
GRAFANA_PORT=$(kubectl get service webuiservice-public --namespace $K8S_NAMESPACE -o 'jsonpath={.spec.ports[?(@.port==3000)].nodePort}')
URL=http://${GRAFANA_IP}:${GRAFANA_PORT}

echo Opening Dashboard on URL ${URL}
+9 −12
Original line number Diff line number Diff line
@@ -16,23 +16,20 @@

K8S_NAMESPACE=${K8S_NAMESPACE:-'tf-dev'}

WEBUI_SERVICE_NAME="service/webuiservice-public"
WEBUI_PROTO=`kubectl get ${WEBUI_SERVICE_NAME} -n ${K8S_NAMESPACE} -o jsonpath='{.spec.ports[0].name}'`
WEBUI_IP=`kubectl get ${WEBUI_SERVICE_NAME} -n ${K8S_NAMESPACE} -o jsonpath='{.spec.clusterIP}'`
WEBUI_PORT=`kubectl get ${WEBUI_SERVICE_NAME} -n ${K8S_NAMESPACE} -o jsonpath='{.spec.ports[0].port}'`
GRAFANA_PORT=`kubectl get ${WEBUI_SERVICE_NAME} -n ${K8S_NAMESPACE} -o jsonpath='{.spec.ports[1].port}'`
URL=${WEBUI_PROTO}://${WEBUI_IP}:${WEBUI_PORT}
WEBUI_SERVICE_NAME="webuiservice-public"
WEBUI_PROTO=`kubectl get service ${WEBUI_SERVICE_NAME} -n ${K8S_NAMESPACE} -o jsonpath='{.spec.ports[0].name}'`
WEBUI_IP=`kubectl get service ${WEBUI_SERVICE_NAME} -n ${K8S_NAMESPACE} -o jsonpath='{.spec.clusterIP}'`
WEBUI_PORT=$(kubectl get service ${WEBUI_SERVICE_NAME} --namespace $K8S_NAMESPACE -o 'jsonpath={.spec.ports[?(@.port==8004)].nodePort}')
GRAFANA_PORT=$(kubectl get service ${WEBUI_SERVICE_NAME} --namespace $K8S_NAMESPACE -o 'jsonpath={.spec.ports[?(@.port==3000)].nodePort}')

# Open WebUI
URL=${WEBUI_PROTO}://${WEBUI_IP}:${WEBUI_PORT}
echo Opening web UI on URL ${URL}

# curl -kL ${URL}

python3 -m webbrowser ${URL}

# Open Dashboard
URL=${WEBUI_PROTO}://${WEBUI_IP}:${GRAFANA_PORT}

echo Opening web UI on URL ${URL}

echo Opening Dashboard on URL ${URL}
# curl -kL ${URL}

python3 -m webbrowser ${URL}
+2 −0
Original line number Diff line number Diff line
# Add here your files containing confidential testbed details such as IP addresses, ports, usernames, passwords, etc.
descriptors_real.json
Loading