Skip to content

feat: allow disabling SNI matching on gateway#83

Merged
thesuperzapper merged 2 commits into
deployKF:mainfrom
thesuperzapper:feat-disabling-SNI-matching-on-gateway
Jan 27, 2024
Merged

feat: allow disabling SNI matching on gateway#83
thesuperzapper merged 2 commits into
deployKF:mainfrom
thesuperzapper:feat-disabling-SNI-matching-on-gateway

Conversation

@thesuperzapper

Copy link
Copy Markdown
Member

This PR allows users to disable SNI matching on the gateway by adding a new value deploykf_core.deploykf_istio_gateway.gateway.tls.matchSNI (which defaults to true).

Users may need to disable SNI matching when they are putting the deployKF gateway behind their own proxy which is doing TLS Termination, as most cloud proxies will not forward the original requests SNI to the backend system (e.g. AWS ALB). This is a very common issue, which even has its own Istio documentation page.

As part of this PR, we needed to work around the fact that Kubeflow Notebooks and Kubeflow TensorBoards currently always set their VirtualServices spec.hosts to *. This is a problem because our dashboard's VirtualService matches all HTTP paths on the domain, and Envoy/Istio treats that route as "more specific" and so more preferred than the * notebook route, meaning that all notebook traffic incorrectly ends up at the dashboard pods.

As a temporary measure until upstream kubeflow/kubeflow#6902 is merged and released, we resolve this issue by having a VirtualService that matches all /notebook/ paths which internally proxies the requests so that they have a different host/authority (notebooks-redirect.deploykf.example.com), which makes that request not match the dashboard route, and so end up at the notebook.

Note that notebooks-redirect.deploykf.example.com is NEVER served on the public-facing part of the gateway, and is only in-mesh (defined in the ServiceEntry called deploykf-istio-gateway), so there is no need to create a public DNS entry for it.

NOTE: this must be merged AFTER: #82

@thesuperzapper thesuperzapper added this to the v0.1.4 milestone Jan 25, 2024
@thesuperzapper
thesuperzapper force-pushed the feat-disabling-SNI-matching-on-gateway branch from a2af562 to e017a45 Compare January 27, 2024 22:54
@thesuperzapper
thesuperzapper merged commit 36b32c0 into deployKF:main Jan 27, 2024
@thesuperzapper
thesuperzapper deleted the feat-disabling-SNI-matching-on-gateway branch January 27, 2024 23:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant