<p>I'm running a service written in go in a pod in Kubernetes. The service doesn't expose an HTTP interface; it's processing work from a queue.</p>

<p>I could:</p>

<ul>
<li>Use an executable liveness check to see if the process is running</li>
<li>Expose an HTTP health check endpoint</li>
<li>Use expvars to expose basic health data.</li>
</ul>

<p>Is there a common / idiomatic way of doing this in go/Kubernetes?</p>

<p>I won't get into reasoning about the convenience of instrumenting the process running into the pod to focus on the question.</p>

<p>I'd avoid creating another process inside the container to expose data, or modify the current process just to expose health endpoint, so I'd choose the liveness check exec way. It doesn't gets into your application and hopefully, it will only consume some cycles of CPU periodically. </p>

<p>Anyway, if you decide to expose health info from the pod, I'd use a <a href="http://kubernetes.io/docs/user-guide/pods/multi-container/" rel="nofollow">multi-container pod</a>, with the health exposing application as a sidecar and the working process in a different container.</p>
