-
Notifications
You must be signed in to change notification settings - Fork 333
New ingress controller chart #3140
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from 36 commits
Commits
Show all changes
40 commits
Select commit
Hold shift + click to select a range
91c1cdb
init WIP
jschaul 09dfeb4
changelog
jschaul d3e85bf
more overrrides: log format, TLS 1.3 ciphers
jschaul 91bccf2
shorten names of installed helm charts
jschaul 11599e9
rename, add to makefile releases
jschaul 2a4c0e9
also add new chart to list of charts for integration tests
jschaul 1def7e5
move dependencies to Chart.yaml
jschaul 7c05c58
also download dependencies of helm charts if specified inside Chart.yaml
jschaul f3ab942
update comment
jschaul f7238a1
overrides
jschaul 018290e
move overrides to correct location
jschaul f7693b9
switch helmfile over to new ingress for testing...
jschaul a601a4c
update changelog
jschaul 744b9aa
add deprecated comment to old chart
jschaul ce294c3
try out conditionals in helm chart
jschaul 281dea9
add kubernetes version in manually into helmfile
jschaul b4f50b7
...
jschaul 6f6f7df
fixup
jschaul 3fe920b
...
jschaul 4501a33
do conditional logic inside bash, not helmfile (as that doesn't work …
jschaul 8ed166a
Add oidc login to work with kubernetes clusters beind oidc
jschaul a2cb504
also set INGRESS_CHART in teardown script
jschaul abe1c18
update outdated instructions from old readme
jschaul cba54b0
allow overriding ingress class; override it for integration tests
jschaul 1f72696
...
jschaul 17f5190
update helmfile to latest
jschaul e0a24de
remove patched helm binary; use default from nixpkgs
jschaul 3838742
helmfile: needs
jschaul f6b8df6
don't watch all ingresses, but only those in the right class
jschaul c92ee42
override ingressClass in CI consistently
jschaul db3e342
disable validation webhooks in CI
jschaul f8196c0
also adjust helmfile-single
jschaul 049ace7
adjust federation-test-helper service to match new ingress-controller
jschaul 4d463ef
adjust changelog
jschaul 3bb1b20
also add changelog for internal changes
jschaul d471714
Apply suggestions from code review
jschaul 96d270f
Add docs; switch defaults to Load Balancer as suggested in PR review
jschaul 9d74921
tweak documentation
jschaul 5eba47a
more docs tweaks
jschaul 344d6e2
link to docs in changelog
jschaul File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or 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 hidden or 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,35 @@ | ||
New 'ingress-nginx-controller' wrapper chart compatible with kubernetes versions [1.23 - 1.26]. The old one 'nginx-ingress-controller' (compatible only up to k8s 1.19) is now DEPRECATED. | ||
We advise to upgrade your version of kubernetes in use to 1.23 or higher (we tested on kubernetes version 1.26), and to make use of the new ingress controller chart. Main features: | ||
- up-to-date nginx version ('1.21.6') | ||
- TLS 1.3 support (including allowing specifying which cipher suites to use) | ||
- security fixes | ||
- no more accidental logging of Wire access tokens under specific circumstances | ||
|
||
The 'kind: Ingress' resources installed via 'nginx-ingress-services' chart remain compatible with both the old and the new ingress controller, and k8s versions [1.18 - 1.26]. In case you upgrade an existing kubernetes cluster (not recommended), you may need to first uninstall the old controller before installing the new controller chart. | ||
|
||
In case you have custom overrides, you need to modify the directory name and top-level configuration key: | ||
|
||
```diff | ||
# If you have overrides for the controller chart (such as cipher suites), ensure to rename file and top-level key: | ||
-# nginx-ingress-controller/values.yaml | ||
+# ingress-nginx-controller/values.yaml | ||
-nginx-ingress: | ||
+ingress-nginx: | ||
controller: | ||
# ... | ||
``` | ||
|
||
and double-check if all overrides you use are indeed provided under the same name by the upstream chart. See also the default overrides in [the default values.yaml](https://github.com/wireapp/wire-server/blob/develop/charts/ingress-nginx-controller/values.yaml). | ||
|
||
In case you use helmfile change your ingress controller like this: | ||
|
||
```diff | ||
# helmfile.yaml | ||
releases: | ||
- - name: 'nginx-ingress-controller' | ||
+ - name: 'ingress-nginx-controller' | ||
namespace: 'wire' | ||
- chart: 'wire/nginx-ingress-controller' | ||
+ chart: 'wire/ingress-nginx-controller' | ||
version: 'CHANGE_ME' | ||
``` |
This file contains hidden or 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,5 @@ | ||
- integration tests on CI will use either the old or the new ingress controller; depending on which kubernetes version they run on. | ||
- upgrade `kubectl` to default from the nixpkgs channel (currently `1.26`) by removing the manual version pin on 1.19 | ||
- upgrade `helmfile` to default from the nixpkgs channel by removing the manual version pin | ||
- upgrade `helm` to default from the nixpkgs channel by removing the manual version pin | ||
- add `kubelogin-oidc` so the kubectl in this environment can also talk to kubernetes clusters using OIDC |
This file contains hidden or 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,8 @@ | ||
apiVersion: v2 | ||
description: A Helm chart for an ingress controller (using nginx) on Kubernetes | ||
name: ingress-nginx-controller | ||
version: 0.0.42 | ||
dependencies: | ||
- name: ingress-nginx | ||
version: 4.5.2 # k8s compatibility [1.23 - 1.26] | ||
repository: https://kubernetes.github.io/ingress-nginx |
This file contains hidden or 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,44 @@ | ||
# the following defaults apply to an on-prem bare-metal setup in the same spirit as the | ||
# older similarly named wrapper chart 'nginx-ingress-controller' (note the swapped words | ||
# 'nginx' and 'ingress') We assume no load balancer support and instead expose NodePorts | ||
# on ports 31773 and 31772, assuming traffic gets to these ports in another way. | ||
# | ||
# See https://github.com/kubernetes/ingress-nginx/blob/main/charts/ingress-nginx/values.yaml for all possible values to override. | ||
ingress-nginx: | ||
controller: | ||
enableTopologyAwareRouting: true | ||
# -- Use a `DaemonSet` or `Deployment` | ||
kind: DaemonSet | ||
service: | ||
type: NodePort # or LoadBalancer | ||
externalTrafficPolicy: Local | ||
nodePorts: | ||
# The nginx instance is exposed on ports 31773 (https) and 31772 (http) | ||
# on the node on which it runs. You should add a port-forwarding rule | ||
# on the node or on the loadbalancer that forwards ports 443 and 80 to | ||
# these respective ports. | ||
https: 31773 | ||
http: 31772 | ||
config: | ||
# NOTE: These are some sane defaults (compliant to TR-02102-2), you may want to overrride them on your own installation | ||
# For TR-02102-2 see https://www.bsi.bund.de/SharedDocs/Downloads/EN/BSI/Publications/TechGuidelines/TG02102/BSI-TR-02102-2.html | ||
# As a Wire employee, for Wire-internal discussions and context see | ||
# * https://wearezeta.atlassian.net/browse/FS-33 | ||
# * https://wearezeta.atlassian.net/browse/FS-444 | ||
ssl-protocols: "TLSv1.2 TLSv1.3" | ||
# override cipher suites used in TLS 1.2 (only, if TLS 1.2 is used) | ||
ssl-ciphers: "ECDHE-ECDSA-AES256-GCM-SHA384:ECDHE-RSA-AES256-GCM-SHA384" | ||
# override cipher suites used in TLS 1.3 (only, if TLS 1.3 is used) | ||
server-snippet: "ssl_conf_command Ciphersuites TLS_AES_128_GCM_SHA256:TLS_AES_256_GCM_SHA384;" | ||
# used to be called http2-max-(header|field)-size, removed in controller v1.3 | ||
large-client-header-buffers: "16 32k" | ||
proxy-buffer-size: "16k" | ||
proxy-body-size: "1024m" | ||
hsts-max-age: "31536000" | ||
# Override log format to remove logging access tokens: | ||
# removes 'request_query: "$args"', since it can include '?access_token=...' | ||
# (sometimes sent for assets and websocket establishments) | ||
# We do not wish to log these (SEC-47) | ||
# Also add ssl/tls protocol/cipher to gain some observability here (can we turn off TLS 1.2?) | ||
log-format-escape-json: true | ||
log-format-upstream: '{"bytes_sent": "$bytes_sent", "duration": "$request_time", "http_referrer": "$http_referer", "http_user_agent": "$http_user_agent", "method": "$request_method", "path": "$uri", "remote_addr": "$proxy_protocol_addr", "remote_user": "$remote_user", "request_id": "$req_id", "request_length": "$request_length", "request_proto": "$server_protocol", "request_time": "$request_time", "status": "$status", "time": "$time_iso8601", "tls_cipher": "$ssl_cipher", "tls_protocol": "$ssl_protocol", "vhost": "$host", "x_forwarded_for": "$proxy_add_x_forwarded_for"}' |
This file contains hidden or 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,4 +1,5 @@ | ||
apiVersion: v1 | ||
description: A Helm chart for an ingress controller (using nginx) on Kubernetes | ||
description: ingress-controller. DEPRECATED. Use ingress-nginx-controller chart instead. | ||
name: nginx-ingress-controller | ||
version: 0.0.42 | ||
deprecated: true |
This file contains hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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
19 changes: 19 additions & 0 deletions
19
hack/helm_vars/ingress-nginx-controller/values.yaml.gotmpl
This file contains hidden or 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,19 @@ | ||
ingress-nginx: | ||
controller: | ||
ingressClassResource: | ||
name: "nginx-{{ .Release.Namespace }}" | ||
# -- Is this ingressClass enabled or not | ||
enabled: true | ||
ingressClass: "nginx-{{ .Release.Namespace }}" | ||
kind: Deployment | ||
replicaCount: 1 | ||
service: | ||
nodePorts: | ||
# choose a random free port | ||
https: null | ||
http: null | ||
# in CI, do not use ValidatingWebhooks, as these, if not properly cleaned up | ||
# (i.e. the ingress controller was deleted in another namespace but the webhook remains) | ||
# prevent new kind:Ingress resources to be created in the cluster. | ||
admissionWebhooks: | ||
enabled: false |
4 changes: 3 additions & 1 deletion
4
...vars/nginx-ingress-controller/values.yaml → ...inx-ingress-controller/values.yaml.gotmpl
This file contains hidden or 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 hidden or 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
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
A more opportunistic default here would be to use
type: Deployment
andtype: LoadBalancer
, and document how to configure this if you have to resort to NodePort.The NodePort approach always requires manual configuration of some external load balancer/firewall to round-robin between node IPs and is error-prone. It's also a bit annoying to have to decide on some global ports that may not be used otherwise.
Most managed K8s clusters have support for LoadBalancers, you can also get this for your own clusters in hcloud etc. It's even possible to do it for pure bare metal, without any "load balancer hardware", by using BGP or some leadership election over who's announcing the "load balancer ip" via ARP (https://metallb.universe.tf/configuration/_advanced_l2_configuration/).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I swapped the defaults as you suggested and documented how to get the previous behaviour back.