Skip to content

geek-cookbook/helm-webhook-receiver

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

50 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

geek-cookbook Discord Forums Cookbook Twitch Status

👋 Welcome, traveller!

The Geek Cookbook is a collection of geek-friendly "recipes" to run popular applications on Docker Swarm or Kubernetes, in a progressive, easy-to-follow format. Come and join us, fellow geeks! :neckbeard:

Contents

  1. What is this?
  2. How to use it?

Why should I use this chart?

For one thing, it's known to be syntactically correct, thanks to the wonders of CI:

Linting Testing

How to use it?

Use helm to add the repo:

helm repo add geek-cookbook https://geek-cookbook.github.io/charts/

Then simply install using helm, for example

kubectl create namespace webhook-receiver
helm upgrade --install --namespace webhook-receiver geek-cookbook/webhook-receiver

What is this?

its code. for generating READMEs.

How to use it?

TL;DR: helm install webhook-receiver

Configuring

To configure most things, the values.yaml file has documentation in it. For adding your own hooks, see below.

Adding Custom Hooks

Adding custom hooks can be done through the a custom values file.

To do so, create a new item on the hooks map. In here you need to add 3 fields; enable, files and hook.

Enable is self explaintory: Does this webhook run when queried?

Files is where you place all files required for this hook to run. This is a map, with the key being the path to mount it do, and the value being the file contents.

Finally is the hook field, this is where you put in your hook configuration as per the spec from the application docs

Below is an example of a values.yaml file

# my-custom-values.yaml
hooks:
  myhook:
    enable: true
    files:
      /data/helloworld.sh: |
        #!/bin/sh
        echo "Hello World!"
    hook:
      id: helloworld
      execute-command: /data/helloworld.sh

Now you are ready to install this helm chart onto your kubernetes cluster.

helm upgrade --install webhooks funkypenguin/webhook-receiver -f my-custom-values.yaml

If you want to use an existing file, you can pass it in as follows

helm upgrade --install webhooks funkypenguin/webhook-receiver -f my-custom-values.yaml \
    --set-file hooks.myhoook.files./data/helloworld%sh=myfile.sh

This will load myfile.sh into the /data/helloworld.sh file.

Note that % is replaced by ., as it could be confused with the key selector. Make sure you aren't overriding a key in your values files, unless it uses the same % notation.