https://github.com/fusakla/k8s-service-broadcasting
Tool allowing to broadcast/mirror/duplicate HTTP requests to all ready endpoints of a Kubernetes service.
https://github.com/fusakla/k8s-service-broadcasting
broadcast http kubernetes proxy traffic-mirroring
Last synced: about 1 year ago
JSON representation
Tool allowing to broadcast/mirror/duplicate HTTP requests to all ready endpoints of a Kubernetes service.
- Host: GitHub
- URL: https://github.com/fusakla/k8s-service-broadcasting
- Owner: FUSAKLA
- License: apache-2.0
- Created: 2020-01-26T20:24:32.000Z (over 6 years ago)
- Default Branch: master
- Last Pushed: 2020-01-27T22:59:04.000Z (over 6 years ago)
- Last Synced: 2025-04-14T22:56:06.925Z (about 1 year ago)
- Topics: broadcast, http, kubernetes, proxy, traffic-mirroring
- Language: Go
- Homepage:
- Size: 18.6 MB
- Stars: 6
- Watchers: 3
- Forks: 2
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
Awesome Lists containing this project
README
# K8s service broadcasting
[](https://app.circleci.com/github/FUSAKLA/k8s-service-broadcasting/pipelines?branch=master)
[](https://hub.docker.com/repository/docker/fusakla/k8s-service-broadcasting)
Tool allowing to broadcast/mirror/duplicate HTTP requests to all ready endpoints of a Kubernetes service.
It supports two modes:
- _Consistency_: Waits for response from all service endpoints and and response with one of erroneous response otherwise one of the succeeded.
- _Availability_: Responses with first successful response if any, otherwise with one of the error messages.
This behaviour can be controlled by the `--all-must-succeed` flag. Defaults to `true`.
## Usage
```bash
$ ./k8s-service-broadcasting --help
Tool allowing to broadcast/mirror/duplicate HTTP requests to all endpoints of Kubernetes service.
Waits for all of them to end and reports back failed request if any. If not returns last successful.
Usage:
k8s-service-broadcasting [flags]
Flags:
--all-must-succeed By default if any backend fails, the whole request fails. If disabled one succeeded response is enough. (default true)
-h, --help help for k8s-service-broadcasting
-i, --interface string Interface to listen on. (default "0.0.0.0:8080")
--keepalive If keepalive should be enabled. (default true)
-k, --kubeconfig string Location of the kubeconfig, default if in cluster config or value of KUBECONFIG env variable. (default "/home/fusakla/.kube/conf/kubeconfig.yaml")
-l, --log-level string Log level (debug, info, warning, ...) default info. (default "info")
-m, --metrics-interface string Interface for exposing metrics. (default "0.0.0.0:8081")
-n, --namespace string Namespace to watch for.
-p, --port-name string Name of service port to sed the requests to.
-s, --service string Name of service to sed the requests to.
-t, --timeout duration Timeout for mirrored requests. (default 10s)
```
## Instrumentation
There is second interface for exposing Prometheus metrics and providing lifecycle endpoints.
This interface is running by default on `0.0.0.0:8081`. The endpointa are:
- `/metrics` Prometheus metrics
- `/-/healthy` liveness probe
- `/-/ready` readiness probe
## Build
**single binary**
```bash
make build
```
## Deployment
See the [`kubernetes/`](./kubernetes) folder with example.