Production Deployment

Production deployment usually doesn’t differ much from the development workflows. We do, however, recommend to choose relayd agent which can run as Docker container. Since relayd is compiled to a binary and doesn’t have any dependencies, it could be used standalone as well.

Docker

docker run --name webhookrelayd --restart always -d webhookrelay/webhookrelayd:latest -k [your access key] -s [your secret key]

Then, you can check the logs by:

docker logs webhookrelayd
{"level":"info","ts":1530829178.7462187,"msg":"webhook relay ready...","host":"my.webhookrelay.com:8080"}

Kubernetes

Webhook Relay agent is a perfect sidecar for your application. Since it creates an outgoing tunnel and relays webhooks only to localhost, it can be regarded as one of the safest ways to receive webhooks from other systems.

Our relay CLI tool can help with generating authentication credentials. We will reuse out ingress controller’s functionality:

$ relay ingress secret --name webhookrelay-credentials --namespace keel
secret "webhookrelay-credentials" created

Here is an example of webhookrelayd running as a sidecar container to an application that relies on webhooks:

apiVersion: extensions/v1beta1
kind: Deployment
metadata:
name: keel
namespace: keel
labels:
name: "keel"
spec:
replicas: 1
template:
metadata:
name: keel
labels:
app: keel
spec:
serviceAccountName: keel
containers:
# [START webhookrelay_container]
- image: webhookrelay/webhookrelayd:latest
name: webhookrelayd
env:
- name: KEY
valueFrom:
secretKeyRef:
name: webhookrelay-credentials
key: key
- name: SECRET
valueFrom:
secretKeyRef:
name: webhookrelay-credentials
key: secret
- name: BUCKET
value: dockerhub
# [END webhookrelay_container]
- image: keelhq/keel:0.9.3
imagePullPolicy: Always
env:
- name: NAMESPACE
valueFrom:
fieldRef:
fieldPath: metadata.namespace
name: keel
command: ["/bin/keel"]
ports:
- containerPort: 9300
livenessProbe:
httpGet:
path: /healthz
port: 9300
initialDelaySeconds: 30
timeoutSeconds: 10

Raspberry Pi

Raspberry Pi is a popular and affordable computer that you can use to learn programming, automate tasks at home or just run a web server. Webhook Relay offers an ARM based Docker image that you can use on a Raspberry Pi (or any other similar device).

An easiest way to deploy webhookrelayd agent on your Raspberry Pi is to use docker. Full article on it can be found here. To install it, simply:

curl -sSL https://get.docker.com | sh

Use token key and secret (get token from https://my.webhookrelay.com/tokens) to start webhookrelayd container:

# to run in a standard webhook forwarding way (will forward any webhooks that hit 'rpi' bucket)
docker run --name whr-relayd --net host --restart always -d webhookrelay/webhookrelayd-arm:latest --bucket rpi -k your-key -s your-secret
# to start a bidirectional tunnel
docker run --name whr-relayd --net host --restart always -d webhookrelay/webhookrelayd-arm:latest --mode tunnel -t rpi -k your-key -s your-secret