HUB
Sign inSign up

taemon1337/senvoy

By taemon1337

•Updated almost 4 years ago

Image
0

2.7K

taemon1337/senvoy repository overview

⁠Simple Envoy TLS Sidecar

A simple wrapper container around Envoy that eases configuration and delegates to Envoy for a simple TLS sidecar proxy.

⁠Rationale

The Envoy Proxy is a very robust, well-proven piece of proxy technology and it supports all major protocols, features, bells, whistles, etc. This is also an issue when being deployed in a simple configuration (such as a TLS sidecar) where you just want a robust and simple proxy up and running fast without the config headache hassel.

This project gives you the best of both worlds, up and running fast with hardened, production ready proxy.

⁠Usage

  docker pull taemon1337/senvoy:latest
  docker run --rm -it -p 8443:8443 taemon1337/senvoy:latest

The following will set the listener port via environment variable and cli arg

  docker run --rm -it -p 8443:8443 -e LISTEN_PORT=8443 taemon1337/senvoy:latest
  docker run --rm -it -p 8443:8443 taemon1337/senvoy:latest --listen-port 8443

A more live/production usage may look something like this:

  export CERT_DIR=/etc/tls/certs
  export KEY_DIR=/etc/tls/private
  export PROD_CERT=prod.crt
  export PROD_KEY=prod.key
  docker run --rm -it -p 8443:8443 \
    -v ${CERT_DIR}:${CERT_DIR}:ro \
    -v ${KEY_DIR}:${KEY_DIR}:ro \
    taemon1337/senvoy:latest \
    --cert-file ${CERT_DIR}/${PROD_CERT} \
    --key-file ${KEY_DIR}${PROD_KEY} \
    --listen-port 8443 \
    --upstream-port 80

The following environment variables with their defaults which can be overridden are shown below:

Environment VariableCommand Line optionDefault Value
ENVOY_HOME/var/run/envoy
ENVOY_TEMPLATE--envoy-template/usr/local/src/envoy.tmpl
ENVOY_CONFIG--envoy-config/var/run/envoy/envoy.yaml
ENVOY_CERTS--envoy-certs/var/run/envoy/certs
LISTEN_ADDRESS--listen-addr0.0.0.0
LISTEN_PORT--listen-port8443
UPSTREAM_ADDRESS--upstream-addr127.0.0.1
UPSTREAM_PORT--upstream-port8080
UPSTREAM_SNI--upstream-sni""
UPSTREAM_TLS--upstream-tlsfalse
PATH_PREFIX--path-prefix/
PREFIX_REWRITE--prefix-rewrite/
METRICS_ADDRESS--metrics-addr0.0.0.0
METRICS_PORT--metrics-port8082
CONNECT_TIMEOUT--connect-timeout0.25s
HOSTNAME--hostnamelocalhost
CERT_DAYS--cert-days365
CERT_RSABITS--cert-rsa-bits4096
CERT_FILE--cert-file/home/envoy/server.crt
KEY_FILE--key-file/home/envoy/server.key
REQUIRE_CLIENT_CERT--require-client-certfalse
ALLOW_SAN--allow-san""
ALLOW_SAN_MATCHER--allow-san-matcherexact

⁠Docker entrypoint wrapper

The run.sh script performs the following steps:

  1. Generates self-signed TLS certificates (if the CERT_FILE|--cert-file does not exist)
  2. Generates an Envoy static config and writes it to disk
  3. Calls the original Envoy docker-entrypoint.sh with the --config-path <generated-envoy-config> and any additional options you pass through

Tag summary

Content type

Image

Digest

sha256:546ed031e…

Size

50.1 MB

Last updated

about 4 years ago

docker pull taemon1337/senvoy