All Projects → redhat-cop → k8s-notify

redhat-cop / k8s-notify

Licence: other
Turn kubernetes events into useful notifications & alerts

Programming Languages

go
31211 projects - #10 most used programming language
shell
77523 projects

Projects that are alternatives of or similar to k8s-notify

opdemo
Kubernetes Operator 快速入门教程(Kubernetes Operator 101)
Stars: ✭ 158 (+243.48%)
Mutual labels:  operator, operator-sdk
mysql-operator
A Kubernetes Operator for MySQL Community Server
Stars: ✭ 21 (-54.35%)
Mutual labels:  operator, operator-sdk
openshift-disconnected-operators
No description or website provided.
Stars: ✭ 52 (+13.04%)
Mutual labels:  operator, container-cop
aws-nlb-helper-operator
Simple operator to manage AWS NLB attributes using Kubernetes Service object annotations
Stars: ✭ 23 (-50%)
Mutual labels:  operator, operator-sdk
pulp-operator
Kubernetes Operator for Pulp 3. Under active development.
Stars: ✭ 32 (-30.43%)
Mutual labels:  operator, operator-sdk
rabbitmq-operator
RabbitMQ Kubernetes operator
Stars: ✭ 16 (-65.22%)
Mutual labels:  operator, operator-sdk
horusec-platform
Horusec Platform is a set of web services that integrate with the Horusec CLI to facilitate the visualization and management of found vulnerabilities.
Stars: ✭ 32 (-30.43%)
Mutual labels:  operator, operator-sdk
Litmus
Litmus helps SREs and developers practice chaos engineering in a Cloud-native way. Chaos experiments are published at the ChaosHub (https://hub.litmuschaos.io). Community notes is at https://hackmd.io/a4Zu_sH4TZGeih-xCimi3Q
Stars: ✭ 2,377 (+5067.39%)
Mutual labels:  operator, operator-sdk
clowder
Operator for operating cloud.redhat.com
Stars: ✭ 21 (-54.35%)
Mutual labels:  operator, operator-sdk
cert-operator
An OpenShift controller using the Operator SDK for managing TLS certficate lifecycle
Stars: ✭ 27 (-41.3%)
Mutual labels:  operator-sdk, container-cop
varnish-operator
Run and manage Varnish clusters on Kubernetes
Stars: ✭ 47 (+2.17%)
Mutual labels:  operator
chatops-controller
A rails plugin to make creating chatops easy
Stars: ✭ 58 (+26.09%)
Mutual labels:  chatops
vitess-operator
Kubernetes Operator for Vitess
Stars: ✭ 198 (+330.43%)
Mutual labels:  operator
uncontained.io
On containers, cloud, and digitial transformation
Stars: ✭ 42 (-8.7%)
Mutual labels:  container-cop
kube-code-generator
Kubernetes code generator docker image
Stars: ✭ 60 (+30.43%)
Mutual labels:  operator
chef-lita
A Chef cookbook for installing Lita.
Stars: ✭ 17 (-63.04%)
Mutual labels:  chatops
uptimerobot-operator
A Kubernetes operator that creates UptimeRobot monitors for your ingresses
Stars: ✭ 47 (+2.17%)
Mutual labels:  operator
zookeeper-operator
Kubernetes operator for deploying and managing ZooKeeper, Implement OAM framework
Stars: ✭ 18 (-60.87%)
Mutual labels:  operator
rethinkdb-operator
A Kubernetes operator to manage RethinkDB clusters.
Stars: ✭ 22 (-52.17%)
Mutual labels:  operator
group-sync-operator
Synchronizes groups from external providers into OpenShift
Stars: ✭ 73 (+58.7%)
Mutual labels:  container-cop

k8s-notify

k8s-notify is a Kubernetes Operator that sends notifications to your favorite chat system.

Supported Notifiers

A notifier is an integration with a chat system. Here are the ones we support right now.

  • Slack

  • Google Hangouts Chat

Don’t see the provider you’re looking for? Create a feature request or contribute one yourself.

Examples

Check out the examples/ directory to see some sample use cases.

Quickstart

We’re going to walk through a sample use case.

Deploy k8s notify

kubectl create namespace k8s-notify
kubectl apply -f deploy/service_account.yaml
kubectl apply -f deploy/role.yaml
kubectl apply -f deploy/role_binding.yaml
kubectl apply -f deploy/crds/event_v1_eventsubscription_crd.yaml
kubectl apply -f deploy/crds/notify_v1_notifier_crd.yaml
kubectl apply -f deploy/operator.yaml

Subscribe to an Event

k8s-notify allows you to describe a type of event and subscribe to receive notifications about it. To do this, k8s-notify provides a Custom Resource Definition called an EventSubscription. A simple one looks like this:

apiVersion: event.redhat-cop.io/v1
kind: EventSubscription
metadata:
  name: new-pod-subscription
spec:
  matchMessage: 'Created pod'
  notifier: slack-notify

Write this to a file called new-pod-subscription.yaml and create it.

kubectl apply -f new-pod-subscription.yaml

This will trigger a notification any time a new pod is created in our namespace.

Configuring Notifications

You may have noticed that the EventSubscription we created contains a reference notifier: slack-notify. In order to actually receive a notification, k8s-notify integrates with your chat provider of choice via a Custom Resource Definition called a Notifier. This Notifier can be referenced by name in an EventSubscription. Let’s create the slack-notify Notifier to send messages via Slack.

First, we’ll need to create an Incoming Webhook. Copy the URL generated to feed into our config.

A Notifier config looks like this. Make sure to paste in your webhook url.

apiVersion: notify.redhat-cop.io/v1
kind: Notifier
metadata:
  name: slack-notify
spec:
  slack:
    webhook_url: https://hooks.slack.com/services/foo/bar/baz

Write that to a file called notifier-slack.yaml and create it.

kubectl apply -f notifier-slack.yaml

Great, we’re all set up. Let’s take this sucker for a spin!

Trigger a Notification

Since our EventSubscription above triggers when a pod gets created, let’s create one.

kubectl run busybox --image=busybox

DING!

pod created

We got a message!

Contributing

We welcome contributions from the community. Feel free to open issues and pull requests.

If you’re planning to contribute, check out our developer guide.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].