Kubernetes on GCE: Ingress Timeout Configuration

6/17/2017

I'm running Kubernetes on Google Compute Engine (GCE). I have an Ingress set up. Everything works perfectly except when I upload large files, the L7 HTTPS Load Balancer terminates the connection after 30 seconds. I know that I can bump this up manually in the "Backend Service", but I'm wondering if there is a way to do this from the Ingress spec. I worry that my manual tweak will get changed back to 30s later on.

The nginx ingress controller has a number of annotations that can be used to configure nginx. Does the GCE L7 Load Balancer have something similar?

-- Jesse Shieh
google-compute-engine
kubernetes
load-balancing
nginx

2 Answers

1/9/2020

This can now be configured within GKE, by using a custom resource BackendConfig.

apiVersion: cloud.google.com/v1beta1
kind: BackendConfig
metadata:
  name: my-bconfig
spec:
  timeoutSec: 60

And then configuring your Service to use this configuration with an annotation:

apiVersion: v1
kind: Service
metadata:
  name: my-service
  annotations:
    beta.cloud.google.com/backend-config: '{"ports": {"80":"my-bconfig"}}'
spec:
  ports:
  - port: 80
  .... other fields

See Configuring a backend service through Ingress

-- Jonas
Source: StackOverflow

10/24/2017

For anyone else looking for the solution to this problem, timeout and other settings (e.g. enable CDN) can only be configured manually at the moment.

Follow this kubernetes/ingress-gce issue for the latest updates on a long-term solution.

-- tmirks
Source: StackOverflow