-
Notifications
You must be signed in to change notification settings - Fork 325
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
nginz deactivate unused upstreams (SQPIT-1174) (#2849)
Some upstreams are configured by default in nginz that have no backing service. This leads to many unnecessary DNS lookups and opens unused routes into our K8s clusters (which might be a security issue). Upstream configuration in nginz goes from two entries (ignored_upstreams, upstreams) to four (ignored_upstreams, upstreams, enabled_extra_upstreams, extra_upstreams): - ignored_upstreams : default upstreams that should be ignored (for backwards compatibility) - upstreams : default upstreams (kept for backwards compatibility) - enabled_extra_upstreams : Extra upstreams that should be enabled (routed / rendered; this one is new) - extra_upstreams : Contains upstreams that are usually not deployed by default (this is new, too) Co-authored-by: jschaul <[email protected]>
- Loading branch information
Showing
7 changed files
with
135 additions
and
15 deletions.
There are no files selected for viewing
10 changes: 10 additions & 0 deletions
10
changelog.d/2-features/disable-extra-nginz-upstreams-by-default
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
**Nginz helm chart**: The list of upstreams is split into `nginx_conf.upstreams` and | ||
`nginx_conf.extra_upstreams`. Extra upstreams are disabled by default. They can | ||
be enabled by adding their name (entry's key) to | ||
`nginx_conf.enabled_extra_upstreams`. `nginx_conf.ignored_upstreams` is only | ||
applied to upstreams from `nginx_conf.upstreams`. In the default configuration | ||
of `nginz` extra upstreams are `ibis`, `galeb`, `calling-test` and `proxy`. If one | ||
of those is deployed, its name has be be added to | ||
`nginx_conf.enabled_extra_upstreams` (otherwise, it won't be reachable). Unless | ||
`nginx_conf.upstreams` hasn't been changed manually (overriding its default), | ||
this should be the only needed migration step. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,4 @@ | ||
{{ define "nginz_upstreams.txt" }} | ||
{{ range $key, $value := .Values.nginx_conf.upstreams }}{{ if not (has $key $.Values.nginx_conf.ignored_upstreams) }} {{ $key }}{{ if hasKey $.Values.nginx_conf.upstream_namespace $key }}.{{ get $.Values.nginx_conf.upstream_namespace $key }}{{end}} {{ end }}{{ end -}} | ||
{{ end }} | ||
{{- define "nginz_upstreams.txt" }} | ||
{{- $validUpstreams := include "valid_upstreams" . | fromJson }} | ||
{{- range $key, $value := $validUpstreams }}{{ $key }}{{- if hasKey $.Values.nginx_conf.upstream_namespace $key }}.{{ get $.Values.nginx_conf.upstream_namespace $key }}{{end}} {{ end -}} | ||
{{- end }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters