A repo containing examples of how to manage kubernetes events with kubeless
Switch branches/tags
Nothing to show
Clone or download
Permalink
Failed to load latest commit information.
events Initial commit for events Oct 16, 2018
functions Add slack output example Oct 16, 2018
manifests Add slack output example Oct 16, 2018
.gitignore Initial commit Oct 16, 2018
LICENSE Initial commit Oct 16, 2018
README.md Add events running locally Oct 16, 2018

README.md

kubeless-events-example

A repo containing examples of how to manage kubernetes events with kubeless

This repo is designed to accompany this blog post, explaining the thought process and how it works

Running Locally

The events pipeline can be run locally, assuming you have a NATS cluster deployed to your cluster:

kubectl port-forward svc/nats-cluster 4222:4222 -n nats-io
python events.py -a localhost:4222

Docker Image

A docker image for the event publishing code has been pushed to jaxxstorm/kubernetes-events:latest. You can run this using the manifest in the manifests directory.

Kubeless Function

To run the Kubeless function, use the kubeless CLI and set the environment variables like so:

kubeless function deploy slack --runtime python3.6 --handler slack.slack_message --from-file functions/slack.py -n kubeless --env SLACK_TOKEN=<xoxb-token> --env SLACK_CHANNEL=<channel> --dependencies functions/requirements.txt