Git Product home page Git Product logo

prometheus-kubernetes's Introduction

Monitoring Kubernetes clusters on AWS, GCP and Azure using Prometheus Operator by CoreOS

alt

Note: the work on this repository is now based on CoreOS's kube-prometheus and it will be the default option for Kubernetes 1.7.X and up. For 1.5.X and 1.6.X you can deploy a simpler solution, located in ./basic directory. The purpose of this project is to provide a simple and interactive method to deploy and configure Prometheus on Kubernetes, especially for the users that are not using Helm.

Features

  • Prometheus Operator with support for Prometheus v2.X.X
  • highly available Prometheus and Alertmaneger
  • InCluster deployment using StatefulSets for persistent storage
  • auto-discovery for services and pods
  • automatic RBAC configuration
  • preconfigured alerts
  • preconfigured Grafana dashboards
  • easy to setup; usually less than a minute to deploy a complete monitoring solution for Kubernetes
  • support for Kubernetes v1.7.x and up running in AWS, GCP and Azure
  • tested on clusters deployed using kube-aws, kops, GKE and Azure

One minute deployment

asciicast

Prerequisites

  • Kubernetes cluster and kubectl configured
  • Security Groups configured to allow the fallowing ports:
    • 9100/TCP - node-exporter
    • 10250/TCP - kubernetes nodes metrics,
    • 10251/TCP - kube-scheduler
    • 10252/TCP - kube-controller-manager
    • 10054/TCP and 10055/TCP - kube-dns

Optional

  • SMTP Account for email alerts
  • Token for Slack alerts

Pre-Deployment

Clone the repository and checkout the latest release: curl -L https://git.io/getPrometheusKubernetes | sh -

Custom settings

All the components versions can be configured using the interactive deployment script. Same for the SMTP account or the Slack token.

Some other settings that can be changed before deployment:

  • Prometheus replicas: default 2 ==> manifests/prometheus/prometheus-k8s.yaml
  • persistent volume size: default 40Gi ==> manifests/prometheus/prometheus-k8s.yaml
  • allocated memory for Prometheus pods: default 2Gi ==> manifests/prometheus/prometheus-k8s.yaml
  • Alertmanager replicas: default 3 ==> manifests/alertmanager/alertmanager.yaml
  • Alertmanager configuration: ==> assets/alertmanager/alertmanager.yaml
  • custom Grafana dashboards: add yours in assets/grafana/ with names ending in -dashboard.json
  • custom alert rules: ==> assets/prometheus/rules/

Note: please commit your changes before deployment if you wish to keep them. The deploy script will remove the changes on most of the files.

Deploy

./deploy

Now you can access the dashboards locally using kubectl port-forwardcommand, or expose the services using a ingress or a LoadBalancer. Please check the ./tools directory to quickly configure a ingress or proxy the services to localhost.

To remove everything, just execute the ./teardown script.

Updating configurations

  • update alert rules: add or change the rules in assets/prometheus/rules/ and execute scripts/generate-rules-configmap.sh. Then apply the changes using kubectl apply -f manifests/prometheus/prometheus-k8s-rules.yaml -n monitoring
  • update grafana dashboards: add or change the existing dashboards in assets/grafana/ and execute scripts/generate-dashboards-configmap.sh. Then apply the changes using kubectl apply -f manifests/grafana/grafana-dashboards.cm.yaml.

Note: all the Grafana dashboards should have names ending in -dashboard.json.

Custom Prometheus configuration

The official documentation for Prometheus Operator custom configuration can be found here: custom-configuration.md If you wish, you can update the Prometheus configuration using the ./tools/custom-configuration/update_config script.

prometheus-kubernetes's People

Contributors

arealmaas avatar camilb avatar downneck avatar joseppla avatar philicious avatar scottbrenner avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.