Webhook Relay
Search…
Kubernetes Installation
This section includes different installation options such as a sidecar, stand-alone deployment or an operator.
Webhook Relay can help you receive webhooks for your internal services. We provide multiple options for the installation.

Option 1: Webhook Relay Operator (recommended)

Webhook Relay operator not only deploys and manages agent containers that subscribe and forward webhooks but it also configures buckets, inputs (your public endpoints) and outputs (forwarding destinations).

Install

Prerequisites:
You need to add this Chart repo to Helm:
1
helm repo add webhookrelay https://charts.webhookrelay.com
2
helm repo update
Copied!
Get access token from here. Once you click on ‘Create Token’, it will generate it and show a helper to set environment variables:
1
export RELAY_KEY=*****-****-****-****-*********
2
export RELAY_SECRET=**********
Copied!
Install through Helm:
1
helm upgrade --install webhookrelay-operator --namespace=default webhookrelay/webhookrelay-operator \
2
--set credentials.key=$RELAY_KEY --set credentials.secret=$RELAY_SECRET
Copied!

Usage

Once the operator is deployed, to start receiving webhooks you will need to create a Custom Resource (usually called just ‘CR’). It’s a short yaml file that describes your public endpoint characteristics and specifies where to forward the webhooks:
1
# cr.yaml
2
apiVersion: forward.webhookrelay.com/v1
3
kind: WebhookRelayForward
4
metadata:
5
name: example-forward
6
spec:
7
buckets:
8
- name: k8s-operator
9
inputs:
10
- name: public-endpoint
11
description: "Public endpoint, supply this to the webhook producer"
12
responseBody: "OK"
13
responseStatusCode: 200
14
outputs:
15
- name: webhook-receiver
16
destination: http://destination:5050/webhooks
Copied!
1
kubectl apply -f cr.yaml
Copied!

Uninstall

To remove the agent that is forwarding the webhooks, remove the CR that created it:
1
kubectl delete -f cr.yaml
Copied!
To remove operator, use standard Helm command to uninstall the operator.
1
helm uninstall webhookrelay-operator
Copied!

Option 2: Sidecar

First, go to https://my.webhookrelay.com/tokens and create a token key & secret pair. Then, create a Kubernetes secret:
1
kubectl create secret generic webhookrelay-credentials --from-literal=key=[access key] --from-literal=secret=[access secret]
Copied!
Once the secret is created, you can deploy Webhook Relay container either as a sidecar or a standalone container. Webhook Relay agent can be easily deployed as a sidecar. This way requests can be forwarded to the service through localhost:
1
apiVersion: apps/v1
2
kind: Deployment
3
metadata:
4
name: webhookrelay
5
labels:
6
name: webhookrelay
7
spec:
8
replicas: 1
9
selector:
10
matchLabels:
11
app: webhookrelay
12
template:
13
metadata:
14
name: webhookrelay
15
labels:
16
app: webhookrelay
17
spec:
18
containers:
19
# Your example container
20
- image: karolisr/webhook-demo:0.0.15
21
imagePullPolicy: Always
22
name: example
23
command: ["/bin/webhook-demo"]
24
ports:
25
- containerPort: 8090
26
livenessProbe:
27
httpGet:
28
path: /healthz
29
port: 8090
30
initialDelaySeconds: 30
31
timeoutSeconds: 10
32
securityContext:
33
privileged: true
34
# [START webhookrelay_container]
35
- image: webhookrelay/webhookrelayd:latest
36
name: relay
37
env:
38
- name: KEY
39
valueFrom:
40
secretKeyRef:
41
name: webhookrelay-credentials
42
key: key
43
- name: SECRET
44
valueFrom:
45
secretKeyRef:
46
name: webhookrelay-credentials
47
key: secret
48
- name: BUCKET
49
value: webhook-demo
50
# [END webhookrelay_container]
Copied!

Option 3: Separate deployment

Webhook Relay container can also work as stand-alone deployment:
1
apiVersion: apps/v1
2
kind: Deployment
3
metadata:
4
name: webhookrelay
5
labels:
6
app: webhookrelay
7
spec:
8
replicas: 1
9
selector:
10
matchLabels:
11
app: webhookrelay
12
release: webhookrelay
13
template:
14
metadata:
15
labels:
16
app: webhookrelay
17
release: webhookrelay
18
spec:
19
containers:
20
- name: webhookrelayd
21
image: webhookrelay/webhookrelayd:latest
22
env:
23
- name: KEY
24
valueFrom:
25
secretKeyRef:
26
name: webhookrelay-credentials
27
key: key
28
- name: SECRET
29
valueFrom:
30
secretKeyRef:
31
name: webhookrelay-credentials
32
key: secret
33
- name: BUCKET
34
value: webhook-demo
Copied!
If agent is deployed as a separate deployment, the output destination should then be a service name. Repository can be found here: https://github.com/webhookrelay/webhook-demo.

Option 4: Ingress Controller

Implements a Kubernetes ingress controller using tunnels to connect a Web Relay managed URL (https://yoursubdomain.webrelay.io) to a Kubernetes service based on ingress resources. Single ingress controller can manage multiple tunnels and route to multiple namespaces.
Deployment files and issue tracker is available on GitHub:
You can try out Web Relay ingress controller by creating a deployment from a hosted manifest, no clone or local install necessary.
What you do need:
    A Kubernetes cluster that has access to the Internet
    kubectl configured with admin access to your cluster
    relay CLI, installation instructions can be found here

Install

To add Web Relay ingress controller to your cluster, run:
1
relay ingress init
Copied!
This command:
    Creates webrelay-ingress namespace
    Creates webrelay service account
    Creates deployment with the controller
    Creates cluster role and binding
    Generates access key and secret for the Web Relay server and supplies them as a Kubernetes secret
If RBAC isn’t enabled on your cluster (for example, if you’re on GKE with legacy authorization or Minikube without RBAC), run:
1
relay ingress init --no-rbac
Copied!
You can also generate tokens through the Web UI here https://my.webhookrelay.com/tokens or relay token create command on the CLI.

Uninstall Ingress Controller

To remove it, either delete the namespace where it was deployed or use:
1
relay ingress reset
Copied!
Last modified 4mo ago