Skip to content
This repository has been archived by the owner on Aug 25, 2021. It is now read-only.

Support passing extra arguments to injected envoy binary #675

Merged
merged 1 commit into from
Nov 9, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 12 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,17 @@
## Unreleased

IMPROVEMENTS:
* Connect: support passing extra arguments to the injected envoy sidecar. [[GH-675](https://github.com/hashicorp/consul-helm/pull/675)]

To pass extra arguments to envoy, set `connectInject.envoyExtraArgs` in your
Helm configuration:

```yaml
connectInject:
enabled: true
envoyExtraArgs: "--log-level debug --disable-hot-restart"
```

## 0.25.0 (Oct 12, 2020)

FEATURES:
Expand Down
3 changes: 3 additions & 0 deletions templates/connect-inject-deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,9 @@ spec:
-enable-health-checks-controller=true \
-health-checks-reconcile-period={{ .Values.connectInject.healthChecks.reconcilePeriod }} \
{{- end }}
{{- if .Values.connectInject.envoyExtraArgs }}
-envoy-extra-args="{{ .Values.connectInject.envoyExtraArgs }}" \
{{- end }}
{{- if .Values.connectInject.overrideAuthMethodName }}
-acl-auth-method="{{ .Values.connectInject.overrideAuthMethodName }}" \
{{- else if .Values.global.acls.manageSystemACLs }}
Expand Down
25 changes: 25 additions & 0 deletions test/unit/connect-inject-deployment.bats
Original file line number Diff line number Diff line change
Expand Up @@ -223,6 +223,31 @@ load _helpers
}


#--------------------------------------------------------------------
# extra envoy args

@test "connectInject/Deployment: extra envoy args can be set via connectInject" {
cd `chart_dir`
local actual=$(helm template \
-s templates/connect-inject-deployment.yaml \
--set 'connectInject.enabled=true' \
--set 'connectInject.envoyExtraArgs=--foo bar --boo baz' \
. | tee /dev/stderr |
yq '.spec.template.spec.containers[0].command | any(contains("-envoy-extra-args=\"--foo bar --boo baz\""))' | tee /dev/stderr)
[ "${actual}" = "true" ]
}

@test "connectInject/Deployment: extra envoy args are not set by default" {
cd `chart_dir`
local actual=$(helm template \
-s templates/connect-inject-deployment.yaml \
--set 'connectInject.enabled=true' \
. | tee /dev/stderr |
yq '.spec.template.spec.containers[0].command | any(contains("-envoy-extra-args"))' | tee /dev/stderr)
[ "${actual}" = "false" ]
}


#--------------------------------------------------------------------
# cert secrets

Expand Down
5 changes: 5 additions & 0 deletions values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -821,6 +821,11 @@ connectInject:
# at startup is completed.
reconcilePeriod: "1m"

# envoyExtraArgs is used to pass arguments to the injected envoy sidecar.
# Valid arguments to pass to envoy can be found here: https://www.envoyproxy.io/docs/envoy/latest/operations/cli
# e.g "--log-level debug --disable-hot-restart"
envoyExtraArgs: null

# Optional priorityClassName.
priorityClassName: ""

Expand Down