Coder Social home page Coder Social logo

doodlescheduling / webhook-controller Goto Github PK

View Code? Open in Web Editor NEW
0.0 1.0 0.0 185 KB

Proxy for duplicating HTTP requests to multiple targets

License: Apache License 2.0

Dockerfile 0.47% Makefile 17.06% Go 77.35% Mustache 5.12%
http-proxy kubernetes-controller webhooks http-duplicator request-clone

webhook-controller's Introduction

webhook-controller - Proxy for duplicating incoming webhooks to multiple targets

release release report Coverage Status license

This HTTP proxy duplicates incoming requests and sends concurrently to multiple targets. The response will be HTTP 202 Accepted if at least one matching target was found. The responses from the targets are not exposed to upstream by design.

Why?

This proxy is especially useful for handling incoming webhooks which need to be distributed to multiple targets. However it can be used for any other use case where a request needs to be duplicated.

Example RequestClone

These two targets both match webhook-receiver.example.com, meaning any incoming request will be sent to both endpoints. In this case to webhook-receiver-app-1:80 and webhook-receiver-app-2:80.

apiVersion: proxy.infra.doodle.com/v1beta1
kind: RequestClone
metadata:
  name: webhook-receiver
  namespace: apps
spec:
  host: webhook-receiver.example.com
  backend:
    serviceName: webhook-receiver-app-1
    servicePort: http
---
apiVersion: proxy.infra.doodle.com/v1beta1
kind: RequestClone
metadata:
  name: webhook-receiver
  namespace: apps
spec:
  host: webhook-receiver.example.com
  backend:
    serviceName: webhook-receiver-app-2
    servicePort: http

North south routing looks like this:

                                                                      
                                => Ingress controller proxy =>          => webhook-receiver-app-1:80
              client                                            webhook      
[webhook-receiver.example.com]  <=                          <=          => webhook-receiver-app-2:80
                                          202 Accepted

Setup

The proxy should not be exposed directly to the public. Rather should traffic be routed via an ingress controller and only hosts which are used to duplicate requests should be routed via this proxy.

Helm chart

Please see chart/webhook-controller for the helm chart docs.

Manifests/kustomize

Alternatively you may get the bundled manifests in each release to deploy it using kustomize or use them directly.

Configure the controller

The controller can be configured using cmd args:

--concurrent int                            The number of concurrent Pod reconciles. (default 4)
--enable-leader-election                    Enable leader election for controller manager. Enabling this will ensure there is only one active controller manager.
--graceful-shutdown-timeout duration        The duration given to the reconciler to finish before forcibly stopping. (default 10m0s)
--health-addr string                        The address the health endpoint binds to. (default ":9557")
--http-addr string                          The address of http server binding to. (default ":8080")
--insecure-kubeconfig-exec                  Allow use of the user.exec section in kubeconfigs provided for remote apply.
--insecure-kubeconfig-tls                   Allow that kubeconfigs provided for remote apply can disable TLS verification.
--kube-api-burst int                        The maximum burst queries-per-second of requests sent to the Kubernetes API. (default 300)
--kube-api-qps float32                      The maximum queries-per-second of requests sent to the Kubernetes API. (default 50)
--leader-election-lease-duration duration   Interval at which non-leader candidates will wait to force acquire leadership (duration string). (default 35s)
--leader-election-release-on-cancel         Defines if the leader should step down voluntarily on controller manager shutdown. (default true)
--leader-election-renew-deadline duration   Duration that the leading controller manager will retry refreshing leadership before giving up (duration string). (default 30s)
--leader-election-retry-period duration     Duration the LeaderElector clients should wait between tries of actions (duration string). (default 5s)
--log-encoding string                       Log encoding format. Can be 'json' or 'console'. (default "json")
--log-level string                          Log verbosity level. Can be one of 'trace', 'debug', 'info', 'error'. (default "info")
--max-retry-delay duration                  The maximum amount of time for which an object being reconciled will have to wait before a retry. (default 15m0s)
--metrics-addr string                       The address the metric endpoint binds to. (default ":9556")
--min-retry-delay duration                  The minimum amount of time for which an object being reconciled will have to wait before a retry. (default 750ms)
--otel-endpoint string                      Opentelemetry gRPC endpoint (without protocol)
--otel-insecure                             Opentelemetry gRPC disable tls
--otel-service-name string                  Opentelemetry service name (default "k8skeycloak-controller")
--otel-tls-client-cert-path string          Opentelemetry gRPC mTLS client cert path
--otel-tls-client-key-path string           Opentelemetry gRPC mTLS client key path
--otel-tls-root-ca-path string              Opentelemetry gRPC mTLS root CA path
--proxy-read-timeout duration               Read timeout for proxy requests. (default 10s)
--proxy-write-timeout duration              Write timeout for proxy requests. (default 10s)
--watch-all-namespaces                      Watch for resources in all namespaces, if set to false it will only watch the runtime namespace. (default true)
--watch-label-selector string               Watch for resources with matching labels e.g. 'sharding.fluxcd.io/shard=shard1'.

