Skip to content
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

support other upgradeTypes then just websocket #4859

Open
foosinn opened this issue Dec 6, 2024 · 2 comments
Open

support other upgradeTypes then just websocket #4859

foosinn opened this issue Dec 6, 2024 · 2 comments
Labels

Comments

@foosinn
Copy link

foosinn commented Dec 6, 2024

Description:

Currently this section is automatically added to all dynamic https routes:

[...]
"upgradeConfigs": [
  {
    "upgradeType": "websocket"
  }
]
[...]

I was unable to find a way to modify that. For some tools (in my case https://github.com/juanfont/headscale) it's required to change this value.

It would be awesome to have that configurable. Thanks!

@foosinn foosinn added the triage label Dec 6, 2024
@foosinn
Copy link
Author

foosinn commented Dec 6, 2024

Found a workaround 🎉

  1. Enable EnvoyPatchPolicy: https://gateway.envoyproxy.io/latest/tasks/extensibility/envoy-patch-policy/#enable-envoypatchpolicy

  2. Apply the policy to the cluster (replace the Gateway in targetRef and the underscored domain in jsonPath with your values)

---
apiVersion: gateway.envoyproxy.io/v1alpha1
kind: EnvoyPatchPolicy
metadata:
  name: headscale
  namespace: envoy-gateway-system
spec:
  targetRef:
    group: gateway.networking.k8s.io
    kind: Gateway
    name: default
  type: JSONPatch
  jsonPatches:
    - type: "type.googleapis.com/envoy.config.route.v3.RouteConfiguration"
      name: envoy-gateway-system/default/https
      operation:
        op: replace
        jsonPath: "..virtual_hosts[?match(@.name, '.*vpn_example_org')].routes[0].route.upgrade_configs[0]"
        path: upgrade_type
        value: tailscale-control-protocol

@guydc
Copy link
Contributor

guydc commented Dec 11, 2024

Two additional use cases:

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants