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.
- 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
- clone or fork this repo
make installmake build- Limitations:
- Execute out of cluster
iris run --help - Execute on non GCP cluster
- Execute out of 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
- MatchDefaultNamespaceSet 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 filter is a syntactic sugar for JSONPath filter with path: $.reason and value: {{reason}}
filters:
- name: PodScheduledreason: "Scheduled"Namespace filter is a syntactic sugar for JSONPath filter with path: $.metadata.namespace and value: {{reason}}
filters:
- name: FromDefaultNamespacenamespace: defaultWith 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: tillerLabels 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: helmfilters:
- name: WarningLeveltype: anyfilters:
- FromDefaultNamespace
- WarningLevelEach destination is an api endpoint where the Kubernetes event will be sent Types of destinations:
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: SECRETWith 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: masterConnecting between filters and destinations
integrations:
- name: Reportdestinations:
- {{name of destination}}filters:
- {{name of filters to apply}}