webhook-controller's People

Contributors

raffis avatar renovate[bot] avatar

Watchers

 avatar

webhook-controller's Issues

Dependency Dashboard

This issue lists Renovate updates and detected dependencies. Read the Dependency Dashboard docs to learn more.

Pending Status Checks

These updates await pending status checks. To force their creation now, click the checkbox below.

  • chore(deps-dev): update docker/login-action action to v3.2.0

Open

These updates have all been created already. Click a checkbox below to force a retry/rebase of any.

Detected dependencies

dockerfile
Dockerfile
github-actions
.github/workflows/main.yaml
  • step-security/harden-runner v2.8.0@f086349bfa2bd1361f7909c78558e816508cdc10
  • actions/checkout v3@8f4b7f84864484a7bf31766abe9204da3cbe65b3
  • actions/setup-go v4.1.0@93397bea11091df50f3d7e59dc26a7711a8bcfbe
  • actions/cache v3.3.3@e12d46a63a90f2fae62d114769bbf2a179198b5c
  • shogo82148/actions-goveralls v1.9.0@785c9d68212c91196d3994652647f8721918ba11
.github/workflows/pr-build.yaml
  • step-security/harden-runner v2.8.0@f086349bfa2bd1361f7909c78558e816508cdc10
  • actions/checkout v3@c85c95e3d7251135ab7dc9ce3241c5835cc595a9
  • azure/setup-helm v3.5@5119fcb9089d432beecbf79bb2c7915207344b78
  • actions/setup-python v4.8.0@b64ffcaf5b410884ad320a9cfac8866006a109aa
  • helm/chart-testing-action v2.6.1@e6669bcd63d7cb57cb4380c33043eebe5d111992
  • step-security/harden-runner v2.8.0@f086349bfa2bd1361f7909c78558e816508cdc10
  • actions/checkout v3@c85c95e3d7251135ab7dc9ce3241c5835cc595a9
  • actions/setup-go v4.1.0@93397bea11091df50f3d7e59dc26a7711a8bcfbe
  • actions/cache v3.3.3@e12d46a63a90f2fae62d114769bbf2a179198b5c
  • step-security/harden-runner v2.8.0@f086349bfa2bd1361f7909c78558e816508cdc10
  • actions/checkout v3@c85c95e3d7251135ab7dc9ce3241c5835cc595a9
  • actions/setup-go v4.1.0@93397bea11091df50f3d7e59dc26a7711a8bcfbe
  • actions/cache v3.3.3@e12d46a63a90f2fae62d114769bbf2a179198b5c
  • step-security/harden-runner v2.8.0@f086349bfa2bd1361f7909c78558e816508cdc10
  • actions/checkout v3@c85c95e3d7251135ab7dc9ce3241c5835cc595a9
  • actions/setup-go v4.1.0@93397bea11091df50f3d7e59dc26a7711a8bcfbe
  • actions/cache v3.3.3@e12d46a63a90f2fae62d114769bbf2a179198b5c
  • actions/upload-artifact v3.1.3@a8a3f3ad30e3422c9c7b888a15615d19a852ae32
  • step-security/harden-runner v2.8.0@f086349bfa2bd1361f7909c78558e816508cdc10
  • actions/checkout v3@c85c95e3d7251135ab7dc9ce3241c5835cc595a9
  • actions/setup-go v4.1.0@93397bea11091df50f3d7e59dc26a7711a8bcfbe
  • engineerd/setup-kind v0.5.0@aa272fe2a7309878ffc2a81c56cfe3ef108ae7d0
  • actions/download-artifact v3.0.2@9bc31d5ccc31df68ecc42ccf4149144866c47d8a
  • imranismail/setup-kustomize v2.1.0@2ba527d4d055ab63514ba50a99456fc35684947f
  • step-security/harden-runner v2.8.0@f086349bfa2bd1361f7909c78558e816508cdc10
  • actions/checkout v3@c85c95e3d7251135ab7dc9ce3241c5835cc595a9
  • azure/setup-helm v3.5@5119fcb9089d432beecbf79bb2c7915207344b78
  • actions/setup-python v4.8.0@b64ffcaf5b410884ad320a9cfac8866006a109aa
  • helm/chart-testing-action v2.6.1@e6669bcd63d7cb57cb4380c33043eebe5d111992
  • helm/kind-action v1.10.0@0025e74a8c7512023d06dc019c617aa3cf561fde
  • actions/download-artifact v3.0.2@9bc31d5ccc31df68ecc42ccf4149144866c47d8a
