Giter Club home page Giter Club logo

ingress-monitor's Introduction

Ingress Monitor

Build Status codecov

Ingress Monitor is a Kubernetes Operator which takes care of setting up monitoring for your Kubernetes Ingress and Service objects.

Status

This is still a WIP. The main piece currently missing is Custom Resource Definition validation and extra providers.

Usage

IngressMonitor exists out of several key components, which are each explained in their respective design docs.

The main goal for Ingress Monitor is to make it easy for teams to set up monitors without having to add special annotations. As with a lot of the Kubernetes ecosystem, this operator bases it's selection on labels.

This means that you can use your existing set of labels on your Ingresses and do a widespread selection, which will then be used by the Operator to set up the appropriate IngressMonitor. This is useful so that teams could for example each add their own label team: gophers, which then has a Monitor attached to it. This Monitor can then be configured to just alert this specific team if something is wrong.

The second goal is to make it possible to reuse components. This is why there are separate Provider and MonitorTemplate objects. These can be mixed and matched within the Monitor resource, which then forms an actual monitoring instance.

Installation

To install the Operator, make sure you have RBAC enabled in your cluster.

kubectl apply -f https://raw.githubusercontent.com/jelmersnoeck/ingress-monitor/master/docs/kube/with-rbac.yaml

Example

There is an example installed in the examples directory. This is using StatusCake as a provider and is using kuard as the application it monitors.

This is meant to demonstrate the configuration options.

To use this, first you'll need to create an account with StatusCake and retrieve the API key.

Following that, you can set up a secret which contains your credentials:

kubectl create namespace websites
kubectl create secret generic statuscake-secrets -n websites --from-literal=username=<STATUSCAKE_USERNAME> --from-literal=apikey=<STATUSCAKE_APIKEY>

After this, you can apply the entire _examples/kuard folder:

kubectl apply -f _examples/kuard

This will set up a Provider, MonitorTemplate and Monitor along with a Deployment which is exposed through a Service and Ingress. The Ingress has the label team: gophers which is used by the Monitor to create an IngressMonitor.

Supported Providers

Providers are used to indicate where we want to set up a monitor. Multiple providers are supported within one cluster. These can be referenced later on in a Monitor.

The Operator only supports a certain set of Monitoring Providers. Below we have listed these providers.

StatusCake

To configure StatusCake, there are 2 required arguments:

  • username
  • apiKey

As an optional argument, you can reference a contactGroup which will be used to send notifications to.

All values follow the EnvVar schema, meaning you can use plaintext values or secretKeyRef. We recommend using the secretKeyRef.

Design

For more information about the design of this project, have a look at the design documents.

ingress-monitor's People

Contributors

davidharrigan avatar jbowes avatar jelmersnoeck avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

Forkers

davidharrigan

ingress-monitor's Issues

Add StatusCake provider

Add a mapping so we can create checks with StatusCake.

There is a provider interface, which this mapper should follow. We can then register this provider within an init function and importing it in our command.

Write up correct deployment and docs

The current docs are outdated, we need to explain the Monitor/MonitorTemplate differences.

It should also contain a correct deployment with the operator, RBAC and CRD objects (with validation rules)

Add ValidationRules

We're missing a lot of validation rules. We need to set this up.

I'd like to see both client side (CRD Spec) and server side (operator) validation.

Implement Ingress OnUpdate check

When an Ingress changes, we should validate if it is still selected by a Monitor. If not, we need to find all IngressMonitors which are owned by the Ingress and delete them.

Handle deletion of Ingresses correctly

A resource can't have multiple ControllerReferences where Controller = true.

This configuration however is responsible for making sure an item is Garbage Collected. Since we want to make sure that when either a Monitor or Ingress is deleted, the underlying IngressMonitor gets deleted as well, we need to set up a mechanism to do this.

We can do this by using the OnDelete listener and add some GC capabilities in there.

Add metrics endpoint

We should have a metrics endpoint which can be used by Prometheus to scrape information.

  • number of providers
  • number of templates
  • number of monitors
  • number of ingress monitors
  • number of failed syncs

Automatic CRD generators

Instead of manually creating the CRD manifests, we should pull this out of the apis folder and use that to release the actual manifests. Add it with the make generated command.

Add healthz endpoint

We should set up a healthz endpoint to indicate that the service is running fine. This should be done after all mandatory checks so we can retry if needed.

Move over to our own StatusCake integration

The StatusCake client isn't providing that much information about errors. We should swap to our own integration and do status code checks etc. to see if we've got duplicated requests or if we're trying to update a resource which doesn't exist.

It is also lacking support for SSL checks, which we need to enable.

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.