Skip to content

Repository files navigation

IRIS

Go Report Cardcodecov

In Greek mythology, Iris is the personification of the rainbow and messenger of the gods.

Easily configure webhooks on Kubernetes events using highly customizable filters

  • This project is not stable yet and may be changed anytime without any notice.

Run in cluster

Using Helm

  • clone or fork this repository
  • create your iris.yaml file
  • install chart from local directory helm install ./iris --values ./iris.yaml
  • by default the chart will be installed into namespace iris, see default values to overwrite it

Build

  • clone or fork this repo
  • make install
  • make build
  • Limitations:
    • Execute out of cluster iris run --help
    • Execute on non GCP cluster

Quick example:

In this example we will configure to listen on any Kubernetes event that been reported by the pod controller and matched to the filter will be sent to the destination.

filters:
- name: MatchDefaultNamespacetype: namespacenamespace: default
- name: MatchPodKindtype: jsonpathpath: $.involvedObject.kindvalue: Poddestinations:
- name: produrl: http://localhostintegrations:
- name: Reportdestinations: - prodfilters:
- MatchPodKind
- MatchDefaultNamespace

Filters

Set of rules that will be applied on each Kubernetes event.
Kubernetes event that will pass all required filters will be passed to the destination to be reported
Types of filters:

Reason

Reason filter is a syntactic sugar for JSONPath filter with path: $.reason and value: {{reason}}

filters:
- name: PodScheduledreason: "Scheduled"

Namespace

Namespace filter is a syntactic sugar for JSONPath filter with path: $.metadata.namespace and value: {{reason}}

filters:
- name: FromDefaultNamespacenamespace: default

JSONPath

With JSONPath gives the ability to match any field from Kubernetes event. The value from the fields can be matched to exec value using value: {{value}} or matched by regex using regexp: {{regexp}}

filters:
# Match to Warning event type
- name: WarningLeveltype: jsonpathpath: $.typevalue: Warning# Match to any event that the name matched to regexp /tiller/
- name: MatchToRegexpTillertype: jsonpathpath: $.metadata.nameregexp: tiller

Labels

Labels filter will try to get the original resource from the event with the given filters. The filter considers as passed if any resource were found

filters:
- name: MatchLabelstype: labelslabels:
app: helm

Any

filters:
- name: WarningLeveltype: anyfilters:
- FromDefaultNamespace
- WarningLevel

Destinations

Each destination is an api endpoint where the Kubernetes event will be sent Types of destinations:

Default

The default destinations will attempt to send POST request with the event json in the request body If secret is given, hash string will be calculated using the given key on the request body and the result will be set in the request header as X-IRIS-HMAC: hash

destinations:
- name: Webhookurl: https://webhook.sitesecret: SECRET

Codefresh

With Iris, you can execute Codefresh pipelines. Add destinations with Codefresh type:

  • name: pipeline full name can be found easily using Codefresh CLI - codefresh get pipelines
  • branch: which branch of the repo should be cloned
  • cftoken: Token to Codefresh API can be generated in Account settings/Tokens view
 - name: ExecuteCodefreshPipelinetype: Codefreshpipeline: PIPELINE_NAMEcftoken: API_TOKENbranch: master

Integrations

Connecting between filters and destinations

integrations:
- name: Reportdestinations:
- {{name of destination}}filters:
- {{name of filters to apply}}

About

Watch on Kubernetes events, filter and send them as standard wehbook to any system

Topics

Resources

Stars

66 stars

Watchers

3 watching

Forks

Releases

Packages

Used by

Contributors

Languages