aws-workshop-for-kubernetes
aws-workshop-for-kubernetes copied to clipboard
Section 201 - Prometheus Link Doesn't work in Cloud9 IDE
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
this works!
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:
- 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
- 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