From 9a6debbc0922986cbbfa88ad1615e6c0fce6a2e8 Mon Sep 17 00:00:00 2001 From: jayunit100 Date: Tue, 19 May 2015 18:53:54 -0400 Subject: [PATCH] Prometheus service json Update to use a public IP so that services have a sane web-root --- contrib/prometheus/README.md | 12 +++++++++--- contrib/prometheus/prometheus-service.json | 22 ++++++++++++++++++++++ 2 files changed, 31 insertions(+), 3 deletions(-) create mode 100644 contrib/prometheus/prometheus-service.json diff --git a/contrib/prometheus/README.md b/contrib/prometheus/README.md index c6e78bc9526..9edcc898938 100644 --- a/contrib/prometheus/README.md +++ b/contrib/prometheus/README.md @@ -31,11 +31,17 @@ Looks open enough :). You can launch prometheus easily, by simply running. -`kubectl create -f cluster/addons/prometheus/prometheus-all.json` +`kubectl create -f contrib/prometheus/prometheus-all.json` -This will bind to port 9090 locally. You can see the prometheus database at that URL. +Then (edit the publicIP field in prometheus-service to be a public ip on one of your kubelets), -# How it works +and run + +`kubectl create -f contrib/prometheus/prometheus-service.json` + +Now, you can access the service `wget 10.0.1.89:9090`, and build graphs. + +## How it works This is a v1beta3 based, containerized prometheus ReplicationController, which scrapes endpoints which are readable on the KUBERNETES_RO service (the internal kubernetes service running in the default namespace, which is visible to all pods). diff --git a/contrib/prometheus/prometheus-service.json b/contrib/prometheus/prometheus-service.json new file mode 100644 index 00000000000..2ef359e5137 --- /dev/null +++ b/contrib/prometheus/prometheus-service.json @@ -0,0 +1,22 @@ +{ + "kind":"Service", + "apiVersion":"v1beta3", + "metadata":{ + "name":"prometheus", + "labels":{ + "name":"prometheus" + } + }, + "spec":{ + "publicIPs":["10.0.1.89"], + "ports": [ + { + "port":9090, + "targetPort":9090, + "protocol":"TCP" + }], + "selector":{ + "name":"kube-prometheus" + } + } +}