Extend Helm chart or Dockerfile with the option to run varnishnsca for full logs
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.
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).
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