Search code examples
nginxkubernetesgoogle-cloud-platformgoogle-compute-engineload-balancing

Kubernetes on GCE: Ingress Timeout Configuration


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?


Solution

  • 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