Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/grobie/prometheus-on-kubernetes
Example steps to run Prometheus in Kubernetes and scrape the infrastructure and apps
https://github.com/grobie/prometheus-on-kubernetes
Last synced: about 1 month ago
JSON representation
Example steps to run Prometheus in Kubernetes and scrape the infrastructure and apps
- Host: GitHub
- URL: https://github.com/grobie/prometheus-on-kubernetes
- Owner: grobie
- Created: 2016-11-04T05:29:43.000Z (about 8 years ago)
- Default Branch: master
- Last Pushed: 2016-11-04T17:47:40.000Z (about 8 years ago)
- Last Synced: 2024-07-31T14:06:25.663Z (4 months ago)
- Language: Shell
- Size: 30.3 KB
- Stars: 12
- Watchers: 5
- Forks: 7
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
- awesome-kubernetes - Prometheus on Kubernetes - An example setup of Prometheus inside of Kubernetes, monitoring the Kubernetes infrastructure itself as well as services running in Kubernetes. (Performance)
README
# Prometheus on Kubernetes
An example setup of Prometheus inside of Kubernetes, monitoring the Kubernetes
infrastructure itself as well as services running in Kubernetes. Used during a
workshop at [ContainerDays NYC][].The setup and all manifests are copied from [CoreOS][]' [kube-prometheus][]
project. This repository split their project up in individual commits to show
the individual steps.## Preparation
The examples require a running Kubernetes cluster as well as a configured
`kubectl` to talk to that cluster. Check the Kubernetes documentation for
examples.If you don't have access to a Kubernetes cluster, you can use the [bootkube][]
or [minikube][] projects to start a cluster locally. Bootkube allows for a local
multi-node setup and easier monitoring of Kubernetes components.You should be able to run `kubectl get pods --all-namespaces` and see some
output:```bash
$ kubectl get pods --all-namespaces
NAMESPACE NAME READY STATUS RESTARTS AGE
kube-system kube-api-checkpoint-172.17.4.101 1/1 Running 0 35m
kube-system kube-apiserver-lpd8d 2/2 Running 0 37m
kube-system kube-controller-manager-325405546-3ygeg 1/1 Running 0 39m
kube-system kube-controller-manager-325405546-an3m0 1/1 Running 0 39m
kube-system kube-dns-v20-3531996453-vkxnp 3/3 Running 0 39m
kube-system kube-proxy-ks0u7 1/1 Running 0 37m
kube-system kube-proxy-zss6m 1/1 Running 0 17m
kube-system kube-scheduler-928627977-2mw8x 1/1 Running 0 39m
kube-system kube-scheduler-928627977-3llcb 1/1 Running 0 39m
```After install the [kubernetes-dashboard][] the UI should be available at
[http://172.17.4.101:32010](http://172.17.4.101:32010/#/workload?namespace=_all):```bash
kubectl --namespace=kube-system apply -f https://rawgit.com/kubernetes/dashboard/master/src/deploy/kubernetes-dashboard.yaml
```## Running Prometheus
There are many options to install and configure Prometheus in Kubernetes.
The most basic one is to create the necessary pod spec, service spec and
deployment/petset spec on your own. There are various [Helm][] charts available
in the Kubernetes ecosystem to make it easier to share such specifications.A very recent new option is to use [CoreOS][]' [prometheus-operator][] which
provides Kubernetes controller and extensions making the configuration of
Prometheus very easy.The following command will install the Prometheus Operator and upload a
Prometheus specification. The operator will watch for such specs and configure
Prometheus accordingly.```bash
scripts/deploy
```[bootkube]: https://github.com/kubernetes-incubator/bootkube
[containerdays nyc]: http://dynamicinfradays.org/events/2016-nyc/
[coreos]: https://coreos.com/
[helm]: https://github.com/kubernetes/helm
[kube-prometheus]: https://github.com/coreos/kube-prometheus
[kubernetes-dashboard]: https://github.com/kubernetes/dashboard
[minikube]: https://github.com/kubernetes/minikube
[prometheus-operator]: https://github.com/coreos/prometheus-operator