<p>I'm working on deploying the Thanos monitoring system and one of its components, the metric compactor, warns that there should <em>never</em> be more than one compactor running at the same time. If this constraint is violated it will likely lead to corruption of metric data.</p>

<p>Is there any way to codify "Exactly One" pod via Deployment/StatefulSet/etc, aside from "just set <code>replicas: 1</code> and never scale"? We're using Rancher as an orchestration layer and it's <em>real</em> easy to hit that <code>+</code> button without thinking about it.</p>

Sammitch
<p>Limit the <code>replicas</code> in your deployment to <code>1</code></p>

<pre><code>apiVersion: extensions/v1beta1
kind: Deployment
metadata:
  name: my-app
spec:
  replicas: 1
</code></pre>
