<p>Every time a deployment gets updated, a new replica set is added to a long list. Should the old rs be cleaned?</p>

<p>Removing old replicasets is part of the Deployment object, but it is optional. You can set <a href="https://kubernetes.io/docs/concepts/workloads/controllers/deployment/#revision-history-limit" rel="noreferrer"><code>.spec.revisionHistoryLimit</code></a> to tell the Deployment how many old replicasets to keep around.</p>
<p>Here is a YAML example:</p>
<pre class="lang-yaml prettyprint-override"><code>apiVersion: apps/v1
kind: Deployment
# ...
spec:
  # ...
  revisionHistoryLimit: 0 # Default to 10 if not specified
  # ...
</code></pre>
