Skip to content

Commit

Permalink
Enable helm overrides for envoy command line arguments (#1741)
Browse files Browse the repository at this point in the history
* Enable helm overrides for envoy command line arguments
* Fix go templating
* Remove unneeded files
* Add docs
* changelog
* changelogs
* fix docs
* Add changelog
* Update changelog/v1.1.0/envoy-command-line-args.yaml

Co-Authored-By: Graham Goudeau <[email protected]>
* Address code review comments
  • Loading branch information
ashleywang1 authored and soloio-bulldozer[bot] committed Nov 21, 2019
1 parent cfb5d68 commit 8a653ee
Show file tree
Hide file tree
Showing 6 changed files with 59 additions and 3 deletions.
7 changes: 7 additions & 0 deletions changelog/v1.1.0/envoy-command-line-args.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
changelog:
- type: NEW_FEATURE
description: Add the Helm field `.Values.gatewayProxies.gatewayProxy.extraEnvoyArgs` so users can add additional envoy command line arguments (e.g. --set component-log-level="...", to set log levels for individual envoy components). See the full list of Envoy command line args here - https://www.envoyproxy.io/docs/envoy/latest/operations/cli
issueLink: https://github.com/solo-io/gloo/issues/1737
- type: HELM
description: Add the Helm field `extraEnvoyArgs` to .Values.gatewayProxies.gatewayProxy so users can add additional envoy command line arguments (e.g. --component-log-level "upstream:trace,misc:error", to set log levels for individual envoy components). See the full list of Envoy command line args here - https://www.envoyproxy.io/docs/envoy/latest/operations/cli
issueLink: https://github.com/solo-io/gloo/issues/1737
41 changes: 41 additions & 0 deletions docs/content/advanced_configuration/gateway-proxy-config.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
---
title: Envoy Bootstrap Configuration
weight: 60
description: Bootstrap configuration for Envoy
---

## Configuring Envoy

Envoy's [bootstrap configuration](https://www.envoyproxy.io/docs/envoy/latest/configuration/overview/v2_overview#bootstrap-configuration)
can be done in two ways: 1) with a configuration file that we represent as the config map `gateway-proxy-envoy-config`
and 2) with command-line arguments that we pass in to the `gateway-proxy` pod.

You do not need to set either of these manually - gloo has default settings for both in its Helm chart.

### Configuration File

The Helm value that overrides our default bootstrap configuration is `gatewayProxies.$PROXY_NAME.configMap`. To see an example config map, look no further than [Envoy's configuration documentation](https://www.envoyproxy.io/docs/envoy/latest/configuration/overview/v2_overview#bootstrap-configuration).

To see the entire list of Gloo Helm Overrides, see our [list of Helm Chart values](../../installation/gateway/kubernetes/#list-of-gloo-helm-chart-values).

### Command-line Arguments

The Helm value that sets additional Envoy command line arguments is `gatewayProxies.NAME.extraEnvoyArgs`.
To see a list of available Envoy command line arguments, see their [latest command line documentation](https://www.envoyproxy.io/docs/envoy/latest/operations/cli).

{{% notice note %}}
We will always set `--disable-hot-restart` regardless of any value provided to `extraEnvoyArgs`.
{{% /notice %}}

An example `values.yaml` file that you could pass in to configure Envoy is:
```
gatewayProxies:
gatewayProxy:
extraEnvoyArgs:
- component-log-level
- upstream:debug,connection:trace
```

This sets the log levels of individual Envoy components - setting the upstream log levels to `debug`
and the `connection` component's log level to `trace`.

2 changes: 2 additions & 0 deletions docs/content/installation/gateway/kubernetes/values.txt
Original file line number Diff line number Diff line change
Expand Up @@ -132,6 +132,7 @@
|gatewayProxies.NAME.gatewaySettings.useProxyProto|bool||use proxy protocol|
|gatewayProxies.NAME.gatewaySettings.customHttpGateway|string||custom yaml to use for http gateway settings|
|gatewayProxies.NAME.gatewaySettings.customHttpsGateway|string||custom yaml to use for https gateway settings|
|gatewayProxies.NAME.envoyArgs[]|string||envoy container args|
|gatewayProxies.NAME.extraContainersHelper|string|||
|gatewayProxies.NAME.extraInitContainersHelper|string|||
|gatewayProxies.NAME.extraVolumeHelper|string|||
Expand Down Expand Up @@ -182,6 +183,7 @@
|gatewayProxies.gatewayProxy.gatewaySettings.useProxyProto|bool|false|use proxy protocol|
|gatewayProxies.gatewayProxy.gatewaySettings.customHttpGateway|string||custom yaml to use for http gateway settings|
|gatewayProxies.gatewayProxy.gatewaySettings.customHttpsGateway|string||custom yaml to use for https gateway settings|
|gatewayProxies.gatewayProxy.envoyArgs[]|string||envoy container args|
|gatewayProxies.gatewayProxy.extraContainersHelper|string|||
|gatewayProxies.gatewayProxy.extraInitContainersHelper|string|||
|gatewayProxies.gatewayProxy.extraVolumeHelper|string|||
Expand Down
1 change: 1 addition & 0 deletions install/helm/gloo/generate/values.go
Original file line number Diff line number Diff line change
Expand Up @@ -188,6 +188,7 @@ type GatewayProxy struct {
Service *GatewayProxyService `json:"service,omitempty"`
Tracing *Tracing `json:"tracing,omitempty"`
GatewaySettings *GatewayProxyGatewaySettings `json:"gatewaySettings,omitempty" desc:"settings for the helm generated gateways, leave nil to not render"`
ExtraEnvoyArgs []string `json:"extraEnvoyArgs,omitempty" desc:"envoy container args, (e.g. https://www.envoyproxy.io/docs/envoy/latest/operations/cli)"`
ExtraContainersHelper string `json:"extraContainersHelper,omitempty"`
ExtraInitContainersHelper string `json:"extraInitContainersHelper",omitempty`
ExtraVolumeHelper string `json:"extraVolumeHelper",omitempty`
Expand Down
8 changes: 7 additions & 1 deletion install/helm/gloo/templates/7-gateway-proxy-deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,13 @@ spec:
{{- include $spec.extraInitContainersHelper $ | nindent 6 }}
{{- end }}
containers:
- args: ["--disable-hot-restart"]
- args:
- --disable-hot-restart
{{- with $spec.extraEnvoyArgs}}
{{- range . }}
- {{ . }}
{{- end }}
{{- end}}
env:
- name: POD_NAMESPACE
valueFrom:
Expand Down
3 changes: 1 addition & 2 deletions projects/envoyinit/cmd/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ func main() {
}

// best effort - write to a file for debug purposes.
// this might fail if root fs is ready only
// this might fail if root fs is read only
writeConfig(outCfg)

env := os.Environ()
Expand All @@ -50,7 +50,6 @@ func main() {
if err := syscall.Exec(args[0], args, env); err != nil {
panic(err)
}

}

func envoy() string {
Expand Down

0 comments on commit 8a653ee

Please sign in to comment.