-
Notifications
You must be signed in to change notification settings - Fork 333
Add support for envoy gateway #5150
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
Open
smatting
wants to merge
72
commits into
develop
Choose a base branch
from
WPB-23903-routes-1
base: develop
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
72 commits
Select commit
Hold shift + click to select a range
3c13e5e
wip
smatting 0e32863
checkboxes
smatting 9487700
mention nginx-ingress-services in the backwards compatbility section
smatting 466b51b
scaffolding + helpers
smatting c3fb370
modify .envrc for development
smatting aa46978
update plan
smatting 9404385
phase 2-3
smatting 7c6c5d6
Allow for externally created secret
smatting 357edd5
nginz routes
smatting ad89047
more routes
smatting f2f4e3c
Adjust plan: routes together with services
smatting 2af357a
team settings and account pages
smatting 7e27e06
fake-s3 route
smatting b2a50c4
complete federator phase
smatting c2ba573
use different secret name for federators certificate
smatting 0fb6404
udpate plan notes for federation helper
smatting 2106e42
wip integrations tests
smatting d565e87
Add post-upgrade hook to all tests
smatting 6a77715
use type: ClusterIP on gateway instead of LoadBlancer, use port 10443
smatting 47888ec
make mtls client cert validation optional at the ingress level
smatting ae2bd53
add todo
smatting f3f6d88
support sharing envoyproxy objects
smatting 91c7f98
remove skipPriviledgedPortCheck
smatting 0772c5a
integration chart: remove ingress (and service targeting ingress)
smatting 59a3fd2
complete todo
smatting b0931a1
drop customSolversSecrets
smatting 8f74de5
update README
smatting abf7f54
add TODO
smatting 76a48ee
integration tests: fix originDomains
smatting 2b1fa53
add go.sh
smatting ed723b6
force explicit hostnames in gateway listeners
smatting fa24187
fix trailing dot problem of integration tests.
smatting d989c8d
remove unused ExternalName service from previous attempts
smatting b23471b
Revert "integration chart: remove ingress (and service targeting ingr…
smatting 62df1dd
wip integration envoy
smatting d014c4f
fix (workaround): [emerg] 850#850: too long path in the unix domain …
smatting 12c652e
wip
smatting 16ac8c7
use new build in go.sh
smatting 6ab8ec0
run all tests
smatting 75795d1
add TODOs
smatting a4f54a4
make ingress mode configurable for integration tests
smatting bc99a36
replace envoy-gateway-system hardcoded name with var
smatting 1735bb4
envoy patch policies
smatting 60aa86f
rename federation-test-helper.yaml to service-test-fed.yaml
smatting 66382bd
update parameter documentation
smatting e9cb81a
use a different patch policy to support the FQDMs
smatting e1e3169
test envoy by default
smatting 457f1d7
follow-up to patch policies: make configurable
smatting c34eeb7
update envoypatchpolicy section
smatting 329198f
wip migration guide
smatting 373bc43
polish a bit
smatting a6da965
move planning out of readme
smatting caf3618
small corrections
smatting e6d9479
revert to normal
smatting b57c883
remove unused file
smatting dba41cc
revert file
smatting d5a92ef
update comment
smatting fb06b53
rename file ingress-envoy.aml to envoy-gateway.yaml
smatting 6fce96e
add missing backentrafficpolicy to support websockets
smatting a51ed9e
remove CLAUDE.md
smatting f5b4422
moved todo to ticket
smatting d27cf75
prevent any untested changes to the nginx-ingress-services chart
smatting 1206c78
remove PLAN.md
smatting a59a6c7
add changelog entry
smatting 300c32e
Prevent spoofing of the X-SSL-Certificate header
smatting 249e3b5
fix: remove unused arg
smatting adc4668
integration tests: Prevent spoofing of the X-SSL-Certificate header
smatting d9dac75
Set namespace consitently
smatting 196c682
apply labels consitenly
smatting 7f220cc
leave comments to keep service names in-sync
smatting 0377f36
Fix spelling
smatting 05e23ad
integration tests: solve trailing dot same way as rest
smatting 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 @@ | ||
| New `wire-ingress` Helm chart — Gateway API / Envoy Gateway replacement for `nginx-ingress-services`. Not yet production-ready. |
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,161 @@ | ||
| {{- if .Values.envoy.enabled }} | ||
| {{- $gatewayName := include "integration.getDynBackendsGatewayName" . }} | ||
| {{- $httpsPort := int .Values.envoy.gateway.listeners.https.port }} | ||
| {{- $controllerNs := .Values.envoy.controllerNamespace }} | ||
| {{- if lt $httpsPort 1024 }} | ||
| {{- fail (printf "envoy.gateway.listeners.https.port is %d (privileged, <1024). Envoy Gateway remaps it to %d on the proxy pod. Set envoy.gateway.listeners.https.port to the actual container port (e.g. %d)." $httpsPort (add $httpsPort 10000) (add $httpsPort 10000)) }} | ||
| {{- end }} | ||
| --- | ||
| # EnvoyProxy configures the proxy deployment/service for the dynamic-backends Gateway. | ||
| apiVersion: gateway.envoyproxy.io/v1alpha1 | ||
| kind: EnvoyProxy | ||
| metadata: | ||
| name: {{ $gatewayName }} | ||
| spec: | ||
| provider: | ||
| type: Kubernetes | ||
| kubernetes: | ||
| envoyService: | ||
| # ClusterIP: no external load balancer needed for in-cluster integration tests. | ||
| type: ClusterIP | ||
| --- | ||
| # Gateway for all dynamic backends. A single HTTPS listener covers all backend hostnames. | ||
| apiVersion: gateway.networking.k8s.io/v1 | ||
| kind: Gateway | ||
| metadata: | ||
| name: {{ $gatewayName }} | ||
| spec: | ||
| gatewayClassName: {{ required "envoy.gateway.className is required when envoy.enabled is true" .Values.envoy.gateway.className | quote }} | ||
| infrastructure: | ||
| parametersRef: | ||
| group: gateway.envoyproxy.io | ||
| kind: EnvoyProxy | ||
| name: {{ $gatewayName | quote }} | ||
| listeners: | ||
| - name: https | ||
| port: {{ $httpsPort }} | ||
| protocol: HTTPS | ||
| tls: | ||
| mode: Terminate | ||
| certificateRefs: | ||
| - name: {{ .Values.envoy.federator.tls.secretName | quote }} | ||
| kind: Secret | ||
| --- | ||
| # ClientTrafficPolicy enforces optional mTLS client cert validation on all dynamic-backend | ||
| # connections (mirrors the nginx auth-tls-verify-client: "on" annotation). | ||
| apiVersion: gateway.envoyproxy.io/v1alpha1 | ||
| kind: ClientTrafficPolicy | ||
| metadata: | ||
| name: {{ $gatewayName }}-mtls | ||
| spec: | ||
| targetRefs: | ||
| - group: gateway.networking.k8s.io | ||
| kind: Gateway | ||
| name: {{ $gatewayName | quote }} | ||
| sectionName: https | ||
| tls: | ||
| clientValidation: | ||
| optional: true | ||
| caCertificateRefs: | ||
| - name: federator-ca | ||
| kind: ConfigMap | ||
| --- | ||
| {{- $backendNames := keys .Values.config.dynamicBackends | sortAlpha }} | ||
| {{- range $index, $name := $backendNames }} | ||
| {{- $dynamicBackend := index $.Values.config.dynamicBackends $name }} | ||
| {{- $httpRouteName := printf "%s-dynbackend-%s" $gatewayName $name }} | ||
| {{- $svcDomain := printf "%s-%s.%s.svc.cluster.local" $dynamicBackend.federatorExternalHostPrefix $.Release.Namespace $controllerNs }} | ||
| --- | ||
| apiVersion: gateway.networking.k8s.io/v1 | ||
| kind: HTTPRoute | ||
| metadata: | ||
| name: {{ $httpRouteName }} | ||
| spec: | ||
| parentRefs: | ||
| - name: {{ $gatewayName | quote }} | ||
| namespace: {{ $.Release.Namespace | quote }} | ||
| kind: Gateway | ||
| sectionName: https | ||
| hostnames: | ||
| - {{ $svcDomain | quote }} | ||
| rules: | ||
| - matches: | ||
| - path: | ||
| type: PathPrefix | ||
| value: / | ||
| backendRefs: | ||
| - name: integration | ||
| port: {{ $dynamicBackend.federatorExternalPort }} | ||
| kind: Service | ||
| --- | ||
| # EnvoyExtensionPolicy injects the mTLS client certificate as X-SSL-Certificate request | ||
| # header, matching the nginx $ssl_client_escaped_cert behaviour expected by federator. | ||
| apiVersion: gateway.envoyproxy.io/v1alpha1 | ||
| kind: EnvoyExtensionPolicy | ||
| metadata: | ||
| name: {{ $httpRouteName }}-cert-header | ||
| spec: | ||
| targetRefs: | ||
| - group: gateway.networking.k8s.io | ||
| kind: HTTPRoute | ||
| name: {{ $httpRouteName }} | ||
| lua: | ||
| - type: Inline | ||
| inline: | | ||
| function envoy_on_request(request_handle) | ||
| {{/* Strip any client-provided header to prevent spoofing */}} | ||
| request_handle:headers():remove("X-SSL-Certificate") | ||
| local ssl = request_handle:connection():ssl() | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. same headers():add issue
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. addressed in adc4668 |
||
| if ssl ~= nil then | ||
| local cert = ssl:urlEncodedPemEncodedPeerCertificate() | ||
| if cert ~= nil and cert ~= "" then | ||
| request_handle:headers():add("X-SSL-Certificate", cert) | ||
| end | ||
| end | ||
| end | ||
| --- | ||
| # EnvoyPatchPolicy adds the FQDN variant (with trailing dot) of the backend domain | ||
| # to the virtual host's domain list. Wire federator resolves targets via DNS SRV records; | ||
| # per RFC 2782, SRV record targets are FQDNs (e.g. "backend-fed.ns.svc.cluster.local."). | ||
| # HTTP/2 passes that dot in :authority; without this patch the virtual host only matches | ||
| # the bare domain and returns route_not_found. Adding the FQDN allows Envoy to match both. | ||
| apiVersion: gateway.envoyproxy.io/v1alpha1 | ||
| kind: EnvoyPatchPolicy | ||
| metadata: | ||
| name: {{ $httpRouteName }}-fqdn-domain | ||
| spec: | ||
| targetRef: | ||
| group: gateway.networking.k8s.io | ||
| kind: Gateway | ||
| name: {{ $gatewayName | quote }} | ||
| type: JSONPatch | ||
| jsonPatches: | ||
| - type: "type.googleapis.com/envoy.config.route.v3.RouteConfiguration" | ||
| # RouteConfiguration is per-listener, named <namespace>/<gateway>/<listener> | ||
| name: {{ printf "%s/%s/https" $.Release.Namespace $gatewayName | quote }} | ||
| operation: | ||
| op: add | ||
| # Virtual hosts are indexed in the order of stable key sorting (sortAlpha). | ||
| path: {{ printf "/virtual_hosts/%d/domains/-" $index | quote }} | ||
| value: {{ printf "%s." $svcDomain | quote }} | ||
| --- | ||
| # ClusterIP service in {{ $controllerNs }} selects the Envoy proxy pods for this Gateway. | ||
| # The service name determines the SRV record used by federation discovery: | ||
| # _wire-server-federator._tcp.{{ $svcDomain }} | ||
| apiVersion: v1 | ||
| kind: Service | ||
| metadata: | ||
| name: {{ $dynamicBackend.federatorExternalHostPrefix }}-{{ $.Release.Namespace }} | ||
| namespace: {{ $controllerNs }} | ||
| spec: | ||
| type: ClusterIP | ||
| ports: | ||
| - name: wire-server-federator | ||
| port: 443 | ||
| protocol: TCP | ||
| targetPort: {{ $httpsPort }} | ||
| selector: | ||
| gateway.envoyproxy.io/owning-gateway-name: {{ $gatewayName }} | ||
| gateway.envoyproxy.io/owning-gateway-namespace: {{ $.Release.Namespace }} | ||
| {{- end }} | ||
| {{- end }} | ||
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
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.
None of the five kinds here carry chart/release label