Configuring Traefik timeout values for large file uploads and downloads

When uploading or downloading large files, the default timeout value for readTimeout, writeTimeout and idleTimeout errors in Traefik proxy might not be sufficient. You can set the Traefik proxy timeout to a new duration instead of the default value.

  1. Back up the ConfigMap.
    kubectl -n [***NAMESPACE***] get cm traefik-config -o yaml > /tmp/traefik-config.backup.yaml
  2. Edit the Traefik ConfigMap.
    kubectl edit configmap traefik-config -n [***NAMESPACE***]
  3. You can optionally add or update the timeout value fields to manually specify the timeout values in the data.traefik.toml section of the ConfigMap file in Cloudera AI on premises 1.5.5 SP2 and higher releases.
    [entryPoints.web.transport.respondingTimeouts]
    readTimeout = [***TIMEOUT VALUE***]
      writeTimeout = [***TIMEOUT VALUE***]
      idleTimeout = [***TIMEOUT VALUE***]
    
    [entryPoints.websecure.transport.respondingTimeouts]
      readTimeout = [***TIMEOUT VALUE***]
      writeTimeout = [***TIMEOUT VALUE***]
      idleTimeout = [***TIMEOUT VALUE***]
  4. Restart the Traefik proxy to ensure it applies the changes.
    kubectl -n [***NAMESPACE***] rollout restart deployment/ingress-controller
  5. Verify that the changes are implemented.
    kubectl -n [***NAMESPACE***] get cm traefik-config -o jsonpath='{.data.traefik\.toml}' | grep -A3 respondingTimeouts
    
To perform a rollback, use the following commands:
kubectl -n [***NAMESPACE***] apply -f /tmp/traefik-config.backup.yaml
kubectl -n [***NAMESPACE***] rollout restart deployment/ingress-controller