openebs / monitoring

OpenEBS Monitoring add-on. A set of Grafana, Prometheus, and alert manager plugins.
Apache License 2.0
26 stars 20 forks source link

given URL from NOTES.txt return blank for the IP if there are no externalIP returned #83

Closed survivant closed 2 years ago

survivant commented 2 years ago
helm install openebs-monitoring openebs-monitoring/openebs-monitoring --namespace openebs --create-namespace

NAME: openebs-monitoring
LAST DEPLOYED: Tue Oct 12 13:15:31 2021
NAMESPACE: openebs
STATUS: deployed
REVISION: 1
NOTES:
OpenEBS monitoring has been installed.
Check its status by running:
$ kubectl get pods -n openebs -o wide

Use `kubectl get svc -n openebs` to list all the
services in the `openebs` namespace.

To access the dashboards, form the Grafana URL and open it in the browser
export NODE_PORT=32515
export NODE_NAME=$(kubectl get pods --namespace openebs -l "app.kubernetes.io/name=grafana,app.kubernetes.io/instance=openebs-monitoring" -o jsonpath="{.items[0].spec.nodeName}")
export NODE_IP=$(kubectl get node $NODE_NAME -o jsonpath='{$.status.addresses[?(@.type=="ExternalIP")].address}')
echo http://$NODE_IP:$NODE_PORT
NOTE: The above IP should be a public IP

If I enter those commands I obtain this :


For more information, visit our Slack at https://openebs.io/community
root@test-pcl4014:~#
root@test-pcl4014:~# export NODE_PORT=32515
root@test-pcl4014:~#   export NODE_NAME=$(kubectl get pods --namespace openebs -l "app.kubernetes.io/name=grafana,app.kubernetes.io/instance=openebs-monitoring" -o jsonpath="{.items[0].spec.nodeName}")
  export NODE_IP=$(kubectl get node $NODE_NAME -o jsonpath='{$.status.addresses[?(@.type=="ExternalIP")].address}')
  echo http://$NODE_IP:$NODE_PORT

root@test-pcl4014:~#   export NODE_IP=$(kubectl get node $NODE_NAME -o jsonpath='{$.status.addresses[?(@.type=="ExternalIP")].address}')
root@test-pcl4014:~#   echo http://$NODE_IP:$NODE_PORT
http://:32515

it's because, I don't have a external IP.

root@test-pcl4014:~# kubectl get node $NODE_NAME -o wide
NAME           STATUS   ROLES                  AGE    VERSION   INTERNAL-IP   EXTERNAL-IP   OS-IMAGE             KERNEL-VERSION     CONTAINER-RUNTIME
test-pcl4014   Ready    control-plane,master   188d   v1.20.4   10.1.34.14    <none>        Ubuntu 20.04.2 LTS   5.4.0-77-generic   containerd://1.5.4
root@test-pcl4014:~#
Ab-hishek commented 2 years ago

@survivant Can this be closed after your PR #84 got merged? That solves this issue.

survivant commented 2 years ago

the port-forward will allow the user to pass that, but should the command be able to look if the external-ip is not empty, if it's empty, it should use the node ip instead ?

not sure that look of people will use that feature anyway, but... :)

Ab-hishek commented 2 years ago

If external IP is present then as it is users won't be able to see it on a browser( since the IP would be internal to that cluster). Hence, the possible solutions can be either port-forwarding or ssh-tunnelling.