Kubernetes Nginx ingress timeout for two requests only

In our k8s ingress configuration we set timeout to 10min and its applying to all requests. Is it possible to configure timeout only to two requests like /my-service/v1/processfile and /my-service/v1/cachewarmup.

Currently our configuration is as follows:

---
apiVersion: networking.k8s.io/v1beta1
kind: Ingress
metadata:
  name: my-service
  annotations:
    nginx.ingress.kubernetes.io/proxy-connect-timeout: '600'
    nginx.ingress.kubernetes.io/proxy-send-timeout: '600'
    nginx.ingress.kubernetes.io/proxy-read-timeout: '600'
spec:
  rules:
  - host: my-service-dev1.eus1-devqa.geo.com
    http:
      paths:
      - path: /
        backend:
          serviceName: my-service-svc
          servicePort: 8080

Can anyone please help me to configure nginx ingress timeout for two requests only to 10min and all other requests default to 1min.


Yes, you can specify a separate Ingress resource that contains only those two paths, since Ingress matches by most specific pattern:

---
apiVersion: networking.k8s.io/v1beta1
kind: Ingress
metadata:
  name: my-service
  annotations:
    nginx.ingress.kubernetes.io/proxy-connect-timeout: '60'
    nginx.ingress.kubernetes.io/proxy-send-timeout: '60'
    nginx.ingress.kubernetes.io/proxy-read-timeout: '60'
spec:
  rules:
  - host: my-service-dev1.eus1-devqa.geo.com
    http:
      paths:
      - path: /
        backend:
          serviceName: my-service-svc
          servicePort: 8080
---
apiVersion: networking.k8s.io/v1beta1
kind: Ingress
metadata:
  name: my-service-600
  annotations:
    nginx.ingress.kubernetes.io/proxy-connect-timeout: '600'
    nginx.ingress.kubernetes.io/proxy-send-timeout: '600'
    nginx.ingress.kubernetes.io/proxy-read-timeout: '600'
spec:
  rules:
  - host: my-service-dev1.eus1-devqa.geo.com
    http:
      paths:
      - path: /my-service/v1/processfile
        backend:
          serviceName: my-service-svc
          servicePort: 8080
      - path: /my-service/v1/cachewarmup
        backend:
          serviceName: my-service-svc
          servicePort: 8080