<p>I have a service which is long-running (in a <code>while 1</code> loop) and processes payloads via GCloud pub/sub, after which it writes the result to a DB.</p>

<p>The service doesn't need to listen on any port.</p>

<p><strong>What would the declarative YAML config look like for <code>Kind=Deployment</code>?</strong></p>

<p>I understand <code>ClusterIP</code> is the default type, and the docs <a href="https://kubernetes.io/docs/concepts/services-networking/service/#headless-services" rel="noreferrer">go on to say</a> that a headless service just has to define <code>spec.clusterIP</code> as <code>None</code>.</p>

<p>(A better practice would probably be to modify the worker to exit after a successful payload processing, and change the <code>Kind</code> to <code>Job</code>, but this is in the backlog)</p>

<p>What you're describing sounds more like a job or a deployment than a service. You can run a deployment (which creates a replicaset, which ensures a certain number of replicas are running) without creating a service. </p>

<p>If your pod isn't exposing any network services for others to consume, there's very little reason to create a service. </p>
