aws-workshop-for-kubernetes icon indicating copy to clipboard operation
aws-workshop-for-kubernetes copied to clipboard

Section 201 - Prometheus Link Doesn't work in Cloud9 IDE

Open RisingPhorce opened this issue 8 years ago • 2 comments

I believe the correct link should be:

https://<ENV_ID>.vfs.cloud9.<REGION_ID>.amazonaws.com/api/v1/namespaces/monitoring/services/prometheus-operated:9090/proxy/targets

RisingPhorce avatar Mar 19 '18 19:03 RisingPhorce

this works!

ShadySQL avatar Apr 09 '18 20:04 ShadySQL

The current instructions assume a local environment is used (http://localhost:9090) and so do not work when using Cloud 9.

The public facing Cloud9 load balancer is configured to map port 80 to port 8080 on the target EC2 instance. To be able to contact a Prometheus endpoint something therefore needs to be listening on port 8080 and forwarding to the a Prometheus pod on port 9090.

There are two options:

  1. Run Kube proxy and use the Kube API servers path remapping support
  • kubectl proxy --address 0.0.0.0 --accept-hosts '.*' --port 8080
  • GET https://<ENV_ID>.vfs.cloud9.<REGION_ID>.amazonaws.com/api/v1/namespaces/monitoring/services/prometheus-operated:9090/proxy/targets
  1. Port forward port 8080 to the Prometheus port 9090
  • kubectl port-forward prometheus-prometheus-0 8080:9090 -n monitoring
  • GET https://<ENV_ID>.vfs.cloud9.<REGION_ID>.amazonaws.com/targets

mlgibbons avatar May 01 '18 12:05 mlgibbons