k8s-service-broadcasting

command module
v0.1.1-0...-6450adf Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jan 27, 2020 License: Apache-2.0 Imports: 1 Imported by: 0

README

K8s service broadcasting

CircleCI Docker Pulls

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

$ ./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

make build

Deployment

See the kubernetes/ folder with example.

Documentation

The Go Gopher

There is no documentation for this package.

Directories

Path Synopsis
pkg

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL