kube-httpcache icon indicating copy to clipboard operation
kube-httpcache copied to clipboard

Extend Helm chart or Dockerfile with the option to run varnishnsca for full logs

Open spielkind opened this issue 4 years ago • 3 comments

Either run supervisord as Docker entry, to start varnishnsca: Example: https://github.com/globalgiving/docker-varnish-logging

Or better run varnishnsca via sidecar as Option in the Helm chart.

spielkind avatar Mar 05 '21 09:03 spielkind

I'm not particularly fond of using process managers like supervisord to host multiple services in the same container. In general, I think a sidecar container would be preferable (even though in this case, the sidecar would need to have access to Varnish's shared memory segment -- and I'm not sure how well that would work out. We've had earlier discussions about that btw, for example in #8).

martin-helmich avatar Mar 08 '21 07:03 martin-helmich

I have this working, by using the extraContainers, wouldn't be too hard of a stretch to add this to the chart with config to enable/disable and allow for logFormat to be overridden.

extraContainers:
  - name: varnishncsa
    image: quay.io/mittwald/kube-httpcache:stable
    command: ["/bin/sh", "-c", "sleep 10 && varnishncsa -F '%{Host}i %h %l %u %t \"%r\" %s %b \"%{Varnish:handling}x\" \"%{Referer}i\" \"%{User-agent}i\"'"]
    volumeMounts:
      - name: var
        mountPath: /var/lib/varnish

kmcrawford avatar Aug 18 '23 15:08 kmcrawford