.github/workflows/pr-label.yaml
  • step-security/harden-runner v2.8.0@f086349bfa2bd1361f7909c78558e816508cdc10
  • pascalgn/size-label-action 1619680c5ac1ef360b944bb56a57587ba4aa2af8
.github/workflows/rebase.yaml
  • step-security/harden-runner v2.8.0@f086349bfa2bd1361f7909c78558e816508cdc10
  • actions/checkout v3@755da8c3cf115ac066823e79a1e1788f8940201b
  • cirrus-actions/rebase 1.8@b87d48154a87a85666003575337e27b8cd65f691
.github/workflows/release.yaml
  • step-security/harden-runner v2.8.0@f086349bfa2bd1361f7909c78558e816508cdc10
  • actions/checkout v4@8ade135a41bc03ea155e62e844d188df1ea18608
  • actions/setup-go v4.1.0@93397bea11091df50f3d7e59dc26a7711a8bcfbe
  • docker/login-action v3.1.0@e92390c5fb421da1463c202d546fed0ec5c39f20
  • sigstore/cosign-installer v3.5.0@59acb6260d9c0ba8f4a2f9d9b48431a222b68e20
  • anchore/sbom-action v0.16.0@e8d2a6937ecead383dfe75190d104edd1f9c5751
  • goreleaser/goreleaser-action v5.1.0@5742e2a039330cbb23ebf35f046f814d4c6ff811
  • step-security/harden-runner v2.8.0@f086349bfa2bd1361f7909c78558e816508cdc10
  • actions/checkout v4@8ade135a41bc03ea155e62e844d188df1ea18608
  • azure/setup-helm v3.5@5119fcb9089d432beecbf79bb2c7915207344b78
  • sigstore/cosign-installer v3.5.0@59acb6260d9c0ba8f4a2f9d9b48431a222b68e20
.github/workflows/scan.yaml
  • step-security/harden-runner v2.8.0@f086349bfa2bd1361f7909c78558e816508cdc10
  • actions/checkout v3@8e5e7e5ab8b370d6c329ec480221332ada57f0ab
  • fossa-contrib/fossa-action v2.0.0@6728dc6fe9a068c648d080c33829ffbe56565023
  • step-security/harden-runner v2.8.0@f086349bfa2bd1361f7909c78558e816508cdc10
  • actions/checkout v3@8e5e7e5ab8b370d6c329ec480221332ada57f0ab
  • github/codeql-action codeql-bundle-20221020@dc046388f30eacf938aadd32064285f437bd9c04
  • github/codeql-action codeql-bundle-20221020@dc046388f30eacf938aadd32064285f437bd9c04
  • github/codeql-action codeql-bundle-20221020@dc046388f30eacf938aadd32064285f437bd9c04
gomod
go.mod
  • go 1.20
  • github.com/fluxcd/pkg/runtime v0.42.0
  • github.com/go-logr/logr v1.4.2
  • github.com/onsi/gomega v1.33.1
  • github.com/spf13/pflag v1.0.5
  • go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.37.0
  • go.opentelemetry.io/otel v1.11.2
  • go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracegrpc v1.11.2
  • go.opentelemetry.io/otel/sdk v1.11.2
  • google.golang.org/grpc v1.64.0
  • k8s.io/api v0.27.4
  • k8s.io/apimachinery v0.27.4
  • k8s.io/client-go v0.27.4
  • sigs.k8s.io/controller-runtime v0.15.1
helm-values
chart/webhook-controller/values.yaml
  • quay.io/brancz/kube-rbac-proxy v0.17.1
kustomize
config/base/manager/kustomization.yaml
  • ghcr.io/doodlescheduling/webhook-controller v0.1.1

  • Check this box to trigger a request for Renovate to run again on this repository

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.