[ANSIBLE] Create a NodePort type service for Grafana dashboard 66/122166/2
authorBartek Grzybowski <b.grzybowski@partner.samsung.com>
Thu, 24 Jun 2021 09:29:58 +0000 (11:29 +0200)
committerBartek Grzybowski <b.grzybowski@partner.samsung.com>
Thu, 24 Jun 2021 09:45:11 +0000 (11:45 +0200)
This will allow accessing Grafana UI on controlplane public port.

Change-Id: Ic3c2f22f36616fe636c966d962b9e503ef56c735
Issue-ID: INT-1926
Signed-off-by: Bartek Grzybowski <b.grzybowski@partner.samsung.com>
ansible/roles/kube-prometheus-stack/defaults/main.yml
docs/InstallGuide.rst

index 74d6564..6b25a2e 100644 (file)
@@ -27,6 +27,14 @@ kube_prometheus_stack:
         accessModes:
           - ReadWriteOnce
         size: 4Gi
+      service:
+        enabled: true
+        type: NodePort
+        port: 80
+        targetPort: 3000
+        annotations: {}
+        labels: {}
+        portName: service
     prometheus:
       prometheusSpec:
         scrapeInterval: 60s
index 32d8ef0..30f5c40 100644 (file)
@@ -662,6 +662,13 @@ In the left pane navigate to *Dashboards -> Manage* to see the various pre-defin
 .. image:: images/grafana-dashboards.png
    :alt: Grafana dashboards
 
+Alternative way of accessing the UI is by leveraging the NodePort type service which exposes Grafana UI on the Infra host public port directly. To do so get the port number first::
+
+    kubectl -n kube-prometheus get service/kube-prometheus-stack-grafana -o custom-columns=PORTS:.spec.ports[].nodePort
+
+Then navigate to http://<infra IP>:<nodePort> to access the UI.
+
+
 Caveats
 ~~~~~~~