1
0
Fork 0
mirror of https://github.com/prometheus-operator/prometheus-operator.git synced 2025-04-25 13:37:34 +00:00
Prometheus Operator creates/configures/manages Prometheus clusters atop Kubernetes
Find a file
2017-01-03 10:41:28 +01:00
cmd/operator log unexpected error 2016-12-12 22:14:32 -08:00
Documentation Minor spelling fixes and readability improvements 2016-12-11 23:43:00 -05:00
example prometheus: fix Alertmanager discovery congfig 2016-11-28 12:03:39 +01:00
hack Rename external run script 2016-11-01 14:28:05 +01:00
pkg pkg/alertmanager: add ability to specify -web.external-url 2017-01-03 10:41:28 +01:00
scripts *: add license header and script to ensure it 2016-11-01 16:59:36 +01:00
test/e2e *: update client-go usage and switch PetSets to StatefulSets 2016-12-19 16:23:40 +01:00
vendor vendor: update client-go vendoring 2016-12-19 16:21:45 +01:00
.gitignore Rename controller to operator 2016-11-01 14:19:25 +01:00
.header *: add license header and script to ensure it 2016-11-01 16:59:36 +01:00
CHANGELOG.md add v0.2.1 changelog 2016-12-23 11:34:50 +01:00
code-of-conduct.md Add liecense, CoC, etc. 2016-11-01 14:37:27 +01:00
CONTRIBUTING.md Add liecense, CoC, etc. 2016-11-01 14:37:27 +01:00
DCO Add liecense, CoC, etc. 2016-11-01 14:37:27 +01:00
deployment.yaml example: use deployment and operator term 2016-11-02 17:32:00 -07:00
Dockerfile Rename controller to operator 2016-11-01 14:19:25 +01:00
LICENSE Add liecense, CoC, etc. 2016-11-01 14:37:27 +01:00
Makefile *: update client-go usage and switch PetSets to StatefulSets 2016-12-19 16:23:40 +01:00
NOTICE Add liecense, CoC, etc. 2016-11-01 14:37:27 +01:00
README.md README: add migration 1.5.0 documentation 2016-12-19 16:41:47 +01:00

Prometheus Operator

Project status: alpha Not all planned features are completed. The API, spec, status and other user facing objects are subject to change. We do not support backward-compability for the alpha releases.

The Prometheus Operator for Kubernetes provides easy monitoring definitions for Kubernetes services and deployment and management of Prometheus instances.

Once installed the Prometheus Operator provides the following features:

  • Create/Destroy: Easily launch a Prometheus instance for your Kubernetes namespace, a specific application or team easily using the Operator.

  • Simple Configuration: Configure the fundamentals of Prometheus like versions, persistence, retention policies, and replicas from a native Kubernetes resource.

  • Target Services via Labels: Automatically generate monitoring target configurations based on familiar Kubernetes label queries; no need to learn a Prometheus specific configuration language.

For an introduction to the Prometheus Operator, see the initial blog post.

See kube-prometheus for a collection of resources that can be used to start monitoring Kubernetes and applications running on top of it within minutes.

Prerequisites

To run the Prometheus Operator version 0.2.0 and higher you need a Kubernetes cluster version 1.5.0 or higher.

If you are just starting out with the Prometheus Operator, it is highly encouraged to use the versions mentioned above.

If you have previously used the Prometheus Operator pre 1.5.0 releases of kubernetes with the 0.1.0 version of it, see the migration section.

Migration

The PetSet was deprecated in the 1.5.0 release of Kubernetes in favor of the StatefulSet. As the Prometheus Operator used the PetSet in version 0.1.0 those need to be migrated as we upgrade our Kubernetes cluster as well as the Prometheus Operator.

First the Prometheus Operator needs to be shutdown. Once shutdown retrieve the PetSets that were generated by it. You can do so simply by finding all Prometheus and Alertmanager objects created.

kubectl get prometheuses --all-namespaces
kubectl get alertmanagers --all-namespaces

For each Prometheus and Alertmanger object a respective PetSet with the same name was created in the same namespace. Those PetSets need to be migrated according to the official migration documentation.

Once migrated and on a Kubernetes version >=1.5.0 you can start the Prometheus Operator of version >=0.2.0 and up and the StatefulSet created in the migration will from now on be managed by the Prometheus Operator.

Third party resources

The Operator acts on the following third party resources (TPRs):

  • Prometheus, which defines a desired Prometheus deployment. The Operator ensures at all times that a deployment matching the resource definition is running.

  • ServiceMonitor, which declaratively specifies how groups of services should be monitored. The Operator automatically generates Prometheus scrape configuration based on the definition.

  • Alertmanager, which defines a desired Alertmanager deployment. The Operator ensures at all times that a deployment matching the resource definition is running.

Installation

Install the Operator inside a cluster by running the following command:

kubectl apply -f deployment.yaml

To run the Operator outside of a cluster:

make
hack/run-external.sh <kubectl cluster name>

The Prometheus Operator collects anonymous usage statistics to help us learning how the software is being used and how we can improve it. To disable collection, run the Operator with the flag -analytics=false