How to set timeout for gloo ingress controller

856 Views Asked by At

I am replacing nginx ingress with gloo ingress controller in kubernetes cluster and want to set timeout for response.There is an annotation for this in nginx.

nginx.ingress.kubernetes.io/proxy-read-timeout: "60"

Is there anything similar this in gloo-ingress-controller or else do I have to use virtualservice for this?

1

There are 1 best solutions below

0
On BEST ANSWER

The only annotation that you are supposed to use with Gloo is kubernetes.io/ingress.class: gloo which is the standard way to mark an Ingress object as handled by a specific Ingress controller. This requirement will go away if you add the ability for Gloo to be the default Ingress controller for your cluster. Also, according to the documentation:

If you need more advanced routing capabilities, we encourage you to use Gloo VirtualServices by installing as glooctl install gateway.

Gloo Gateway uses Kubernetes Custom Resources instead of Ingress Objects as the only way to configure Ingress’ beyond their basic routing spec is to use lots of vendor-specific Kubernetes Annotations to your Kubernetes manifests.

So you are supposed to use VirtualService in order to achieve your goal. You can see the example below:

apiVersion: gateway.solo.io/v1
kind: VirtualService
metadata:
  name: 'default'
  namespace: 'gloo-system'
spec:
  virtualHost:
    domains:
    - '*'
    routes:
    - matchers:
       - prefix: '/petstore'
      routeAction:
        single:
          upstream:
            name: 'default-petstore-8080'
            namespace: 'gloo-system'
      options:
        timeout: '20s'
        retries:
          retryOn: 'connect-failure'
          numRetries: 3
          perTryTimeout: '5s'

I hope this helps.