• Stars
    star
    134
  • Rank 270,967 (Top 6 %)
  • Language
    Go
  • License
    MIT License
  • Created over 5 years ago
  • Updated over 1 year ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

A wrapper for applications to help with running envoy as a sidecar

envoy-preflight

envoy-preflight is a simple wrapper application which makes it easier to run applications which depend on envoy as a sidecar container for outside network access. It ensures that your application doesn't start until envoy is ready, and that envoy shuts down when the application exits. It is best used as a prefix to your existing Docker entrypoint. It executes any argument passed to it, doing a simple path lookup:

envoy-preflight echo "hi"
envoy-preflight /bin/ls -a

The envoy-preflight wrapper won't do anything special unless you provide at least the ENVOY_ADMIN_API environment variable. This makes, e.g., local development of your app easy.

If you do provide the ENVOY_ADMIN_API environment variable, envoy-preflight will poll the proxy indefinitely with backoff, waiting for Envoy to report itself as live. This implies it has loaded cluster configuration (for example from an ADS server). Only then will it execute the command provided as an argument, so that your app can immediately start accessing the outside network.

All signals are passed to the underlying application. Be warned that SIGKILL cannot be passed, so this can leave behind a orphaned process.

When the application exits, as long as it does so with exit code 0, envoy-preflight will instruct envoy to shut down immediately.

Environment variables

Variable Purpose
ENVOY_ADMIN_API This is the path to envoy's administration interface, in the format http://127.0.0.1:9010. If provided, envoy-preflight will poll this url at /server_info waiting for envoy to report as LIVE. If provided and local (127.0.0.1 or localhost), then envoy will be instructed to shut down if the application exits cleanly.
ENVOY_KILL_API This is the endpoint of the POST command to kill envoy, which defaults to $ENVOY_ADMIN_API/quitquitquit, but you can provide any value in format http://127.0.0.1:9010/quitquitquit. This can be used to support istio by providing the pilot-agent port.
NEVER_KILL_ENVOY If provided and set to true, envoy-preflight will not instruct envoy to exit under any circumstances.
ALWAYS_KILL_ENVOY If provided and set to true, envoy-preflight will instruct envoy to exit, even if the main application exits with a nonzero exit code.
START_WITHOUT_ENVOY If provided and set to true, envoy-preflight will not wait for envoy to be LIVE before starting the main application. However, it will still instruct envoy to exit.

More Repositories

1

response

Monzo's real-time incident response and reporting tool ⚑️
JavaScript
1,460
star
2

typhon

A wrapper around Go's net/http to provide safety and convenience. At Monzo, Typhon forms the basis of most clients and servers in our microservices platform.
Go
713
star
3

phosphor

Distributed System Tracing in Go
Go
375
star
4

progression-framework

The Monzo Progression Framework site, built with Gatsby.
JavaScript
291
star
5

egress-operator

A Kubernetes operator to produce egress gateway Envoy pods and control access to them with network policies
Go
233
star
6

docs

Public API documentation
SCSS
101
star
7

calico-accountant

A Prometheus exporter for Calico policy packet counts
Go
87
star
8

terrors

Go
71
star
9

ddbt

Dom's Data Build Tool
Go
70
star
10

file-cleaner

JavaScript
64
star
11

etcd3-terraform

A Terraform recipe for a robust etcd cluster, based on how Monzo runs its clusters. πŸ’ͺ
HCL
46
star
12

slog

Structured logging
Go
46
star
13

mondo-ruby

Ruby Client
Ruby
45
star
14

reference-receipts-app

A simple Monzo third party API client for demonstrating the new Receipts API.
Python
19
star
15

web-exercise

Take-home exercise for web engineer hiring πŸš€
11
star
16

kotlin-synthetics-migrator

An Intellij Plugin for migrating an Android app from Kotlin Synthetics to findById
Kotlin
10
star
17

kontrast

Go
10
star
18

phosphord

Trace Forwarding Daemon
Go
9
star
19

phosphor-go

Go client for Phosphor
Go
7
star
20

vault-plugin-database-k8s-controller

A fork of Vault's database credential plugin allowing the use of annotations on service accounts as parameters in statements
Go
7
star
21

etcd3-bootstrap

Bootstraps an etcd3 cluster node
Go
6
star
22

drbd9_exporter

Exports status and metrics of DRBD 9.0 volumes
Go
6
star
23

code-of-conduct

The Monzo Community Code of Conduct
5
star
24

verifiedsms

A go library for interacting with Google Verified SMS
Go
3
star
25

file-score

JavaScript
3
star
26

web-code-test-server

Server for the frontend web dev code test in our interview process
JavaScript
2
star
27

gosquared

A golang gosquared client
Go
2
star
28

Judo-Swift

Judo Swift SDK for Swift 2.0/Xcode 7
Swift
2
star
29

guepacket

GUE (Generic UDP Encapsulation) layer for gopacket πŸ“¦
Go
2
star
30

CHCSVParser

Objective-C
1
star
31

libPhoneNumber-iOS

Objective-C
1
star