👋 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!
For one thing, it's known to be syntactically correct, thanks to the wonders of CI:
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
its code. for generating READMEs.
TL;DR: helm install webhook-receiver
To configure most things, the values.yaml
file has documentation in it. For adding your own hooks, see below.
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.