skipper icon indicating copy to clipboard operation
skipper copied to clipboard

Can we use a startup parameters in an ingress rule?

Open kenotsolutions opened this issue 4 years ago • 2 comments

Hi,

I could not find my question answer in the repository. Can we use a startup parameter in an ingress rule? for example, I would like to use this disable-http-keepalives for only below ingress rule. I can disable it from Kubernetes skipper deployment but If I can I would like to disable keep alive for only this ingress rule not for all the k8s env.

I put it under annotations but it did not work there.

apiVersion: extensions/v1beta1
kind: Ingress
metadata:
  annotations:
    disable-http-keepalives: "true"
    kubectl.kubernetes.io/last-applied-configuration: |
    kubernetes.io/ingress-class: skipper-https
    proxy-preserve-host: "true"
    zalando.org/skipper-routes: |
      test: PathRegexp("/test") -> setResponseHeader("X", "bar") -> inlineContent("<html><body>hello</body></html>") ->     name: test-ingress
  namespace: dev-test
spec:
  rules:
  - host: dev.test.com
    http:
      paths:
      - backend:
          serviceName: frontend
          servicePort: 80
        pathType: ImplementationSpecific
status:
  loadBalancer: {}

kenotsolutions avatar Aug 05 '20 17:08 kenotsolutions

Hi Tolgay,

currently, this is not possible, because we use a shared connection pool and the individual routes currently don't have control on the connection states. But it's a good idea for a new feature.

How I would imagine, we could create a filter that instruments the proxy mechanism to use the connections in a specific way, like always create a new one and close after each request that are handled by a certain route. I don't know currently if this is feasible, but let's keep the issue open, maybe you or somebody else finds a way. PR welcome!

Note that we generate route objects from the ingresses, and the proxy component only deals with route objects.

Best, Arpad

aryszka avatar Aug 06 '20 12:08 aryszka

@aryszka what do you think about connection pool per backend? We could have a map[backend]*http.Client for example. Unclear to me if people would like to change it even more fine granular like per route.

szuecs avatar Nov 08 '20 19:11 szuecs