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

HTTPRoute set a timeout #1612

Closed
itetradev opened this issue Dec 19, 2022 · 7 comments
Closed

HTTPRoute set a timeout #1612

itetradev opened this issue Dec 19, 2022 · 7 comments
Labels
kind/feature Categorizes issue or PR as related to a new feature.

Comments

@itetradev
Copy link

What would you like to be added:
I would like an option to set a custom timeout. I have only found this comment referencing timeout saying that they aren't supported. It mentions an alternative of how to implement them but the link provided just leads to a 404 page.

Why this is needed:
I have a WebSocket API and I need to increase the default timeout of 30s of HTTPRoute. It is not compatible with WebSockets as it drops the connection every 30s.

@itetradev itetradev added the kind/feature Categorizes issue or PR as related to a new feature. label Dec 19, 2022
@shaneutt
Copy link
Member

Is this for a specific implementation which you're using, or is this something you're trying to implement?

@itetradev
Copy link
Author

@shaneutt It's for an implementation I am using. Here is the yaml for my HTTPRoute:

kind: HTTPRoute
apiVersion: gateway.networking.k8s.io/v1beta1
metadata:
  name: public-store-route
  namespace: namespace
  labels:
    gateway: external-http
spec:
  hostnames:
  - "my-website.example.org"
  parentRefs:
  - name: external-http
  rules:
  - matches:
    - path:
        type: PathPrefix
        value: /west
    backendRefs:
    - group: net.gke.io
      kind: ServiceImport
      name: store-west-1
      port: 8080

The service store-west-1 is a REST API that has a WebSocket connection. The current default timeout is 30 seconds and after 30 seconds my WebSocket connection drops out.

I just want the option to be able to increase the timeout from the default 30 seconds to allow me to keep the WebSocket open for a longer time.

@shaneutt
Copy link
Member

Understood. At present, we consider things like timeouts to be implementation-specific and suggest a Policy-type API be provided by implementations for these kinds of things, see:

https://gateway-api.sigs.k8s.io/references/policy-attachment/

So if you can tell me which implementation your using I might be able to help determine how (and I suppose if) they implemented this and where the documentation is for that.

@itetradev
Copy link
Author

Ah, I understand. That makes sense to me now. Sorry for my stupidity earlier.

So I am using the gateway.networking.k8s.io/v1beta1 implementation (I think that's what you are asking). I was also looking at policy API (They have called it LBPolicy) but it doesn't seem to be working for me. This is my gateway configuration:

kind: Gateway
apiVersion: gateway.networking.k8s.io/v1beta1
metadata:
  name: external-http
  namespace: namespace
spec:
  addresses:
      - value: ext-gw
        type: NamedAddress
  gatewayClassName: gke-l7-gxlb-mc
  listeners:
  - name: https
    protocol: HTTPS
    port: 443
    tls:
      mode: Terminate
      options:
        networking.gke.io/pre-shared-certs: my-cert

I have tried to use the LBPolicy with the targetRef being the Gateway, HTTPRoute, Service, or ServiceImport and nothing seemed to change the timeout for me. Here is an example of the LBPolicy that I was trying to set up:

kind: LBPolicy
apiVersion: networking.gke.io/v1
metadata:
  name: gateway-timeout-policy
  namespace: namespace
spec:
  default:
    timeoutSec: 86400
  targetRef:
    name: external-http
    group: gateway.networking.k8s.io
    kind: Gateway

Here is a link to the GCP documentation that I've found:
https://cloud.google.com/kubernetes-engine/docs/how-to/configure-gateway-resources

Am I missing some step here?

@shaneutt
Copy link
Member

So I am using the gateway.networking.k8s.io/v1beta1 implementation (I think that's what you are asking)

When I say implementation, I mean the software which implements the APIs in gateway.networking.k8s.io/v1beta1, as in one of these:

https://gateway-api.sigs.k8s.io/implementations/

Gateway API is a specification which vendors can implement, it does nothing useful without some implementation of it deployed on the cluster (think similarly to StorageClass provisioners in that regard).

In this case your implementation would appear to be GKE. But note that this repository is not directly associated with Google or GKE and Google provides support for their Gateway API implementation separately (see #1275 (comment)). I recommend reaching out to their support, which as I understand it is via [email protected] as I don't believe they have a Github repo currently.

@itetradev
Copy link
Author

Yes, it should be GKE. Thanks for clearing up some stuff for me in regard to this issue.

/close

@k8s-ci-robot
Copy link
Contributor

@itetradev: Closing this issue.

In response to this:

Yes, it should be GKE. Thanks for clearing up some stuff for me in regard to this issue.

/close

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind/feature Categorizes issue or PR as related to a new feature.
Projects
None yet
Development

No branches or pull requests

3 participants